/* THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source, please visit the github repository of this plugin */ var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __typeError = (msg) => { throw TypeError(msg); }; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); // src/postcss/postcss.js var require_postcss = __commonJS({ "src/postcss/postcss.js"(exports, module2) { (function(f) { if (typeof exports === "object" && typeof module2 !== "undefined") { module2.exports = f(); } else if (typeof define === "function" && define.amd) { define([], f); } else { var g2; if (typeof window !== "undefined") { g2 = window; } else if (typeof global !== "undefined") { g2 = global; } else if (typeof self !== "undefined") { g2 = self; } else { g2 = this; } g2.postcss = f(); } })(function() { var define2, module3, exports2; return (/* @__PURE__ */ (function() { function r(e2, n, t) { function o(i2, f) { if (!n[i2]) { if (!e2[i2]) { var c2 = "function" == typeof require && require; if (!f && c2) return c2(i2, true); if (u2) return u2(i2, true); var a = new Error("Cannot find module '" + i2 + "'"); throw a.code = "MODULE_NOT_FOUND", a; } var p2 = n[i2] = { exports: {} }; e2[i2][0].call(p2.exports, function(r2) { var n2 = e2[i2][1][r2]; return o(n2 || r2); }, p2, p2.exports, r, e2, n, t); } return n[i2].exports; } for (var u2 = "function" == typeof require && require, i = 0; i < t.length; i++) o(t[i]); return o; } return r; })())({ 1: [function(require2, module4, exports3) { "use strict"; exports3.byteLength = byteLength; exports3.toByteArray = toByteArray; exports3.fromByteArray = fromByteArray; var lookup = []; var revLookup = []; var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; for (var i = 0, len = code.length; i < len; ++i) { lookup[i] = code[i]; revLookup[code.charCodeAt(i)] = i; } revLookup["-".charCodeAt(0)] = 62; revLookup["_".charCodeAt(0)] = 63; function getLens(b64) { var len2 = b64.length; if (len2 % 4 > 0) { throw new Error("Invalid string. Length must be a multiple of 4"); } var validLen = b64.indexOf("="); if (validLen === -1) validLen = len2; var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4; return [validLen, placeHoldersLen]; } function byteLength(b64) { var lens = getLens(b64); var validLen = lens[0]; var placeHoldersLen = lens[1]; return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; } function _byteLength(b64, validLen, placeHoldersLen) { return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; } function toByteArray(b64) { var tmp; var lens = getLens(b64); var validLen = lens[0]; var placeHoldersLen = lens[1]; var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); var curByte = 0; var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen; var i2; for (i2 = 0; i2 < len2; i2 += 4) { tmp = revLookup[b64.charCodeAt(i2)] << 18 | revLookup[b64.charCodeAt(i2 + 1)] << 12 | revLookup[b64.charCodeAt(i2 + 2)] << 6 | revLookup[b64.charCodeAt(i2 + 3)]; arr[curByte++] = tmp >> 16 & 255; arr[curByte++] = tmp >> 8 & 255; arr[curByte++] = tmp & 255; } if (placeHoldersLen === 2) { tmp = revLookup[b64.charCodeAt(i2)] << 2 | revLookup[b64.charCodeAt(i2 + 1)] >> 4; arr[curByte++] = tmp & 255; } if (placeHoldersLen === 1) { tmp = revLookup[b64.charCodeAt(i2)] << 10 | revLookup[b64.charCodeAt(i2 + 1)] << 4 | revLookup[b64.charCodeAt(i2 + 2)] >> 2; arr[curByte++] = tmp >> 8 & 255; arr[curByte++] = tmp & 255; } return arr; } function tripletToBase64(num) { return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63]; } function encodeChunk(uint8, start, end) { var tmp; var output = []; for (var i2 = start; i2 < end; i2 += 3) { tmp = (uint8[i2] << 16 & 16711680) + (uint8[i2 + 1] << 8 & 65280) + (uint8[i2 + 2] & 255); output.push(tripletToBase64(tmp)); } return output.join(""); } function fromByteArray(uint8) { var tmp; var len2 = uint8.length; var extraBytes = len2 % 3; var parts = []; var maxChunkLength = 16383; for (var i2 = 0, len22 = len2 - extraBytes; i2 < len22; i2 += maxChunkLength) { parts.push(encodeChunk(uint8, i2, i2 + maxChunkLength > len22 ? len22 : i2 + maxChunkLength)); } if (extraBytes === 1) { tmp = uint8[len2 - 1]; parts.push( lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "==" ); } else if (extraBytes === 2) { tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1]; parts.push( lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "=" ); } return parts.join(""); } }, {}], 2: [function(require2, module4, exports3) { }, {}], 3: [function(require2, module4, exports3) { (function(Buffer2) { (function() { "use strict"; var base64 = require2("base64-js"); var ieee754 = require2("ieee754"); exports3.Buffer = Buffer3; exports3.SlowBuffer = SlowBuffer; exports3.INSPECT_MAX_BYTES = 50; var K_MAX_LENGTH = 2147483647; exports3.kMaxLength = K_MAX_LENGTH; Buffer3.TYPED_ARRAY_SUPPORT = typedArraySupport(); if (!Buffer3.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") { console.error( "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support." ); } function typedArraySupport() { try { var arr = new Uint8Array(1); arr.__proto__ = { __proto__: Uint8Array.prototype, foo: function() { return 42; } }; return arr.foo() === 42; } catch (e2) { return false; } } Object.defineProperty(Buffer3.prototype, "parent", { enumerable: true, get: function() { if (!Buffer3.isBuffer(this)) return void 0; return this.buffer; } }); Object.defineProperty(Buffer3.prototype, "offset", { enumerable: true, get: function() { if (!Buffer3.isBuffer(this)) return void 0; return this.byteOffset; } }); function createBuffer(length) { if (length > K_MAX_LENGTH) { throw new RangeError('The value "' + length + '" is invalid for option "size"'); } var buf = new Uint8Array(length); buf.__proto__ = Buffer3.prototype; return buf; } function Buffer3(arg, encodingOrOffset, length) { if (typeof arg === "number") { if (typeof encodingOrOffset === "string") { throw new TypeError( 'The "string" argument must be of type string. Received type number' ); } return allocUnsafe(arg); } return from(arg, encodingOrOffset, length); } if (typeof Symbol !== "undefined" && Symbol.species != null && Buffer3[Symbol.species] === Buffer3) { Object.defineProperty(Buffer3, Symbol.species, { value: null, configurable: true, enumerable: false, writable: false }); } Buffer3.poolSize = 8192; function from(value, encodingOrOffset, length) { if (typeof value === "string") { return fromString(value, encodingOrOffset); } if (ArrayBuffer.isView(value)) { return fromArrayLike(value); } if (value == null) { throw TypeError( "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value ); } if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { return fromArrayBuffer(value, encodingOrOffset, length); } if (typeof value === "number") { throw new TypeError( 'The "value" argument must not be of type number. Received type number' ); } var valueOf = value.valueOf && value.valueOf(); if (valueOf != null && valueOf !== value) { return Buffer3.from(valueOf, encodingOrOffset, length); } var b2 = fromObject(value); if (b2) return b2; if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") { return Buffer3.from( value[Symbol.toPrimitive]("string"), encodingOrOffset, length ); } throw new TypeError( "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value ); } Buffer3.from = function(value, encodingOrOffset, length) { return from(value, encodingOrOffset, length); }; Buffer3.prototype.__proto__ = Uint8Array.prototype; Buffer3.__proto__ = Uint8Array; function assertSize(size4) { if (typeof size4 !== "number") { throw new TypeError('"size" argument must be of type number'); } else if (size4 < 0) { throw new RangeError('The value "' + size4 + '" is invalid for option "size"'); } } function alloc(size4, fill, encoding) { assertSize(size4); if (size4 <= 0) { return createBuffer(size4); } if (fill !== void 0) { return typeof encoding === "string" ? createBuffer(size4).fill(fill, encoding) : createBuffer(size4).fill(fill); } return createBuffer(size4); } Buffer3.alloc = function(size4, fill, encoding) { return alloc(size4, fill, encoding); }; function allocUnsafe(size4) { assertSize(size4); return createBuffer(size4 < 0 ? 0 : checked(size4) | 0); } Buffer3.allocUnsafe = function(size4) { return allocUnsafe(size4); }; Buffer3.allocUnsafeSlow = function(size4) { return allocUnsafe(size4); }; function fromString(string, encoding) { if (typeof encoding !== "string" || encoding === "") { encoding = "utf8"; } if (!Buffer3.isEncoding(encoding)) { throw new TypeError("Unknown encoding: " + encoding); } var length = byteLength(string, encoding) | 0; var buf = createBuffer(length); var actual = buf.write(string, encoding); if (actual !== length) { buf = buf.slice(0, actual); } return buf; } function fromArrayLike(array) { var length = array.length < 0 ? 0 : checked(array.length) | 0; var buf = createBuffer(length); for (var i = 0; i < length; i += 1) { buf[i] = array[i] & 255; } return buf; } function fromArrayBuffer(array, byteOffset, length) { if (byteOffset < 0 || array.byteLength < byteOffset) { throw new RangeError('"offset" is outside of buffer bounds'); } if (array.byteLength < byteOffset + (length || 0)) { throw new RangeError('"length" is outside of buffer bounds'); } var buf; if (byteOffset === void 0 && length === void 0) { buf = new Uint8Array(array); } else if (length === void 0) { buf = new Uint8Array(array, byteOffset); } else { buf = new Uint8Array(array, byteOffset, length); } buf.__proto__ = Buffer3.prototype; return buf; } function fromObject(obj) { if (Buffer3.isBuffer(obj)) { var len = checked(obj.length) | 0; var buf = createBuffer(len); if (buf.length === 0) { return buf; } obj.copy(buf, 0, 0, len); return buf; } if (obj.length !== void 0) { if (typeof obj.length !== "number" || numberIsNaN(obj.length)) { return createBuffer(0); } return fromArrayLike(obj); } if (obj.type === "Buffer" && Array.isArray(obj.data)) { return fromArrayLike(obj.data); } } function checked(length) { if (length >= K_MAX_LENGTH) { throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes"); } return length | 0; } function SlowBuffer(length) { if (+length != length) { length = 0; } return Buffer3.alloc(+length); } Buffer3.isBuffer = function isBuffer(b2) { return b2 != null && b2._isBuffer === true && b2 !== Buffer3.prototype; }; Buffer3.compare = function compare(a, b2) { if (isInstance(a, Uint8Array)) a = Buffer3.from(a, a.offset, a.byteLength); if (isInstance(b2, Uint8Array)) b2 = Buffer3.from(b2, b2.offset, b2.byteLength); if (!Buffer3.isBuffer(a) || !Buffer3.isBuffer(b2)) { throw new TypeError( 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' ); } if (a === b2) return 0; var x2 = a.length; var y2 = b2.length; for (var i = 0, len = Math.min(x2, y2); i < len; ++i) { if (a[i] !== b2[i]) { x2 = a[i]; y2 = b2[i]; break; } } if (x2 < y2) return -1; if (y2 < x2) return 1; return 0; }; Buffer3.isEncoding = function isEncoding(encoding) { switch (String(encoding).toLowerCase()) { case "hex": case "utf8": case "utf-8": case "ascii": case "latin1": case "binary": case "base64": case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return true; default: return false; } }; Buffer3.concat = function concat2(list2, length) { if (!Array.isArray(list2)) { throw new TypeError('"list" argument must be an Array of Buffers'); } if (list2.length === 0) { return Buffer3.alloc(0); } var i; if (length === void 0) { length = 0; for (i = 0; i < list2.length; ++i) { length += list2[i].length; } } var buffer = Buffer3.allocUnsafe(length); var pos = 0; for (i = 0; i < list2.length; ++i) { var buf = list2[i]; if (isInstance(buf, Uint8Array)) { buf = Buffer3.from(buf); } if (!Buffer3.isBuffer(buf)) { throw new TypeError('"list" argument must be an Array of Buffers'); } buf.copy(buffer, pos); pos += buf.length; } return buffer; }; function byteLength(string, encoding) { if (Buffer3.isBuffer(string)) { return string.length; } if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { return string.byteLength; } if (typeof string !== "string") { throw new TypeError( 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string ); } var len = string.length; var mustMatch = arguments.length > 2 && arguments[2] === true; if (!mustMatch && len === 0) return 0; var loweredCase = false; for (; ; ) { switch (encoding) { case "ascii": case "latin1": case "binary": return len; case "utf8": case "utf-8": return utf8ToBytes(string).length; case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return len * 2; case "hex": return len >>> 1; case "base64": return base64ToBytes(string).length; default: if (loweredCase) { return mustMatch ? -1 : utf8ToBytes(string).length; } encoding = ("" + encoding).toLowerCase(); loweredCase = true; } } } Buffer3.byteLength = byteLength; function slowToString(encoding, start, end) { var loweredCase = false; if (start === void 0 || start < 0) { start = 0; } if (start > this.length) { return ""; } if (end === void 0 || end > this.length) { end = this.length; } if (end <= 0) { return ""; } end >>>= 0; start >>>= 0; if (end <= start) { return ""; } if (!encoding) encoding = "utf8"; while (true) { switch (encoding) { case "hex": return hexSlice(this, start, end); case "utf8": case "utf-8": return utf8Slice(this, start, end); case "ascii": return asciiSlice(this, start, end); case "latin1": case "binary": return latin1Slice(this, start, end); case "base64": return base64Slice(this, start, end); case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return utf16leSlice(this, start, end); default: if (loweredCase) throw new TypeError("Unknown encoding: " + encoding); encoding = (encoding + "").toLowerCase(); loweredCase = true; } } } Buffer3.prototype._isBuffer = true; function swap(b2, n, m) { var i = b2[n]; b2[n] = b2[m]; b2[m] = i; } Buffer3.prototype.swap16 = function swap16() { var len = this.length; if (len % 2 !== 0) { throw new RangeError("Buffer size must be a multiple of 16-bits"); } for (var i = 0; i < len; i += 2) { swap(this, i, i + 1); } return this; }; Buffer3.prototype.swap32 = function swap32() { var len = this.length; if (len % 4 !== 0) { throw new RangeError("Buffer size must be a multiple of 32-bits"); } for (var i = 0; i < len; i += 4) { swap(this, i, i + 3); swap(this, i + 1, i + 2); } return this; }; Buffer3.prototype.swap64 = function swap64() { var len = this.length; if (len % 8 !== 0) { throw new RangeError("Buffer size must be a multiple of 64-bits"); } for (var i = 0; i < len; i += 8) { swap(this, i, i + 7); swap(this, i + 1, i + 6); swap(this, i + 2, i + 5); swap(this, i + 3, i + 4); } return this; }; Buffer3.prototype.toString = function toString() { var length = this.length; if (length === 0) return ""; if (arguments.length === 0) return utf8Slice(this, 0, length); return slowToString.apply(this, arguments); }; Buffer3.prototype.toLocaleString = Buffer3.prototype.toString; Buffer3.prototype.equals = function equals(b2) { if (!Buffer3.isBuffer(b2)) throw new TypeError("Argument must be a Buffer"); if (this === b2) return true; return Buffer3.compare(this, b2) === 0; }; Buffer3.prototype.inspect = function inspect() { var str = ""; var max2 = exports3.INSPECT_MAX_BYTES; str = this.toString("hex", 0, max2).replace(/(.{2})/g, "$1 ").trim(); if (this.length > max2) str += " ... "; return ""; }; Buffer3.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { if (isInstance(target, Uint8Array)) { target = Buffer3.from(target, target.offset, target.byteLength); } if (!Buffer3.isBuffer(target)) { throw new TypeError( 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target ); } if (start === void 0) { start = 0; } if (end === void 0) { end = target ? target.length : 0; } if (thisStart === void 0) { thisStart = 0; } if (thisEnd === void 0) { thisEnd = this.length; } if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { throw new RangeError("out of range index"); } if (thisStart >= thisEnd && start >= end) { return 0; } if (thisStart >= thisEnd) { return -1; } if (start >= end) { return 1; } start >>>= 0; end >>>= 0; thisStart >>>= 0; thisEnd >>>= 0; if (this === target) return 0; var x2 = thisEnd - thisStart; var y2 = end - start; var len = Math.min(x2, y2); var thisCopy = this.slice(thisStart, thisEnd); var targetCopy = target.slice(start, end); for (var i = 0; i < len; ++i) { if (thisCopy[i] !== targetCopy[i]) { x2 = thisCopy[i]; y2 = targetCopy[i]; break; } } if (x2 < y2) return -1; if (y2 < x2) return 1; return 0; }; function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { if (buffer.length === 0) return -1; if (typeof byteOffset === "string") { encoding = byteOffset; byteOffset = 0; } else if (byteOffset > 2147483647) { byteOffset = 2147483647; } else if (byteOffset < -2147483648) { byteOffset = -2147483648; } byteOffset = +byteOffset; if (numberIsNaN(byteOffset)) { byteOffset = dir ? 0 : buffer.length - 1; } if (byteOffset < 0) byteOffset = buffer.length + byteOffset; if (byteOffset >= buffer.length) { if (dir) return -1; else byteOffset = buffer.length - 1; } else if (byteOffset < 0) { if (dir) byteOffset = 0; else return -1; } if (typeof val === "string") { val = Buffer3.from(val, encoding); } if (Buffer3.isBuffer(val)) { if (val.length === 0) { return -1; } return arrayIndexOf(buffer, val, byteOffset, encoding, dir); } else if (typeof val === "number") { val = val & 255; if (typeof Uint8Array.prototype.indexOf === "function") { if (dir) { return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset); } else { return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset); } } return arrayIndexOf(buffer, [val], byteOffset, encoding, dir); } throw new TypeError("val must be string, number or Buffer"); } function arrayIndexOf(arr, val, byteOffset, encoding, dir) { var indexSize = 1; var arrLength = arr.length; var valLength = val.length; if (encoding !== void 0) { encoding = String(encoding).toLowerCase(); if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") { if (arr.length < 2 || val.length < 2) { return -1; } indexSize = 2; arrLength /= 2; valLength /= 2; byteOffset /= 2; } } function read(buf, i2) { if (indexSize === 1) { return buf[i2]; } else { return buf.readUInt16BE(i2 * indexSize); } } var i; if (dir) { var foundIndex = -1; for (i = byteOffset; i < arrLength; i++) { if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { if (foundIndex === -1) foundIndex = i; if (i - foundIndex + 1 === valLength) return foundIndex * indexSize; } else { if (foundIndex !== -1) i -= i - foundIndex; foundIndex = -1; } } } else { if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; for (i = byteOffset; i >= 0; i--) { var found = true; for (var j2 = 0; j2 < valLength; j2++) { if (read(arr, i + j2) !== read(val, j2)) { found = false; break; } } if (found) return i; } } return -1; } Buffer3.prototype.includes = function includes(val, byteOffset, encoding) { return this.indexOf(val, byteOffset, encoding) !== -1; }; Buffer3.prototype.indexOf = function indexOf(val, byteOffset, encoding) { return bidirectionalIndexOf(this, val, byteOffset, encoding, true); }; Buffer3.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { return bidirectionalIndexOf(this, val, byteOffset, encoding, false); }; function hexWrite(buf, string, offset4, length) { offset4 = Number(offset4) || 0; var remaining = buf.length - offset4; if (!length) { length = remaining; } else { length = Number(length); if (length > remaining) { length = remaining; } } var strLen = string.length; if (length > strLen / 2) { length = strLen / 2; } for (var i = 0; i < length; ++i) { var parsed = parseInt(string.substr(i * 2, 2), 16); if (numberIsNaN(parsed)) return i; buf[offset4 + i] = parsed; } return i; } function utf8Write(buf, string, offset4, length) { return blitBuffer(utf8ToBytes(string, buf.length - offset4), buf, offset4, length); } function asciiWrite(buf, string, offset4, length) { return blitBuffer(asciiToBytes(string), buf, offset4, length); } function latin1Write(buf, string, offset4, length) { return asciiWrite(buf, string, offset4, length); } function base64Write(buf, string, offset4, length) { return blitBuffer(base64ToBytes(string), buf, offset4, length); } function ucs2Write(buf, string, offset4, length) { return blitBuffer(utf16leToBytes(string, buf.length - offset4), buf, offset4, length); } Buffer3.prototype.write = function write(string, offset4, length, encoding) { if (offset4 === void 0) { encoding = "utf8"; length = this.length; offset4 = 0; } else if (length === void 0 && typeof offset4 === "string") { encoding = offset4; length = this.length; offset4 = 0; } else if (isFinite(offset4)) { offset4 = offset4 >>> 0; if (isFinite(length)) { length = length >>> 0; if (encoding === void 0) encoding = "utf8"; } else { encoding = length; length = void 0; } } else { throw new Error( "Buffer.write(string, encoding, offset[, length]) is no longer supported" ); } var remaining = this.length - offset4; if (length === void 0 || length > remaining) length = remaining; if (string.length > 0 && (length < 0 || offset4 < 0) || offset4 > this.length) { throw new RangeError("Attempt to write outside buffer bounds"); } if (!encoding) encoding = "utf8"; var loweredCase = false; for (; ; ) { switch (encoding) { case "hex": return hexWrite(this, string, offset4, length); case "utf8": case "utf-8": return utf8Write(this, string, offset4, length); case "ascii": return asciiWrite(this, string, offset4, length); case "latin1": case "binary": return latin1Write(this, string, offset4, length); case "base64": return base64Write(this, string, offset4, length); case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return ucs2Write(this, string, offset4, length); default: if (loweredCase) throw new TypeError("Unknown encoding: " + encoding); encoding = ("" + encoding).toLowerCase(); loweredCase = true; } } }; Buffer3.prototype.toJSON = function toJSON() { return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) }; }; function base64Slice(buf, start, end) { if (start === 0 && end === buf.length) { return base64.fromByteArray(buf); } else { return base64.fromByteArray(buf.slice(start, end)); } } function utf8Slice(buf, start, end) { end = Math.min(buf.length, end); var res = []; var i = start; while (i < end) { var firstByte = buf[i]; var codePoint = null; var bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1; if (i + bytesPerSequence <= end) { var secondByte, thirdByte, fourthByte, tempCodePoint; switch (bytesPerSequence) { case 1: if (firstByte < 128) { codePoint = firstByte; } break; case 2: secondByte = buf[i + 1]; if ((secondByte & 192) === 128) { tempCodePoint = (firstByte & 31) << 6 | secondByte & 63; if (tempCodePoint > 127) { codePoint = tempCodePoint; } } break; case 3: secondByte = buf[i + 1]; thirdByte = buf[i + 2]; if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) { tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63; if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) { codePoint = tempCodePoint; } } break; case 4: secondByte = buf[i + 1]; thirdByte = buf[i + 2]; fourthByte = buf[i + 3]; if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) { tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63; if (tempCodePoint > 65535 && tempCodePoint < 1114112) { codePoint = tempCodePoint; } } } } if (codePoint === null) { codePoint = 65533; bytesPerSequence = 1; } else if (codePoint > 65535) { codePoint -= 65536; res.push(codePoint >>> 10 & 1023 | 55296); codePoint = 56320 | codePoint & 1023; } res.push(codePoint); i += bytesPerSequence; } return decodeCodePointsArray(res); } var MAX_ARGUMENTS_LENGTH = 4096; function decodeCodePointsArray(codePoints) { var len = codePoints.length; if (len <= MAX_ARGUMENTS_LENGTH) { return String.fromCharCode.apply(String, codePoints); } var res = ""; var i = 0; while (i < len) { res += String.fromCharCode.apply( String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) ); } return res; } function asciiSlice(buf, start, end) { var ret = ""; end = Math.min(buf.length, end); for (var i = start; i < end; ++i) { ret += String.fromCharCode(buf[i] & 127); } return ret; } function latin1Slice(buf, start, end) { var ret = ""; end = Math.min(buf.length, end); for (var i = start; i < end; ++i) { ret += String.fromCharCode(buf[i]); } return ret; } function hexSlice(buf, start, end) { var len = buf.length; if (!start || start < 0) start = 0; if (!end || end < 0 || end > len) end = len; var out = ""; for (var i = start; i < end; ++i) { out += toHex(buf[i]); } return out; } function utf16leSlice(buf, start, end) { var bytes = buf.slice(start, end); var res = ""; for (var i = 0; i < bytes.length; i += 2) { res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); } return res; } Buffer3.prototype.slice = function slice(start, end) { var len = this.length; start = ~~start; end = end === void 0 ? len : ~~end; if (start < 0) { start += len; if (start < 0) start = 0; } else if (start > len) { start = len; } if (end < 0) { end += len; if (end < 0) end = 0; } else if (end > len) { end = len; } if (end < start) end = start; var newBuf = this.subarray(start, end); newBuf.__proto__ = Buffer3.prototype; return newBuf; }; function checkOffset(offset4, ext, length) { if (offset4 % 1 !== 0 || offset4 < 0) throw new RangeError("offset is not uint"); if (offset4 + ext > length) throw new RangeError("Trying to access beyond buffer length"); } Buffer3.prototype.readUIntLE = function readUIntLE(offset4, byteLength2, noAssert) { offset4 = offset4 >>> 0; byteLength2 = byteLength2 >>> 0; if (!noAssert) checkOffset(offset4, byteLength2, this.length); var val = this[offset4]; var mul = 1; var i = 0; while (++i < byteLength2 && (mul *= 256)) { val += this[offset4 + i] * mul; } return val; }; Buffer3.prototype.readUIntBE = function readUIntBE(offset4, byteLength2, noAssert) { offset4 = offset4 >>> 0; byteLength2 = byteLength2 >>> 0; if (!noAssert) { checkOffset(offset4, byteLength2, this.length); } var val = this[offset4 + --byteLength2]; var mul = 1; while (byteLength2 > 0 && (mul *= 256)) { val += this[offset4 + --byteLength2] * mul; } return val; }; Buffer3.prototype.readUInt8 = function readUInt8(offset4, noAssert) { offset4 = offset4 >>> 0; if (!noAssert) checkOffset(offset4, 1, this.length); return this[offset4]; }; Buffer3.prototype.readUInt16LE = function readUInt16LE(offset4, noAssert) { offset4 = offset4 >>> 0; if (!noAssert) checkOffset(offset4, 2, this.length); return this[offset4] | this[offset4 + 1] << 8; }; Buffer3.prototype.readUInt16BE = function readUInt16BE(offset4, noAssert) { offset4 = offset4 >>> 0; if (!noAssert) checkOffset(offset4, 2, this.length); return this[offset4] << 8 | this[offset4 + 1]; }; Buffer3.prototype.readUInt32LE = function readUInt32LE(offset4, noAssert) { offset4 = offset4 >>> 0; if (!noAssert) checkOffset(offset4, 4, this.length); return (this[offset4] | this[offset4 + 1] << 8 | this[offset4 + 2] << 16) + this[offset4 + 3] * 16777216; }; Buffer3.prototype.readUInt32BE = function readUInt32BE(offset4, noAssert) { offset4 = offset4 >>> 0; if (!noAssert) checkOffset(offset4, 4, this.length); return this[offset4] * 16777216 + (this[offset4 + 1] << 16 | this[offset4 + 2] << 8 | this[offset4 + 3]); }; Buffer3.prototype.readIntLE = function readIntLE(offset4, byteLength2, noAssert) { offset4 = offset4 >>> 0; byteLength2 = byteLength2 >>> 0; if (!noAssert) checkOffset(offset4, byteLength2, this.length); var val = this[offset4]; var mul = 1; var i = 0; while (++i < byteLength2 && (mul *= 256)) { val += this[offset4 + i] * mul; } mul *= 128; if (val >= mul) val -= Math.pow(2, 8 * byteLength2); return val; }; Buffer3.prototype.readIntBE = function readIntBE(offset4, byteLength2, noAssert) { offset4 = offset4 >>> 0; byteLength2 = byteLength2 >>> 0; if (!noAssert) checkOffset(offset4, byteLength2, this.length); var i = byteLength2; var mul = 1; var val = this[offset4 + --i]; while (i > 0 && (mul *= 256)) { val += this[offset4 + --i] * mul; } mul *= 128; if (val >= mul) val -= Math.pow(2, 8 * byteLength2); return val; }; Buffer3.prototype.readInt8 = function readInt8(offset4, noAssert) { offset4 = offset4 >>> 0; if (!noAssert) checkOffset(offset4, 1, this.length); if (!(this[offset4] & 128)) return this[offset4]; return (255 - this[offset4] + 1) * -1; }; Buffer3.prototype.readInt16LE = function readInt16LE(offset4, noAssert) { offset4 = offset4 >>> 0; if (!noAssert) checkOffset(offset4, 2, this.length); var val = this[offset4] | this[offset4 + 1] << 8; return val & 32768 ? val | 4294901760 : val; }; Buffer3.prototype.readInt16BE = function readInt16BE(offset4, noAssert) { offset4 = offset4 >>> 0; if (!noAssert) checkOffset(offset4, 2, this.length); var val = this[offset4 + 1] | this[offset4] << 8; return val & 32768 ? val | 4294901760 : val; }; Buffer3.prototype.readInt32LE = function readInt32LE(offset4, noAssert) { offset4 = offset4 >>> 0; if (!noAssert) checkOffset(offset4, 4, this.length); return this[offset4] | this[offset4 + 1] << 8 | this[offset4 + 2] << 16 | this[offset4 + 3] << 24; }; Buffer3.prototype.readInt32BE = function readInt32BE(offset4, noAssert) { offset4 = offset4 >>> 0; if (!noAssert) checkOffset(offset4, 4, this.length); return this[offset4] << 24 | this[offset4 + 1] << 16 | this[offset4 + 2] << 8 | this[offset4 + 3]; }; Buffer3.prototype.readFloatLE = function readFloatLE(offset4, noAssert) { offset4 = offset4 >>> 0; if (!noAssert) checkOffset(offset4, 4, this.length); return ieee754.read(this, offset4, true, 23, 4); }; Buffer3.prototype.readFloatBE = function readFloatBE(offset4, noAssert) { offset4 = offset4 >>> 0; if (!noAssert) checkOffset(offset4, 4, this.length); return ieee754.read(this, offset4, false, 23, 4); }; Buffer3.prototype.readDoubleLE = function readDoubleLE(offset4, noAssert) { offset4 = offset4 >>> 0; if (!noAssert) checkOffset(offset4, 8, this.length); return ieee754.read(this, offset4, true, 52, 8); }; Buffer3.prototype.readDoubleBE = function readDoubleBE(offset4, noAssert) { offset4 = offset4 >>> 0; if (!noAssert) checkOffset(offset4, 8, this.length); return ieee754.read(this, offset4, false, 52, 8); }; function checkInt(buf, value, offset4, ext, max2, min2) { if (!Buffer3.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance'); if (value > max2 || value < min2) throw new RangeError('"value" argument is out of bounds'); if (offset4 + ext > buf.length) throw new RangeError("Index out of range"); } Buffer3.prototype.writeUIntLE = function writeUIntLE(value, offset4, byteLength2, noAssert) { value = +value; offset4 = offset4 >>> 0; byteLength2 = byteLength2 >>> 0; if (!noAssert) { var maxBytes = Math.pow(2, 8 * byteLength2) - 1; checkInt(this, value, offset4, byteLength2, maxBytes, 0); } var mul = 1; var i = 0; this[offset4] = value & 255; while (++i < byteLength2 && (mul *= 256)) { this[offset4 + i] = value / mul & 255; } return offset4 + byteLength2; }; Buffer3.prototype.writeUIntBE = function writeUIntBE(value, offset4, byteLength2, noAssert) { value = +value; offset4 = offset4 >>> 0; byteLength2 = byteLength2 >>> 0; if (!noAssert) { var maxBytes = Math.pow(2, 8 * byteLength2) - 1; checkInt(this, value, offset4, byteLength2, maxBytes, 0); } var i = byteLength2 - 1; var mul = 1; this[offset4 + i] = value & 255; while (--i >= 0 && (mul *= 256)) { this[offset4 + i] = value / mul & 255; } return offset4 + byteLength2; }; Buffer3.prototype.writeUInt8 = function writeUInt8(value, offset4, noAssert) { value = +value; offset4 = offset4 >>> 0; if (!noAssert) checkInt(this, value, offset4, 1, 255, 0); this[offset4] = value & 255; return offset4 + 1; }; Buffer3.prototype.writeUInt16LE = function writeUInt16LE(value, offset4, noAssert) { value = +value; offset4 = offset4 >>> 0; if (!noAssert) checkInt(this, value, offset4, 2, 65535, 0); this[offset4] = value & 255; this[offset4 + 1] = value >>> 8; return offset4 + 2; }; Buffer3.prototype.writeUInt16BE = function writeUInt16BE(value, offset4, noAssert) { value = +value; offset4 = offset4 >>> 0; if (!noAssert) checkInt(this, value, offset4, 2, 65535, 0); this[offset4] = value >>> 8; this[offset4 + 1] = value & 255; return offset4 + 2; }; Buffer3.prototype.writeUInt32LE = function writeUInt32LE(value, offset4, noAssert) { value = +value; offset4 = offset4 >>> 0; if (!noAssert) checkInt(this, value, offset4, 4, 4294967295, 0); this[offset4 + 3] = value >>> 24; this[offset4 + 2] = value >>> 16; this[offset4 + 1] = value >>> 8; this[offset4] = value & 255; return offset4 + 4; }; Buffer3.prototype.writeUInt32BE = function writeUInt32BE(value, offset4, noAssert) { value = +value; offset4 = offset4 >>> 0; if (!noAssert) checkInt(this, value, offset4, 4, 4294967295, 0); this[offset4] = value >>> 24; this[offset4 + 1] = value >>> 16; this[offset4 + 2] = value >>> 8; this[offset4 + 3] = value & 255; return offset4 + 4; }; Buffer3.prototype.writeIntLE = function writeIntLE(value, offset4, byteLength2, noAssert) { value = +value; offset4 = offset4 >>> 0; if (!noAssert) { var limit = Math.pow(2, 8 * byteLength2 - 1); checkInt(this, value, offset4, byteLength2, limit - 1, -limit); } var i = 0; var mul = 1; var sub = 0; this[offset4] = value & 255; while (++i < byteLength2 && (mul *= 256)) { if (value < 0 && sub === 0 && this[offset4 + i - 1] !== 0) { sub = 1; } this[offset4 + i] = (value / mul >> 0) - sub & 255; } return offset4 + byteLength2; }; Buffer3.prototype.writeIntBE = function writeIntBE(value, offset4, byteLength2, noAssert) { value = +value; offset4 = offset4 >>> 0; if (!noAssert) { var limit = Math.pow(2, 8 * byteLength2 - 1); checkInt(this, value, offset4, byteLength2, limit - 1, -limit); } var i = byteLength2 - 1; var mul = 1; var sub = 0; this[offset4 + i] = value & 255; while (--i >= 0 && (mul *= 256)) { if (value < 0 && sub === 0 && this[offset4 + i + 1] !== 0) { sub = 1; } this[offset4 + i] = (value / mul >> 0) - sub & 255; } return offset4 + byteLength2; }; Buffer3.prototype.writeInt8 = function writeInt8(value, offset4, noAssert) { value = +value; offset4 = offset4 >>> 0; if (!noAssert) checkInt(this, value, offset4, 1, 127, -128); if (value < 0) value = 255 + value + 1; this[offset4] = value & 255; return offset4 + 1; }; Buffer3.prototype.writeInt16LE = function writeInt16LE(value, offset4, noAssert) { value = +value; offset4 = offset4 >>> 0; if (!noAssert) checkInt(this, value, offset4, 2, 32767, -32768); this[offset4] = value & 255; this[offset4 + 1] = value >>> 8; return offset4 + 2; }; Buffer3.prototype.writeInt16BE = function writeInt16BE(value, offset4, noAssert) { value = +value; offset4 = offset4 >>> 0; if (!noAssert) checkInt(this, value, offset4, 2, 32767, -32768); this[offset4] = value >>> 8; this[offset4 + 1] = value & 255; return offset4 + 2; }; Buffer3.prototype.writeInt32LE = function writeInt32LE(value, offset4, noAssert) { value = +value; offset4 = offset4 >>> 0; if (!noAssert) checkInt(this, value, offset4, 4, 2147483647, -2147483648); this[offset4] = value & 255; this[offset4 + 1] = value >>> 8; this[offset4 + 2] = value >>> 16; this[offset4 + 3] = value >>> 24; return offset4 + 4; }; Buffer3.prototype.writeInt32BE = function writeInt32BE(value, offset4, noAssert) { value = +value; offset4 = offset4 >>> 0; if (!noAssert) checkInt(this, value, offset4, 4, 2147483647, -2147483648); if (value < 0) value = 4294967295 + value + 1; this[offset4] = value >>> 24; this[offset4 + 1] = value >>> 16; this[offset4 + 2] = value >>> 8; this[offset4 + 3] = value & 255; return offset4 + 4; }; function checkIEEE754(buf, value, offset4, ext, max2, min2) { if (offset4 + ext > buf.length) throw new RangeError("Index out of range"); if (offset4 < 0) throw new RangeError("Index out of range"); } function writeFloat(buf, value, offset4, littleEndian, noAssert) { value = +value; offset4 = offset4 >>> 0; if (!noAssert) { checkIEEE754(buf, value, offset4, 4, 34028234663852886e22, -34028234663852886e22); } ieee754.write(buf, value, offset4, littleEndian, 23, 4); return offset4 + 4; } Buffer3.prototype.writeFloatLE = function writeFloatLE(value, offset4, noAssert) { return writeFloat(this, value, offset4, true, noAssert); }; Buffer3.prototype.writeFloatBE = function writeFloatBE(value, offset4, noAssert) { return writeFloat(this, value, offset4, false, noAssert); }; function writeDouble(buf, value, offset4, littleEndian, noAssert) { value = +value; offset4 = offset4 >>> 0; if (!noAssert) { checkIEEE754(buf, value, offset4, 8, 17976931348623157e292, -17976931348623157e292); } ieee754.write(buf, value, offset4, littleEndian, 52, 8); return offset4 + 8; } Buffer3.prototype.writeDoubleLE = function writeDoubleLE(value, offset4, noAssert) { return writeDouble(this, value, offset4, true, noAssert); }; Buffer3.prototype.writeDoubleBE = function writeDoubleBE(value, offset4, noAssert) { return writeDouble(this, value, offset4, false, noAssert); }; Buffer3.prototype.copy = function copy(target, targetStart, start, end) { if (!Buffer3.isBuffer(target)) throw new TypeError("argument should be a Buffer"); if (!start) start = 0; if (!end && end !== 0) end = this.length; if (targetStart >= target.length) targetStart = target.length; if (!targetStart) targetStart = 0; if (end > 0 && end < start) end = start; if (end === start) return 0; if (target.length === 0 || this.length === 0) return 0; if (targetStart < 0) { throw new RangeError("targetStart out of bounds"); } if (start < 0 || start >= this.length) throw new RangeError("Index out of range"); if (end < 0) throw new RangeError("sourceEnd out of bounds"); if (end > this.length) end = this.length; if (target.length - targetStart < end - start) { end = target.length - targetStart + start; } var len = end - start; if (this === target && typeof Uint8Array.prototype.copyWithin === "function") { this.copyWithin(targetStart, start, end); } else if (this === target && start < targetStart && targetStart < end) { for (var i = len - 1; i >= 0; --i) { target[i + targetStart] = this[i + start]; } } else { Uint8Array.prototype.set.call( target, this.subarray(start, end), targetStart ); } return len; }; Buffer3.prototype.fill = function fill(val, start, end, encoding) { if (typeof val === "string") { if (typeof start === "string") { encoding = start; start = 0; end = this.length; } else if (typeof end === "string") { encoding = end; end = this.length; } if (encoding !== void 0 && typeof encoding !== "string") { throw new TypeError("encoding must be a string"); } if (typeof encoding === "string" && !Buffer3.isEncoding(encoding)) { throw new TypeError("Unknown encoding: " + encoding); } if (val.length === 1) { var code = val.charCodeAt(0); if (encoding === "utf8" && code < 128 || encoding === "latin1") { val = code; } } } else if (typeof val === "number") { val = val & 255; } if (start < 0 || this.length < start || this.length < end) { throw new RangeError("Out of range index"); } if (end <= start) { return this; } start = start >>> 0; end = end === void 0 ? this.length : end >>> 0; if (!val) val = 0; var i; if (typeof val === "number") { for (i = start; i < end; ++i) { this[i] = val; } } else { var bytes = Buffer3.isBuffer(val) ? val : Buffer3.from(val, encoding); var len = bytes.length; if (len === 0) { throw new TypeError('The value "' + val + '" is invalid for argument "value"'); } for (i = 0; i < end - start; ++i) { this[i + start] = bytes[i % len]; } } return this; }; var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; function base64clean(str) { str = str.split("=")[0]; str = str.trim().replace(INVALID_BASE64_RE, ""); if (str.length < 2) return ""; while (str.length % 4 !== 0) { str = str + "="; } return str; } function toHex(n) { if (n < 16) return "0" + n.toString(16); return n.toString(16); } function utf8ToBytes(string, units) { units = units || Infinity; var codePoint; var length = string.length; var leadSurrogate = null; var bytes = []; for (var i = 0; i < length; ++i) { codePoint = string.charCodeAt(i); if (codePoint > 55295 && codePoint < 57344) { if (!leadSurrogate) { if (codePoint > 56319) { if ((units -= 3) > -1) bytes.push(239, 191, 189); continue; } else if (i + 1 === length) { if ((units -= 3) > -1) bytes.push(239, 191, 189); continue; } leadSurrogate = codePoint; continue; } if (codePoint < 56320) { if ((units -= 3) > -1) bytes.push(239, 191, 189); leadSurrogate = codePoint; continue; } codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536; } else if (leadSurrogate) { if ((units -= 3) > -1) bytes.push(239, 191, 189); } leadSurrogate = null; if (codePoint < 128) { if ((units -= 1) < 0) break; bytes.push(codePoint); } else if (codePoint < 2048) { if ((units -= 2) < 0) break; bytes.push( codePoint >> 6 | 192, codePoint & 63 | 128 ); } else if (codePoint < 65536) { if ((units -= 3) < 0) break; bytes.push( codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128 ); } else if (codePoint < 1114112) { if ((units -= 4) < 0) break; bytes.push( codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128 ); } else { throw new Error("Invalid code point"); } } return bytes; } function asciiToBytes(str) { var byteArray = []; for (var i = 0; i < str.length; ++i) { byteArray.push(str.charCodeAt(i) & 255); } return byteArray; } function utf16leToBytes(str, units) { var c2, hi, lo; var byteArray = []; for (var i = 0; i < str.length; ++i) { if ((units -= 2) < 0) break; c2 = str.charCodeAt(i); hi = c2 >> 8; lo = c2 % 256; byteArray.push(lo); byteArray.push(hi); } return byteArray; } function base64ToBytes(str) { return base64.toByteArray(base64clean(str)); } function blitBuffer(src, dst, offset4, length) { for (var i = 0; i < length; ++i) { if (i + offset4 >= dst.length || i >= src.length) break; dst[i + offset4] = src[i]; } return i; } function isInstance(obj, type) { return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name; } function numberIsNaN(obj) { return obj !== obj; } }).call(this); }).call(this, require2("buffer").Buffer); }, { "base64-js": 1, "buffer": 3, "ieee754": 4 }], 4: [function(require2, module4, exports3) { exports3.read = function(buffer, offset4, isLE, mLen, nBytes) { var e2, m; var eLen = nBytes * 8 - mLen - 1; var eMax = (1 << eLen) - 1; var eBias = eMax >> 1; var nBits = -7; var i = isLE ? nBytes - 1 : 0; var d = isLE ? -1 : 1; var s = buffer[offset4 + i]; i += d; e2 = s & (1 << -nBits) - 1; s >>= -nBits; nBits += eLen; for (; nBits > 0; e2 = e2 * 256 + buffer[offset4 + i], i += d, nBits -= 8) { } m = e2 & (1 << -nBits) - 1; e2 >>= -nBits; nBits += mLen; for (; nBits > 0; m = m * 256 + buffer[offset4 + i], i += d, nBits -= 8) { } if (e2 === 0) { e2 = 1 - eBias; } else if (e2 === eMax) { return m ? NaN : (s ? -1 : 1) * Infinity; } else { m = m + Math.pow(2, mLen); e2 = e2 - eBias; } return (s ? -1 : 1) * m * Math.pow(2, e2 - mLen); }; exports3.write = function(buffer, value, offset4, isLE, mLen, nBytes) { var e2, m, c2; var eLen = nBytes * 8 - mLen - 1; var eMax = (1 << eLen) - 1; var eBias = eMax >> 1; var rt2 = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; var i = isLE ? 0 : nBytes - 1; var d = isLE ? 1 : -1; var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; value = Math.abs(value); if (isNaN(value) || value === Infinity) { m = isNaN(value) ? 1 : 0; e2 = eMax; } else { e2 = Math.floor(Math.log(value) / Math.LN2); if (value * (c2 = Math.pow(2, -e2)) < 1) { e2--; c2 *= 2; } if (e2 + eBias >= 1) { value += rt2 / c2; } else { value += rt2 * Math.pow(2, 1 - eBias); } if (value * c2 >= 2) { e2++; c2 /= 2; } if (e2 + eBias >= eMax) { m = 0; e2 = eMax; } else if (e2 + eBias >= 1) { m = (value * c2 - 1) * Math.pow(2, mLen); e2 = e2 + eBias; } else { m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); e2 = 0; } } for (; mLen >= 8; buffer[offset4 + i] = m & 255, i += d, m /= 256, mLen -= 8) { } e2 = e2 << mLen | m; eLen += mLen; for (; eLen > 0; buffer[offset4 + i] = e2 & 255, i += d, e2 /= 256, eLen -= 8) { } buffer[offset4 + i - d] |= s * 128; }; }, {}], 5: [function(require2, module4, exports3) { let urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"; let customAlphabet = (alphabet, defaultSize = 21) => { return (size4 = defaultSize) => { let id = ""; let i = size4; while (i--) { id += alphabet[Math.random() * alphabet.length | 0]; } return id; }; }; let nanoid = (size4 = 21) => { let id = ""; let i = size4; while (i--) { id += urlAlphabet[Math.random() * 64 | 0]; } return id; }; module4.exports = { nanoid, customAlphabet }; }, {}], 6: [function(require2, module4, exports3) { var x2 = String; var create2 = function() { return { isColorSupported: false, reset: x2, bold: x2, dim: x2, italic: x2, underline: x2, inverse: x2, hidden: x2, strikethrough: x2, black: x2, red: x2, green: x2, yellow: x2, blue: x2, magenta: x2, cyan: x2, white: x2, gray: x2, bgBlack: x2, bgRed: x2, bgGreen: x2, bgYellow: x2, bgBlue: x2, bgMagenta: x2, bgCyan: x2, bgWhite: x2 }; }; module4.exports = create2(); module4.exports.createColors = create2; }, {}], 7: [function(require2, module4, exports3) { "use strict"; let Container = require2("./container"); 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); } } module4.exports = AtRule; AtRule.default = AtRule; Container.registerAtRule(AtRule); }, { "./container": 9 }], 8: [function(require2, module4, exports3) { "use strict"; let Node2 = require2("./node"); class Comment2 extends Node2 { constructor(defaults) { super(defaults); this.type = "comment"; } } module4.exports = Comment2; Comment2.default = Comment2; }, { "./node": 19 }], 9: [function(require2, module4, exports3) { "use strict"; let { isClean, my } = require2("./symbols"); let Declaration = require2("./declaration"); let Comment2 = require2("./comment"); let Node2 = require2("./node"); let parse3, Rule, AtRule, Root9; 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 Node2 { 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 void 0; let iterator = this.getIterator(); let index2, result; while (this.indexes[iterator] < this.proxyOf.nodes.length) { index2 = this.indexes[iterator]; result = callback(this.proxyOf.nodes[index2], index2); 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, index2) => i(child.toProxy(), index2); } 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, add2) { let existIndex = this.index(exist); let nodes = this.normalize(add2, this.proxyOf.nodes[existIndex]).reverse(); existIndex = this.index(exist); for (let node of nodes) this.proxyOf.nodes.splice(existIndex + 1, 0, node); let index2; for (let id in this.indexes) { index2 = this.indexes[id]; if (existIndex < index2) { this.indexes[id] = index2 + nodes.length; } } this.markDirty(); return this; } insertBefore(exist, add2) { let existIndex = this.index(exist); let type = existIndex === 0 ? "prepend" : false; let nodes = this.normalize( add2, this.proxyOf.nodes[existIndex], type ).reverse(); existIndex = this.index(exist); for (let node of nodes) this.proxyOf.nodes.splice(existIndex, 0, node); let index2; for (let id in this.indexes) { index2 = this.indexes[id]; if (existIndex <= index2) { this.indexes[id] = index2 + nodes.length; } } this.markDirty(); return this; } normalize(nodes, sample) { if (typeof nodes === "string") { nodes = cleanSource(parse3(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 = [new Rule(nodes)]; } else if (nodes.name) { nodes = [new AtRule(nodes)]; } else if (nodes.text) { nodes = [new Comment2(nodes)]; } else { throw new Error("Unknown node type in node creation"); } let processed = nodes.map((i) => { if (!i[my]) Container.rebuild(i); i = i.proxyOf; if (i.parent) i.parent.removeChild(i); if (i[isClean]) markTreeDirty(i); 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 = void 0; this.proxyOf.nodes = []; this.markDirty(); return this; } removeChild(child) { child = this.index(child); this.proxyOf.nodes[child].parent = void 0; this.proxyOf.nodes.splice(child, 1); let index2; for (let id in this.indexes) { index2 = this.indexes[id]; if (index2 >= child) { this.indexes[id] = index2 - 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 (e2) { throw child.addToError(e2); } 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); } }); } get first() { if (!this.proxyOf.nodes) return void 0; return this.proxyOf.nodes[0]; } get last() { if (!this.proxyOf.nodes) return void 0; return this.proxyOf.nodes[this.proxyOf.nodes.length - 1]; } } Container.registerParse = (dependant) => { parse3 = dependant; }; Container.registerRule = (dependant) => { Rule = dependant; }; Container.registerAtRule = (dependant) => { AtRule = dependant; }; Container.registerRoot = (dependant) => { Root9 = dependant; }; module4.exports = Container; Container.default = Container; 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, Comment2.prototype); } else if (node.type === "root") { Object.setPrototypeOf(node, Root9.prototype); } node[my] = true; if (node.nodes) { node.nodes.forEach((child) => { Container.rebuild(child); }); } }; }, { "./comment": 8, "./declaration": 11, "./node": 19, "./symbols": 29 }], 10: [function(require2, module4, exports3) { "use strict"; let pico = require2("picocolors"); let terminalHighlight = require2("./terminal-highlight"); 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 : ""; if (typeof this.line !== "undefined") { this.message += ":" + this.line + ":" + this.column; } this.message += ": " + this.reason; } showSourceCode(color) { if (!this.source) return ""; let css2 = this.source; if (color == null) color = pico.isColorSupported; if (terminalHighlight) { if (color) css2 = terminalHighlight(css2); } let lines = css2.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; let mark2, aside; if (color) { let { bold, gray, red } = pico.createColors(true); mark2 = (text) => bold(red(text)); aside = (text) => gray(text); } else { mark2 = aside = (str) => str; } return lines.slice(start, end).map((line, index2) => { let number = start + 1 + index2; let gutter = " " + (" " + number).slice(-maxWidth) + " | "; if (number === this.line) { let spacing = aside(gutter.replace(/\d/g, " ")) + line.slice(0, this.column - 1).replace(/[^\t]/g, " "); return mark2(">") + aside(gutter) + line + "\n " + spacing + mark2("^"); } return " " + aside(gutter) + line; }).join("\n"); } toString() { let code = this.showSourceCode(); if (code) { code = "\n\n" + code + "\n"; } return this.name + ": " + this.message + code; } } module4.exports = CssSyntaxError; CssSyntaxError.default = CssSyntaxError; }, { "./terminal-highlight": 2, "picocolors": 6 }], 11: [function(require2, module4, exports3) { "use strict"; let Node2 = require2("./node"); class Declaration extends Node2 { constructor(defaults) { if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") { defaults = { ...defaults, value: String(defaults.value) }; } super(defaults); this.type = "decl"; } get variable() { return this.prop.startsWith("--") || this.prop[0] === "$"; } } module4.exports = Declaration; Declaration.default = Declaration; }, { "./node": 19 }], 12: [function(require2, module4, exports3) { "use strict"; let Container = require2("./container"); let LazyResult, Processor; class Document2 extends Container { constructor(defaults) { super({ type: "document", ...defaults }); if (!this.nodes) { this.nodes = []; } } toResult(opts = {}) { let lazy = new LazyResult(new Processor(), this, opts); return lazy.stringify(); } } Document2.registerLazyResult = (dependant) => { LazyResult = dependant; }; Document2.registerProcessor = (dependant) => { Processor = dependant; }; module4.exports = Document2; Document2.default = Document2; }, { "./container": 9 }], 13: [function(require2, module4, exports3) { "use strict"; let Declaration = require2("./declaration"); let PreviousMap = require2("./previous-map"); let Comment2 = require2("./comment"); let AtRule = require2("./at-rule"); let Input = require2("./input"); let Root9 = require2("./root"); let Rule = require2("./rule"); 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 Root9(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 Comment2(defaults); } else if (defaults.type === "atrule") { return new AtRule(defaults); } else { throw new Error("Unknown node type: " + json.type); } } module4.exports = fromJSON; fromJSON.default = fromJSON; }, { "./at-rule": 7, "./comment": 8, "./declaration": 11, "./input": 14, "./previous-map": 22, "./root": 25, "./rule": 26 }], 14: [function(require2, module4, exports3) { "use strict"; let { SourceMapConsumer, SourceMapGenerator } = require2("source-map-js"); let { fileURLToPath, pathToFileURL } = require2("url"); let { isAbsolute, resolve } = require2("path"); let { nanoid } = require2("nanoid/non-secure"); let terminalHighlight = require2("./terminal-highlight"); let CssSyntaxError = require2("./css-syntax-error"); let PreviousMap = require2("./previous-map"); let fromOffsetCache = Symbol("fromOffsetCache"); let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator); let pathAvailable = Boolean(resolve && isAbsolute); class Input { constructor(css2, opts = {}) { if (css2 === null || typeof css2 === "undefined" || typeof css2 === "object" && !css2.toString) { throw new Error(`PostCSS received ${css2} instead of CSS string`); } this.css = css2.toString(); if (this.css[0] === "\uFEFF" || this.css[0] === "\uFFFE") { this.hasBOM = true; this.css = this.css.slice(1); } else { this.hasBOM = false; } 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 = ""; } if (this.map) this.map.file = this.from; } error(message, line, column, opts = {}) { let result, endLine, endColumn; if (line && typeof line === "object") { let start = line; let end = column; if (typeof start.offset === "number") { let pos = this.fromOffset(start.offset); line = pos.line; column = pos.col; } else { line = start.line; column = start.column; } if (typeof end.offset === "number") { let pos = this.fromOffset(end.offset); endLine = pos.line; endColumn = pos.col; } else { endLine = end.line; endColumn = end.column; } } else if (!column) { let pos = this.fromOffset(line); line = pos.line; column = pos.col; } let origin = this.origin(line, column, endLine, endColumn); if (origin) { result = new CssSyntaxError( message, origin.endLine === void 0 ? origin.line : { column: origin.column, line: origin.line }, origin.endLine === void 0 ? origin.column : { column: origin.endColumn, line: origin.endLine }, origin.source, origin.file, opts.plugin ); } else { result = new CssSyntaxError( message, endLine === void 0 ? line : { column, line }, endLine === void 0 ? column : { column: endColumn, line: endLine }, this.css, this.file, opts.plugin ); } result.input = { column, endColumn, endLine, line, source: this.css }; if (this.file) { if (pathToFileURL) { result.input.url = pathToFileURL(this.file).toString(); } result.input.file = this.file; } return result; } fromOffset(offset4) { let lastLine, lineToIndex; if (!this[fromOffsetCache]) { let lines = this.css.split("\n"); 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; } this[fromOffsetCache] = lineToIndex; } else { lineToIndex = this[fromOffsetCache]; } lastLine = lineToIndex[lineToIndex.length - 1]; let min2 = 0; if (offset4 >= lastLine) { min2 = lineToIndex.length - 1; } else { let max2 = lineToIndex.length - 2; let mid; while (min2 < max2) { mid = min2 + (max2 - min2 >> 1); if (offset4 < lineToIndex[mid]) { max2 = mid - 1; } else if (offset4 >= lineToIndex[mid + 1]) { min2 = mid + 1; } else { min2 = mid; break; } } } return { col: offset4 - lineToIndex[min2] + 1, line: min2 + 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 { 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 = void 0; } } return json; } get from() { return this.file || this.id; } } module4.exports = Input; Input.default = Input; if (terminalHighlight && terminalHighlight.registerInput) { terminalHighlight.registerInput(Input); } }, { "./css-syntax-error": 10, "./previous-map": 22, "./terminal-highlight": 2, "nanoid/non-secure": 5, "path": 2, "source-map-js": 2, "url": 2 }], 15: [function(require2, module4, exports3) { (function(process2) { (function() { "use strict"; let { isClean, my } = require2("./symbols"); let MapGenerator = require2("./map-generator"); let stringify = require2("./stringify"); let Container = require2("./container"); let Document2 = require2("./document"); let warnOnce = require2("./warn-once"); let Result = require2("./result"); let parse3 = require2("./parse"); let Root9 = require2("./root"); 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 events2; if (node.type === "document") { events2 = ["Document", CHILDREN, "DocumentExit"]; } else if (node.type === "root") { events2 = ["Root", CHILDREN, "RootExit"]; } else { events2 = getEvents(node); } return { eventIndex: 0, events: events2, iterator: 0, node, visitorIndex: 0, visitors: [] }; } function cleanMarks(node) { node[isClean] = false; if (node.nodes) node.nodes.forEach((i) => cleanMarks(i)); return node; } let postcss2 = {}; class LazyResult { constructor(processor, css2, opts) { this.stringified = false; this.processed = false; let root; if (typeof css2 === "object" && css2 !== null && (css2.type === "root" || css2.type === "document")) { root = cleanMarks(css2); } else if (css2 instanceof LazyResult || css2 instanceof Result) { root = cleanMarks(css2.root); if (css2.map) { if (typeof opts.map === "undefined") opts.map = {}; if (!opts.map.inline) opts.map.inline = false; opts.map.prev = css2.map; } } else { let parser2 = parse3; if (opts.syntax) parser2 = opts.syntax.parse; if (opts.parser) parser2 = opts.parser; if (parser2.parse) parser2 = parser2.parse; try { root = parser2(css2, opts); } catch (error) { this.processed = true; this.error = error; } if (root && !root[my]) { Container.rebuild(root); } } this.result = new Result(processor, root, opts); this.helpers = { ...postcss2, postcss: postcss2, 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 (process2.env.NODE_ENV !== "production") { let pluginName = plugin.postcssPlugin; let pluginVer = plugin.postcssVersion; let runtimeVer = this.result.processor.version; let a = pluginVer.split("."); let b2 = runtimeVer.split("."); if (a[0] !== b2[0] || parseInt(a[1]) > parseInt(b2[1])) { console.error( "Unknown error from PostCSS plugin. Your current PostCSS version is " + runtimeVer + ", but " + pluginName + " uses " + pluginVer + ". Perhaps this is the source of the error below." ); } } } } catch (err) { if (console && console.error) console.error(err); } return error; } prepareVisitors() { this.listeners = {}; let add2 = (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 === "*") { add2(plugin, event, plugin[event][filter]); } else { add2( plugin, event + "-" + filter.toLowerCase(), plugin[event][filter] ); } } } else if (typeof plugin[event] === "function") { add2(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 (e2) { let node = stack[stack.length - 1].node; throw this.handleError(e2, 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 (e2) { throw this.handleError(e2); } } } } 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 (process2.env.NODE_ENV !== "production") { if (!("from" in this.opts)) { warnOnce( "Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning." ); } } 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 (e2) { throw this.handleError(e2, 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 (e2) { throw this.handleError(e2, 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 events2 = visit.events; while (visit.eventIndex < events2.length) { let event = events2[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 events2 = getEvents(node); for (let event of events2) { 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(); } 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"; } } LazyResult.registerPostcss = (dependant) => { postcss2 = dependant; }; module4.exports = LazyResult; LazyResult.default = LazyResult; Root9.registerLazyResult(LazyResult); Document2.registerLazyResult(LazyResult); }).call(this); }).call(this, require2("_process")); }, { "./container": 9, "./document": 12, "./map-generator": 17, "./parse": 20, "./result": 24, "./root": 25, "./stringify": 28, "./symbols": 29, "./warn-once": 31, "_process": 33 }], 16: [function(require2, module4, exports3) { "use strict"; let list2 = { comma(string) { return list2.split(string, [","], true); }, space(string) { let spaces = [" ", "\n", " "]; return list2.split(string, spaces); }, split(string, separators, last) { let array = []; let current2 = ""; let split = false; let func = 0; let inQuote = false; let prevQuote = ""; let escape2 = false; for (let letter of string) { if (escape2) { escape2 = false; } else if (letter === "\\") { escape2 = 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 (current2 !== "") array.push(current2.trim()); current2 = ""; split = false; } else { current2 += letter; } } if (last || current2 !== "") array.push(current2.trim()); return array; } }; module4.exports = list2; list2.default = list2; }, {}], 17: [function(require2, module4, exports3) { (function(Buffer2) { (function() { "use strict"; let { SourceMapConsumer, SourceMapGenerator } = require2("source-map-js"); let { dirname, relative, resolve, sep } = require2("path"); let { pathToFileURL } = require2("url"); let Input = require2("./input"); 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 = /* @__PURE__ */ new Map(); this.memoizedPaths = /* @__PURE__ */ new Map(); this.memoizedURLs = /* @__PURE__ */ 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.indexOf("# sourceMappingURL=") === 0) { 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)) : "" }); } 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 = ""; let mapping = { generated: { column: 0, line: 0 }, original: { column: 0, line: 0 }, source: "" }; let lines, last; 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 p2 = node.parent || { raws: {} }; let childless = node.type === "decl" || node.type === "atrule" && !node.nodes; if (!childless || node !== p2.last || p2.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)) : ""; 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 (Buffer2) { return Buffer2.from(str).toString("base64"); } else { return window.btoa(unescape(encodeURIComponent(str))); } } toFileUrl(path) { let cached = this.memoizedFileURLs.get(path); if (cached) return cached; if (pathToFileURL) { let fileURL = pathToFileURL(path).toString(); this.memoizedFileURLs.set(path, fileURL); return fileURL; } else { throw new Error( "`map.absolute` option is not available in this PostCSS build" ); } } 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; } } module4.exports = MapGenerator; }).call(this); }).call(this, require2("buffer").Buffer); }, { "./input": 14, "buffer": 3, "path": 2, "source-map-js": 2, "url": 2 }], 18: [function(require2, module4, exports3) { (function(process2) { (function() { "use strict"; let MapGenerator = require2("./map-generator"); let stringify = require2("./stringify"); let warnOnce = require2("./warn-once"); let parse3 = require2("./parse"); const Result = require2("./result"); class NoWorkResult { constructor(processor, css2, opts) { css2 = css2.toString(); this.stringified = false; this._processor = processor; this._css = css2; this._opts = opts; this._map = void 0; let root; let str = stringify; this.result = new Result(this._processor, root, this._opts); this.result.css = css2; let self2 = this; Object.defineProperty(this.result, "root", { get() { return self2.root; } }); let map = new MapGenerator(str, root, this._opts, css2); 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 (process2.env.NODE_ENV !== "production") { if (!("from" in this._opts)) { warnOnce( "Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning." ); } } return this.async().then(onFulfilled, onRejected); } toString() { return this._css; } warnings() { return []; } 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 parser2 = parse3; try { root = parser2(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"; } } module4.exports = NoWorkResult; NoWorkResult.default = NoWorkResult; }).call(this); }).call(this, require2("_process")); }, { "./map-generator": 17, "./parse": 20, "./result": 24, "./stringify": 28, "./warn-once": 31, "_process": 33 }], 19: [function(require2, module4, exports3) { "use strict"; let { isClean, my } = require2("./symbols"); let CssSyntaxError = require2("./css-syntax-error"); let Stringifier = require2("./stringifier"); let stringify = require2("./stringify"); function cloneNode2(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((j2) => cloneNode2(j2, cloned)); } else { if (type === "object" && value !== null) value = cloneNode2(value); cloned[i] = value; } } return cloned; } class Node2 { 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(add2) { this.parent.insertAfter(this, add2); return this; } assign(overrides = {}) { for (let name in overrides) { this[name] = overrides[name]; } return this; } before(add2) { this.parent.insertBefore(this, add2); return this; } cleanRaws(keepBetween) { delete this.raws.before; delete this.raws.after; if (!keepBetween) delete this.raws.between; } clone(overrides = {}) { let cloned = cloneNode2(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; } }; } markDirty() { if (this[isClean]) { this[isClean] = false; let next = this; while (next = next.parent) { next[isClean] = false; } } } next() { if (!this.parent) return void 0; let index2 = this.parent.index(this); return this.parent.nodes[index2 + 1]; } positionBy(opts, stringRepresentation) { let pos = this.source.start; if (opts.index) { pos = this.positionInside(opts.index, stringRepresentation); } else if (opts.word) { stringRepresentation = this.toString(); let index2 = stringRepresentation.indexOf(opts.word); if (index2 !== -1) pos = this.positionInside(index2, stringRepresentation); } return pos; } positionInside(index2, stringRepresentation) { let string = stringRepresentation || this.toString(); let column = this.source.start.column; let line = this.source.start.line; for (let i = 0; i < index2; i++) { if (string[i] === "\n") { column = 1; line += 1; } else { column += 1; } } return { column, line }; } prev() { if (!this.parent) return void 0; let index2 = this.parent.index(this); return this.parent.nodes[index2 - 1]; } rangeBy(opts) { let start = { column: this.source.start.column, line: this.source.start.line }; let end = this.source.end ? { column: this.source.end.column + 1, line: this.source.end.line } : { column: start.column + 1, line: start.line }; if (opts.word) { let stringRepresentation = this.toString(); let index2 = stringRepresentation.indexOf(opts.word); if (index2 !== -1) { start = this.positionInside(index2, stringRepresentation); end = this.positionInside(index2 + opts.word.length, stringRepresentation); } } else { if (opts.start) { start = { column: opts.start.column, line: opts.start.line }; } else if (opts.index) { start = this.positionInside(opts.index); } if (opts.end) { end = { column: opts.end.column, line: opts.end.line }; } 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 }; } 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 = void 0; 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(_2, inputs) { let fixed = {}; let emitInputs = inputs == null; inputs = inputs || /* @__PURE__ */ 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") { 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); } get proxyOf() { return this; } } module4.exports = Node2; Node2.default = Node2; }, { "./css-syntax-error": 10, "./stringifier": 27, "./stringify": 28, "./symbols": 29 }], 20: [function(require2, module4, exports3) { (function(process2) { (function() { "use strict"; let Container = require2("./container"); let Parser = require2("./parser"); let Input = require2("./input"); function parse3(css2, opts) { let input = new Input(css2, opts); let parser2 = new Parser(input); try { parser2.parse(); } catch (e2) { if (process2.env.NODE_ENV !== "production") { if (e2.name === "CssSyntaxError" && opts && opts.from) { if (/\.scss$/i.test(opts.from)) { e2.message += "\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser"; } else if (/\.sass/i.test(opts.from)) { e2.message += "\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser"; } else if (/\.less$/i.test(opts.from)) { e2.message += "\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser"; } } } throw e2; } return parser2.root; } module4.exports = parse3; parse3.default = parse3; Container.registerParse(parse3); }).call(this); }).call(this, require2("_process")); }, { "./container": 9, "./input": 14, "./parser": 21, "_process": 33 }], 21: [function(require2, module4, exports3) { "use strict"; let Declaration = require2("./declaration"); let tokenizer = require2("./tokenize"); let Comment2 = require2("./comment"); let AtRule = require2("./at-rule"); let Root9 = require2("./root"); let Rule = require2("./rule"); 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 Root9(); 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 shift4; 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) { shift4 = params.length - 1; prev = params[shift4]; while (prev && prev[0] === "space") { prev = params[--shift4]; } 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 j2 = colon - 1; j2 >= 0; j2--) { token = tokens[j2]; if (token[0] !== "space") { founded += 1; if (founded === 2) break; } } throw this.input.error( "Missed semicolon", token[0] === "word" ? token[3] + 1 : token[2] ); } colon(tokens) { let brackets = 0; let token, type, prev; 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 Comment2(); 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 cache2 = tokens.slice(0); let str = ""; for (let j2 = i; j2 > 0; j2--) { let type = cache2[j2][0]; if (str.trim().indexOf("!") === 0 && type !== "space") { break; } str = cache2.pop()[1] + str; } if (str.trim().indexOf("!") === 0) { node.important = true; node.raws.important = str; tokens = cache2; } } 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 = ""; } } } // Helpers getPosition(offset4) { let pos = this.input.fromOffset(offset4); return { column: pos.col, line: pos.line, offset: offset4 }; } init(node, offset4) { this.current.push(node); node.source = { input: this.input, start: this.getPosition(offset4) }; 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() { } 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", { 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 } ); } } module4.exports = Parser; }, { "./at-rule": 7, "./comment": 8, "./declaration": 11, "./root": 25, "./rule": 26, "./tokenize": 30 }], 22: [function(require2, module4, exports3) { (function(Buffer2) { (function() { "use strict"; let { SourceMapConsumer, SourceMapGenerator } = require2("source-map-js"); let { existsSync, readFileSync } = require2("fs"); let { dirname, join } = require2("path"); function fromBase64(str) { if (Buffer2) { return Buffer2.from(str, "base64").toString(); } else { return window.atob(str); } } class PreviousMap { constructor(css2, opts) { if (opts.map === false) return; this.loadAnnotation(css2); this.inline = this.startWith(this.annotation, "data:"); let prev = opts.map ? opts.map.prev : void 0; 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,/; if (charsetUri.test(text) || uri.test(text)) { return decodeURIComponent(text.substr(RegExp.lastMatch.length)); } if (baseCharsetUri.test(text) || baseUri.test(text)) { return fromBase64(text.substr(RegExp.lastMatch.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(css2) { let comments = css2.match(/\/\*\s*# sourceMappingURL=/gm); if (!comments) return; let start = css2.lastIndexOf(comments.pop()); let end = css2.indexOf("*/", start); if (start > -1 && end > -1) { this.annotation = this.getAnnotationURL(css2.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); } } module4.exports = PreviousMap; PreviousMap.default = PreviousMap; }).call(this); }).call(this, require2("buffer").Buffer); }, { "buffer": 3, "fs": 2, "path": 2, "source-map-js": 2 }], 23: [function(require2, module4, exports3) { (function(process2) { (function() { "use strict"; let NoWorkResult = require2("./no-work-result"); let LazyResult = require2("./lazy-result"); let Document2 = require2("./document"); let Root9 = require2("./root"); class Processor { constructor(plugins2 = []) { this.version = "8.4.40"; this.plugins = this.normalize(plugins2); } normalize(plugins2) { let normalized = []; for (let i of plugins2) { 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 (process2.env.NODE_ENV !== "production") { throw new Error( "PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation." ); } } else { throw new Error(i + " is not a PostCSS plugin"); } } return normalized; } process(css2, opts = {}) { if (!this.plugins.length && !opts.parser && !opts.stringifier && !opts.syntax) { return new NoWorkResult(this, css2, opts); } else { return new LazyResult(this, css2, opts); } } use(plugin) { this.plugins = this.plugins.concat(this.normalize([plugin])); return this; } } module4.exports = Processor; Processor.default = Processor; Root9.registerProcessor(Processor); Document2.registerProcessor(Processor); }).call(this); }).call(this, require2("_process")); }, { "./document": 12, "./lazy-result": 15, "./no-work-result": 18, "./root": 25, "_process": 33 }], 24: [function(require2, module4, exports3) { "use strict"; let Warning = require2("./warning"); class Result { constructor(processor, root, opts) { this.processor = processor; this.messages = []; this.root = root; this.opts = opts; this.css = void 0; this.map = void 0; } 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"); } get content() { return this.css; } } module4.exports = Result; Result.default = Result; }, { "./warning": 32 }], 25: [function(require2, module4, exports3) { "use strict"; let Container = require2("./container"); let LazyResult, Processor; class Root9 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 index2 = this.index(child); if (!ignore && index2 === 0 && this.nodes.length > 1) { this.nodes[1].raws.before = this.nodes[index2].raws.before; } return super.removeChild(child); } toResult(opts = {}) { let lazy = new LazyResult(new Processor(), this, opts); return lazy.stringify(); } } Root9.registerLazyResult = (dependant) => { LazyResult = dependant; }; Root9.registerProcessor = (dependant) => { Processor = dependant; }; module4.exports = Root9; Root9.default = Root9; Container.registerRoot(Root9); }, { "./container": 9 }], 26: [function(require2, module4, exports3) { "use strict"; let Container = require2("./container"); let list2 = require2("./list"); class Rule extends Container { constructor(defaults) { super(defaults); this.type = "rule"; if (!this.nodes) this.nodes = []; } get selectors() { return list2.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); } } module4.exports = Rule; Rule.default = Rule; Container.registerRule(Rule); }, { "./container": 9, "./list": 16 }], 27: [function(require2, module4, exports3) { "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; if (own) { value = node.raws[own]; if (typeof value !== "undefined") return value; } let parent = node.parent; if (detect === "before") { if (!parent || parent.type === "root" && parent.first === node) { return ""; } if (parent && parent.type === "document") { return ""; } } if (!parent) return DEFAULT_RAW[detect]; 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 p2 = i.parent; if (p2 && p2 !== root && p2.parent && p2.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) { if (!this[node.type]) { throw new Error( "Unknown AST node type " + node.type + ". Maybe you need to change PostCSS stringifier." ); } this[node.type](node, semicolon); } } module4.exports = Stringifier; Stringifier.default = Stringifier; }, {}], 28: [function(require2, module4, exports3) { "use strict"; let Stringifier = require2("./stringifier"); function stringify(node, builder) { let str = new Stringifier(builder); str.stringify(node); } module4.exports = stringify; stringify.default = stringify; }, { "./stringifier": 27 }], 29: [function(require2, module4, exports3) { "use strict"; module4.exports.isClean = Symbol("isClean"); module4.exports.my = Symbol("my"); }, {}], 30: [function(require2, module4, exports3) { "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 = " ".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; module4.exports = function tokenizer(input, options2 = {}) { let css2 = input.css.valueOf(); let ignore = options2.ignoreErrors; let code, next, quote, content, escape2; let escaped, escapePos, prev, n, currentToken; let length = css2.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 = css2.charCodeAt(pos); switch (code) { case NEWLINE: case SPACE: case TAB: case CR: case FEED: { next = pos; do { next += 1; code = css2.charCodeAt(next); } while (code === SPACE || code === NEWLINE || code === TAB || code === CR || code === FEED); currentToken = ["space", css2.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 = css2.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 = css2.indexOf(")", next + 1); if (next === -1) { if (ignore || ignoreUnclosed) { next = pos; break; } else { unclosed("bracket"); } } escapePos = next; while (css2.charCodeAt(escapePos - 1) === BACKSLASH) { escapePos -= 1; escaped = !escaped; } } while (escaped); currentToken = ["brackets", css2.slice(pos, next + 1), pos, next]; pos = next; } else { next = css2.indexOf(")", pos + 1); content = css2.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 = css2.indexOf(quote, next + 1); if (next === -1) { if (ignore || ignoreUnclosed) { next = pos + 1; break; } else { unclosed("string"); } } escapePos = next; while (css2.charCodeAt(escapePos - 1) === BACKSLASH) { escapePos -= 1; escaped = !escaped; } } while (escaped); currentToken = ["string", css2.slice(pos, next + 1), pos, next]; pos = next; break; } case AT: { RE_AT_END.lastIndex = pos + 1; RE_AT_END.test(css2); if (RE_AT_END.lastIndex === 0) { next = css2.length - 1; } else { next = RE_AT_END.lastIndex - 2; } currentToken = ["at-word", css2.slice(pos, next + 1), pos, next]; pos = next; break; } case BACKSLASH: { next = pos; escape2 = true; while (css2.charCodeAt(next + 1) === BACKSLASH) { next += 1; escape2 = !escape2; } code = css2.charCodeAt(next + 1); if (escape2 && code !== SLASH && code !== SPACE && code !== NEWLINE && code !== TAB && code !== CR && code !== FEED) { next += 1; if (RE_HEX_ESCAPE.test(css2.charAt(next))) { while (RE_HEX_ESCAPE.test(css2.charAt(next + 1))) { next += 1; } if (css2.charCodeAt(next + 1) === SPACE) { next += 1; } } } currentToken = ["word", css2.slice(pos, next + 1), pos, next]; pos = next; break; } default: { if (code === SLASH && css2.charCodeAt(pos + 1) === ASTERISK) { next = css2.indexOf("*/", pos + 2) + 1; if (next === 0) { if (ignore || ignoreUnclosed) { next = css2.length; } else { unclosed("comment"); } } currentToken = ["comment", css2.slice(pos, next + 1), pos, next]; pos = next; } else { RE_WORD_END.lastIndex = pos + 1; RE_WORD_END.test(css2); if (RE_WORD_END.lastIndex === 0) { next = css2.length - 1; } else { next = RE_WORD_END.lastIndex - 2; } currentToken = ["word", css2.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 }; }; }, {}], 31: [function(require2, module4, exports3) { "use strict"; let printed = {}; module4.exports = function warnOnce(message) { if (printed[message]) return; printed[message] = true; if (typeof console !== "undefined" && console.warn) { console.warn(message); } }; }, {}], 32: [function(require2, module4, exports3) { "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; } } module4.exports = Warning; Warning.default = Warning; }, {}], 33: [function(require2, module4, exports3) { var process2 = module4.exports = {}; var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error("setTimeout has not been defined"); } function defaultClearTimeout() { throw new Error("clearTimeout has not been defined"); } (function() { try { if (typeof setTimeout === "function") { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e2) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === "function") { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e2) { cachedClearTimeout = defaultClearTimeout; } })(); function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { return setTimeout(fun, 0); } if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { return cachedSetTimeout(fun, 0); } catch (e2) { try { return cachedSetTimeout.call(null, fun, 0); } catch (e3) { return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { return clearTimeout(marker); } if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { return cachedClearTimeout(marker); } catch (e2) { try { return cachedClearTimeout.call(null, marker); } catch (e3) { return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while (len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process2.nextTick = function(fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item3(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; function Item3(fun, array) { this.fun = fun; this.array = array; } Item3.prototype.run = function() { this.fun.apply(null, this.array); }; process2.title = "browser"; process2.browser = true; process2.env = {}; process2.argv = []; process2.version = ""; process2.versions = {}; function noop4() { } process2.on = noop4; process2.addListener = noop4; process2.once = noop4; process2.off = noop4; process2.removeListener = noop4; process2.removeAllListeners = noop4; process2.emit = noop4; process2.prependListener = noop4; process2.prependOnceListener = noop4; process2.listeners = function(name) { return []; }; process2.binding = function(name) { throw new Error("process.binding is not supported"); }; process2.cwd = function() { return "/"; }; process2.chdir = function(dir) { throw new Error("process.chdir is not supported"); }; process2.umask = function() { return 0; }; }, {}], "postcss": [function(require2, module4, exports3) { (function(process2) { (function() { "use strict"; let CssSyntaxError = require2("./css-syntax-error"); let Declaration = require2("./declaration"); let LazyResult = require2("./lazy-result"); let Container = require2("./container"); let Processor = require2("./processor"); let stringify = require2("./stringify"); let fromJSON = require2("./fromJSON"); let Document2 = require2("./document"); let Warning = require2("./warning"); let Comment2 = require2("./comment"); let AtRule = require2("./at-rule"); let Result = require2("./result.js"); let Input = require2("./input"); let parse3 = require2("./parse"); let list2 = require2("./list"); let Rule = require2("./rule"); let Root9 = require2("./root"); let Node2 = require2("./node"); function postcss2(...plugins2) { if (plugins2.length === 1 && Array.isArray(plugins2[0])) { plugins2 = plugins2[0]; } return new Processor(plugins2); } postcss2.plugin = function plugin(name, initializer) { let warningPrinted = false; function creator(...args) { if (console && console.warn && !warningPrinted) { warningPrinted = true; console.warn( name + ": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration" ); if (process2.env.LANG && process2.env.LANG.startsWith("cn")) { console.warn( name + ": \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:\nhttps://www.w3ctech.com/topic/2226" ); } } let transformer = initializer(...args); transformer.postcssPlugin = name; transformer.postcssVersion = new Processor().version; return transformer; } let cache2; Object.defineProperty(creator, "postcss", { get() { if (!cache2) cache2 = creator(); return cache2; } }); creator.process = function(css2, processOpts, pluginOpts) { return postcss2([creator(pluginOpts)]).process(css2, processOpts); }; return creator; }; postcss2.stringify = stringify; postcss2.parse = parse3; postcss2.fromJSON = fromJSON; postcss2.list = list2; postcss2.comment = (defaults) => new Comment2(defaults); postcss2.atRule = (defaults) => new AtRule(defaults); postcss2.decl = (defaults) => new Declaration(defaults); postcss2.rule = (defaults) => new Rule(defaults); postcss2.root = (defaults) => new Root9(defaults); postcss2.document = (defaults) => new Document2(defaults); postcss2.CssSyntaxError = CssSyntaxError; postcss2.Declaration = Declaration; postcss2.Container = Container; postcss2.Processor = Processor; postcss2.Document = Document2; postcss2.Comment = Comment2; postcss2.Warning = Warning; postcss2.AtRule = AtRule; postcss2.Result = Result; postcss2.Input = Input; postcss2.Rule = Rule; postcss2.Root = Root9; postcss2.Node = Node2; LazyResult.registerPostcss(postcss2); module4.exports = postcss2; postcss2.default = postcss2; }).call(this); }).call(this, require2("_process")); }, { "./at-rule": 7, "./comment": 8, "./container": 9, "./css-syntax-error": 10, "./declaration": 11, "./document": 12, "./fromJSON": 13, "./input": 14, "./lazy-result": 15, "./list": 16, "./node": 19, "./parse": 20, "./processor": 23, "./result.js": 24, "./root": 25, "./rule": 26, "./stringify": 28, "./warning": 32, "_process": 33 }] }, {}, [])("postcss"); }); } }); // node_modules/less/dist/less.js var require_less = __commonJS({ "node_modules/less/dist/less.js"(exports, module2) { (function(global2, factory) { typeof exports === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.less = factory()); })(exports, (function() { "use strict"; function defaultOptions2() { return { /* Inline Javascript - @plugin still allowed */ javascriptEnabled: false, /* Outputs a makefile import dependency list to stdout. */ depends: false, /* (DEPRECATED) Compress using less built-in compression. * This does an okay job but does not utilise all the tricks of * dedicated css compression. */ compress: false, /* Runs the less parser and just reports errors without any output. */ lint: false, /* Sets available include paths. * If the file in an @import rule does not exist at that exact location, * less will look for it at the location(s) passed to this option. * You might use this for instance to specify a path to a library which * you want to be referenced simply and relatively in the less files. */ paths: [], /* color output in the terminal */ color: true, /** * @deprecated This option has confusing behavior and may be removed in a future version. * * When true, prevents @import statements for .less files from being evaluated inside * selector blocks (rulesets). The imports are silently ignored and not output. * * Behavior: * - @import at root level: Always processed * - @import inside @-rules (@media, @supports, etc.): Processed (these are not selector blocks) * - @import inside selector blocks (.class, #id, etc.): NOT processed (silently ignored) * * When false (default): All @import statements are processed regardless of context. * * Note: Despite the name "strict", this option does NOT throw an error when imports * are used in selector blocks - it silently ignores them. This is confusing * behavior that may catch users off guard. * * Note: Only affects .less file imports. CSS imports (url(...) or .css files) are * always output as CSS @import statements regardless of this setting. * * @see https://github.com/less/less.js/issues/656 */ strictImports: false, /* Allow Imports from Insecure HTTPS Hosts */ insecure: false, /* Allows you to add a path to every generated import and url in your css. * This does not affect less import statements that are processed, just ones * that are left in the output css. */ rootpath: "", /* By default URLs are kept as-is, so if you import a file in a sub-directory * that references an image, exactly the same URL will be output in the css. * This option allows you to re-write URL's in imported files so that the * URL is always relative to the base imported file */ rewriteUrls: false, /* How to process math * 0 always - eagerly try to solve all operations * 1 parens-division - require parens for division "/" * 2 parens | strict - require parens for all operations * 3 strict-legacy - legacy strict behavior (super-strict) */ math: 1, /* Without this option, less attempts to guess at the output unit when it does maths. */ strictUnits: false, /* Effectively the declaration is put at the top of your base Less file, * meaning it can be used but it also can be overridden if this variable * is defined in the file. */ globalVars: null, /* As opposed to the global variable option, this puts the declaration at the * end of your base file, meaning it will override anything defined in your Less file. */ modifyVars: null, /* This option allows you to specify a argument to go on to every URL. */ urlArgs: "" }; } function extractId(href) { return href.replace(/^[a-z-]+:\/+?[^/]+/, "").replace(/[?&]livereload=\w+/, "").replace(/^\//, "").replace(/\.[a-zA-Z]+$/, "").replace(/[^.\w-]+/g, "-").replace(/\./g, ":"); } function addDataAttr(options3, tag2) { if (!tag2) { return; } for (var opt in tag2.dataset) { if (Object.prototype.hasOwnProperty.call(tag2.dataset, opt)) { if (opt === "env" || opt === "dumpLineNumbers" || opt === "rootpath" || opt === "errorReporting") { options3[opt] = tag2.dataset[opt]; } else { try { options3[opt] = JSON.parse(tag2.dataset[opt]); } catch (_2) { } } } } } var browser = { createCSS: function(document2, styles, sheet) { var href = sheet.href || ""; var id = "less:".concat(sheet.title || extractId(href)); var oldStyleNode = document2.getElementById(id); var keepOldStyleNode = false; var styleNode = document2.createElement("style"); styleNode.setAttribute("type", "text/css"); if (sheet.media) { styleNode.setAttribute("media", sheet.media); } styleNode.id = id; if (!styleNode.styleSheet) { styleNode.appendChild(document2.createTextNode(styles)); keepOldStyleNode = oldStyleNode !== null && oldStyleNode.childNodes.length > 0 && styleNode.childNodes.length > 0 && oldStyleNode.firstChild.nodeValue === styleNode.firstChild.nodeValue; } var head2 = document2.getElementsByTagName("head")[0]; if (oldStyleNode === null || keepOldStyleNode === false) { var nextEl = sheet && sheet.nextSibling || null; if (nextEl) { nextEl.parentNode.insertBefore(styleNode, nextEl); } else { head2.appendChild(styleNode); } } if (oldStyleNode && keepOldStyleNode === false) { oldStyleNode.parentNode.removeChild(oldStyleNode); } if (styleNode.styleSheet) { try { styleNode.styleSheet.cssText = styles; } catch (e2) { throw new Error("Couldn't reassign styleSheet.cssText."); } } }, currentScript: function(window2) { var document2 = window2.document; return document2.currentScript || (function() { var scripts = document2.getElementsByTagName("script"); return scripts[scripts.length - 1]; })(); } }; var addDefaultOptions = (function(window2, options3) { addDataAttr(options3, browser.currentScript(window2)); if (options3.isFileProtocol === void 0) { options3.isFileProtocol = /^(file|(chrome|safari)(-extension)?|resource|qrc|app):/.test(window2.location.protocol); } options3.async = options3.async || false; options3.fileAsync = options3.fileAsync || false; options3.poll = options3.poll || (options3.isFileProtocol ? 1e3 : 1500); options3.env = options3.env || (window2.location.hostname == "127.0.0.1" || window2.location.hostname == "0.0.0.0" || window2.location.hostname == "localhost" || window2.location.port && window2.location.port.length > 0 || options3.isFileProtocol ? "development" : "production"); var dumpLineNumbers = /!dumpLineNumbers:(comments|mediaquery|all)/.exec(window2.location.hash); if (dumpLineNumbers) { options3.dumpLineNumbers = dumpLineNumbers[1]; } if (options3.useFileCache === void 0) { options3.useFileCache = true; } if (options3.onReady === void 0) { options3.onReady = true; } if (options3.relativeUrls) { options3.rewriteUrls = "all"; } }); var logger$1 = { error: function(msg) { this._fireEvent("error", msg); }, warn: function(msg) { this._fireEvent("warn", msg); }, info: function(msg) { this._fireEvent("info", msg); }, debug: function(msg) { this._fireEvent("debug", msg); }, addListener: function(listener) { this._listeners.push(listener); }, removeListener: function(listener) { for (var i_1 = 0; i_1 < this._listeners.length; i_1++) { if (this._listeners[i_1] === listener) { this._listeners.splice(i_1, 1); return; } } }, _fireEvent: function(type, msg) { for (var i_2 = 0; i_2 < this._listeners.length; i_2++) { var logFunction = this._listeners[i_2][type]; if (logFunction) { logFunction(msg); } } }, _listeners: [] }; var Environment = ( /** @class */ (function() { function Environment2(externalEnvironment, fileManagers) { this.fileManagers = fileManagers || []; externalEnvironment = externalEnvironment || {}; var optionalFunctions = ["encodeBase64", "mimeLookup", "charsetLookup", "getSourceMapGenerator"]; var requiredFunctions = []; var functions2 = requiredFunctions.concat(optionalFunctions); for (var i_1 = 0; i_1 < functions2.length; i_1++) { var propName = functions2[i_1]; var environmentFunc = externalEnvironment[propName]; if (environmentFunc) { this[propName] = environmentFunc.bind(externalEnvironment); } else if (i_1 < requiredFunctions.length) { this.warn("missing required function in environment - ".concat(propName)); } } } Environment2.prototype.getFileManager = function(filename, currentDirectory, options3, environment, isSync) { if (!filename) { logger$1.warn("getFileManager called with no filename.. Please report this issue. continuing."); } if (currentDirectory === void 0) { logger$1.warn("getFileManager called with null directory.. Please report this issue. continuing."); } var fileManagers = this.fileManagers; if (options3.pluginManager) { fileManagers = [].concat(fileManagers).concat(options3.pluginManager.getFileManagers()); } for (var i_2 = fileManagers.length - 1; i_2 >= 0; i_2--) { var fileManager = fileManagers[i_2]; if (fileManager[isSync ? "supportsSync" : "supports"](filename, currentDirectory, options3, environment)) { return fileManager; } } return null; }; Environment2.prototype.addFileManager = function(fileManager) { this.fileManagers.push(fileManager); }; Environment2.prototype.clearFileManagers = function() { this.fileManagers = []; }; return Environment2; })() ); var colors = { "aliceblue": "#f0f8ff", "antiquewhite": "#faebd7", "aqua": "#00ffff", "aquamarine": "#7fffd4", "azure": "#f0ffff", "beige": "#f5f5dc", "bisque": "#ffe4c4", "black": "#000000", "blanchedalmond": "#ffebcd", "blue": "#0000ff", "blueviolet": "#8a2be2", "brown": "#a52a2a", "burlywood": "#deb887", "cadetblue": "#5f9ea0", "chartreuse": "#7fff00", "chocolate": "#d2691e", "coral": "#ff7f50", "cornflowerblue": "#6495ed", "cornsilk": "#fff8dc", "crimson": "#dc143c", "cyan": "#00ffff", "darkblue": "#00008b", "darkcyan": "#008b8b", "darkgoldenrod": "#b8860b", "darkgray": "#a9a9a9", "darkgrey": "#a9a9a9", "darkgreen": "#006400", "darkkhaki": "#bdb76b", "darkmagenta": "#8b008b", "darkolivegreen": "#556b2f", "darkorange": "#ff8c00", "darkorchid": "#9932cc", "darkred": "#8b0000", "darksalmon": "#e9967a", "darkseagreen": "#8fbc8f", "darkslateblue": "#483d8b", "darkslategray": "#2f4f4f", "darkslategrey": "#2f4f4f", "darkturquoise": "#00ced1", "darkviolet": "#9400d3", "deeppink": "#ff1493", "deepskyblue": "#00bfff", "dimgray": "#696969", "dimgrey": "#696969", "dodgerblue": "#1e90ff", "firebrick": "#b22222", "floralwhite": "#fffaf0", "forestgreen": "#228b22", "fuchsia": "#ff00ff", "gainsboro": "#dcdcdc", "ghostwhite": "#f8f8ff", "gold": "#ffd700", "goldenrod": "#daa520", "gray": "#808080", "grey": "#808080", "green": "#008000", "greenyellow": "#adff2f", "honeydew": "#f0fff0", "hotpink": "#ff69b4", "indianred": "#cd5c5c", "indigo": "#4b0082", "ivory": "#fffff0", "khaki": "#f0e68c", "lavender": "#e6e6fa", "lavenderblush": "#fff0f5", "lawngreen": "#7cfc00", "lemonchiffon": "#fffacd", "lightblue": "#add8e6", "lightcoral": "#f08080", "lightcyan": "#e0ffff", "lightgoldenrodyellow": "#fafad2", "lightgray": "#d3d3d3", "lightgrey": "#d3d3d3", "lightgreen": "#90ee90", "lightpink": "#ffb6c1", "lightsalmon": "#ffa07a", "lightseagreen": "#20b2aa", "lightskyblue": "#87cefa", "lightslategray": "#778899", "lightslategrey": "#778899", "lightsteelblue": "#b0c4de", "lightyellow": "#ffffe0", "lime": "#00ff00", "limegreen": "#32cd32", "linen": "#faf0e6", "magenta": "#ff00ff", "maroon": "#800000", "mediumaquamarine": "#66cdaa", "mediumblue": "#0000cd", "mediumorchid": "#ba55d3", "mediumpurple": "#9370d8", "mediumseagreen": "#3cb371", "mediumslateblue": "#7b68ee", "mediumspringgreen": "#00fa9a", "mediumturquoise": "#48d1cc", "mediumvioletred": "#c71585", "midnightblue": "#191970", "mintcream": "#f5fffa", "mistyrose": "#ffe4e1", "moccasin": "#ffe4b5", "navajowhite": "#ffdead", "navy": "#000080", "oldlace": "#fdf5e6", "olive": "#808000", "olivedrab": "#6b8e23", "orange": "#ffa500", "orangered": "#ff4500", "orchid": "#da70d6", "palegoldenrod": "#eee8aa", "palegreen": "#98fb98", "paleturquoise": "#afeeee", "palevioletred": "#d87093", "papayawhip": "#ffefd5", "peachpuff": "#ffdab9", "peru": "#cd853f", "pink": "#ffc0cb", "plum": "#dda0dd", "powderblue": "#b0e0e6", "purple": "#800080", "rebeccapurple": "#663399", "red": "#ff0000", "rosybrown": "#bc8f8f", "royalblue": "#4169e1", "saddlebrown": "#8b4513", "salmon": "#fa8072", "sandybrown": "#f4a460", "seagreen": "#2e8b57", "seashell": "#fff5ee", "sienna": "#a0522d", "silver": "#c0c0c0", "skyblue": "#87ceeb", "slateblue": "#6a5acd", "slategray": "#708090", "slategrey": "#708090", "snow": "#fffafa", "springgreen": "#00ff7f", "steelblue": "#4682b4", "tan": "#d2b48c", "teal": "#008080", "thistle": "#d8bfd8", "tomato": "#ff6347", "turquoise": "#40e0d0", "violet": "#ee82ee", "wheat": "#f5deb3", "white": "#ffffff", "whitesmoke": "#f5f5f5", "yellow": "#ffff00", "yellowgreen": "#9acd32" }; var unitConversions = { length: { "m": 1, "cm": 0.01, "mm": 1e-3, "in": 0.0254, "px": 0.0254 / 96, "pt": 0.0254 / 72, "pc": 0.0254 / 72 * 12 }, duration: { "s": 1, "ms": 1e-3 }, angle: { "rad": 1 / (2 * Math.PI), "deg": 1 / 360, "grad": 1 / 400, "turn": 1 } }; var data = { colors, unitConversions }; var Node2 = ( /** @class */ (function() { function Node3() { this.parent = null; this.visibilityBlocks = void 0; this.nodeVisible = void 0; this.rootNode = null; this.parsed = null; } Object.defineProperty(Node3.prototype, "currentFileInfo", { get: function() { return this.fileInfo(); }, enumerable: false, configurable: true }); Object.defineProperty(Node3.prototype, "index", { get: function() { return this.getIndex(); }, enumerable: false, configurable: true }); Node3.prototype.setParent = function(nodes, parent) { function set2(node) { if (node && node instanceof Node3) { node.parent = parent; } } if (Array.isArray(nodes)) { nodes.forEach(set2); } else { set2(nodes); } }; Node3.prototype.getIndex = function() { return this._index || this.parent && this.parent.getIndex() || 0; }; Node3.prototype.fileInfo = function() { return this._fileInfo || this.parent && this.parent.fileInfo() || {}; }; Node3.prototype.isRulesetLike = function() { return false; }; Node3.prototype.toCSS = function(context) { var strs = []; this.genCSS(context, { // remove when genCSS has JSDoc types // eslint-disable-next-line no-unused-vars add: function(chunk, fileInfo, index2) { strs.push(chunk); }, isEmpty: function() { return strs.length === 0; } }); return strs.join(""); }; Node3.prototype.genCSS = function(context, output) { output.add(this.value); }; Node3.prototype.accept = function(visitor) { this.value = visitor.visit(this.value); }; Node3.prototype.eval = function() { return this; }; Node3.prototype._operate = function(context, op, a, b2) { switch (op) { case "+": return a + b2; case "-": return a - b2; case "*": return a * b2; case "/": return a / b2; } }; Node3.prototype.fround = function(context, value) { var precision = context && context.numPrecision; return precision ? Number((value + 2e-16).toFixed(precision)) : value; }; Node3.compare = function(a, b2) { if (a.compare && // for "symmetric results" force toCSS-based comparison // of Quoted or Anonymous if either value is one of those !(b2.type === "Quoted" || b2.type === "Anonymous")) { return a.compare(b2); } else if (b2.compare) { return -b2.compare(a); } else if (a.type !== b2.type) { return void 0; } a = a.value; b2 = b2.value; if (!Array.isArray(a)) { return a === b2 ? 0 : void 0; } if (a.length !== b2.length) { return void 0; } for (var i_1 = 0; i_1 < a.length; i_1++) { if (Node3.compare(a[i_1], b2[i_1]) !== 0) { return void 0; } } return 0; }; Node3.numericCompare = function(a, b2) { return a < b2 ? -1 : a === b2 ? 0 : a > b2 ? 1 : void 0; }; Node3.prototype.blocksVisibility = function() { if (this.visibilityBlocks === void 0) { this.visibilityBlocks = 0; } return this.visibilityBlocks !== 0; }; Node3.prototype.addVisibilityBlock = function() { if (this.visibilityBlocks === void 0) { this.visibilityBlocks = 0; } this.visibilityBlocks = this.visibilityBlocks + 1; }; Node3.prototype.removeVisibilityBlock = function() { if (this.visibilityBlocks === void 0) { this.visibilityBlocks = 0; } this.visibilityBlocks = this.visibilityBlocks - 1; }; Node3.prototype.ensureVisibility = function() { this.nodeVisible = true; }; Node3.prototype.ensureInvisibility = function() { this.nodeVisible = false; }; Node3.prototype.isVisible = function() { return this.nodeVisible; }; Node3.prototype.visibilityInfo = function() { return { visibilityBlocks: this.visibilityBlocks, nodeVisible: this.nodeVisible }; }; Node3.prototype.copyVisibilityInfo = function(info) { if (!info) { return; } this.visibilityBlocks = info.visibilityBlocks; this.nodeVisible = info.nodeVisible; }; return Node3; })() ); var Color = function(rgb, a, originalForm) { var self2 = this; if (Array.isArray(rgb)) { this.rgb = rgb; } else if (rgb.length >= 6) { this.rgb = []; rgb.match(/.{2}/g).map(function(c2, i) { if (i < 3) { self2.rgb.push(parseInt(c2, 16)); } else { self2.alpha = parseInt(c2, 16) / 255; } }); } else { this.rgb = []; rgb.split("").map(function(c2, i) { if (i < 3) { self2.rgb.push(parseInt(c2 + c2, 16)); } else { self2.alpha = parseInt(c2 + c2, 16) / 255; } }); } this.alpha = this.alpha || (typeof a === "number" ? a : 1); if (typeof originalForm !== "undefined") { this.value = originalForm; } }; Color.prototype = Object.assign(new Node2(), { type: "Color", luma: function() { var r = this.rgb[0] / 255, g2 = this.rgb[1] / 255, b2 = this.rgb[2] / 255; r = r <= 0.03928 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4); g2 = g2 <= 0.03928 ? g2 / 12.92 : Math.pow((g2 + 0.055) / 1.055, 2.4); b2 = b2 <= 0.03928 ? b2 / 12.92 : Math.pow((b2 + 0.055) / 1.055, 2.4); return 0.2126 * r + 0.7152 * g2 + 0.0722 * b2; }, genCSS: function(context, output) { output.add(this.toCSS(context)); }, toCSS: function(context, doNotCompress) { var compress = context && context.compress && !doNotCompress; var color2; var alpha; var colorFunction; var args = []; alpha = this.fround(context, this.alpha); if (this.value) { if (this.value.indexOf("rgb") === 0) { if (alpha < 1) { colorFunction = "rgba"; } } else if (this.value.indexOf("hsl") === 0) { if (alpha < 1) { colorFunction = "hsla"; } else { colorFunction = "hsl"; } } else { return this.value; } } else { if (alpha < 1) { colorFunction = "rgba"; } } switch (colorFunction) { case "rgba": args = this.rgb.map(function(c2) { return clamp$1(Math.round(c2), 255); }).concat(clamp$1(alpha, 1)); break; case "hsla": args.push(clamp$1(alpha, 1)); // eslint-disable-next-line no-fallthrough case "hsl": color2 = this.toHSL(); args = [ this.fround(context, color2.h), "".concat(this.fround(context, color2.s * 100), "%"), "".concat(this.fround(context, color2.l * 100), "%") ].concat(args); } if (colorFunction) { return "".concat(colorFunction, "(").concat(args.join(",".concat(compress ? "" : " ")), ")"); } color2 = this.toRGB(); if (compress) { var splitcolor = color2.split(""); if (splitcolor[1] === splitcolor[2] && splitcolor[3] === splitcolor[4] && splitcolor[5] === splitcolor[6]) { color2 = "#".concat(splitcolor[1]).concat(splitcolor[3]).concat(splitcolor[5]); } } return color2; }, // // Operations have to be done per-channel, if not, // channels will spill onto each other. Once we have // our result, in the form of an integer triplet, // we create a new Color node to hold the result. // operate: function(context, op, other) { var rgb = new Array(3); var alpha = this.alpha * (1 - other.alpha) + other.alpha; for (var c2 = 0; c2 < 3; c2++) { rgb[c2] = this._operate(context, op, this.rgb[c2], other.rgb[c2]); } return new Color(rgb, alpha); }, toRGB: function() { return toHex(this.rgb); }, toHSL: function() { var r = this.rgb[0] / 255, g2 = this.rgb[1] / 255, b2 = this.rgb[2] / 255, a = this.alpha; var max2 = Math.max(r, g2, b2), min2 = Math.min(r, g2, b2); var h; var s; var l = (max2 + min2) / 2; var d = max2 - min2; if (max2 === min2) { h = s = 0; } else { s = l > 0.5 ? d / (2 - max2 - min2) : d / (max2 + min2); switch (max2) { case r: h = (g2 - b2) / d + (g2 < b2 ? 6 : 0); break; case g2: h = (b2 - r) / d + 2; break; case b2: h = (r - g2) / d + 4; break; } h /= 6; } return { h: h * 360, s, l, a }; }, // Adapted from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript toHSV: function() { var r = this.rgb[0] / 255, g2 = this.rgb[1] / 255, b2 = this.rgb[2] / 255, a = this.alpha; var max2 = Math.max(r, g2, b2), min2 = Math.min(r, g2, b2); var h; var s; var v2 = max2; var d = max2 - min2; if (max2 === 0) { s = 0; } else { s = d / max2; } if (max2 === min2) { h = 0; } else { switch (max2) { case r: h = (g2 - b2) / d + (g2 < b2 ? 6 : 0); break; case g2: h = (b2 - r) / d + 2; break; case b2: h = (r - g2) / d + 4; break; } h /= 6; } return { h: h * 360, s, v: v2, a }; }, toARGB: function() { return toHex([this.alpha * 255].concat(this.rgb)); }, compare: function(x2) { return x2.rgb && x2.rgb[0] === this.rgb[0] && x2.rgb[1] === this.rgb[1] && x2.rgb[2] === this.rgb[2] && x2.alpha === this.alpha ? 0 : void 0; } }); Color.fromKeyword = function(keyword) { var c2; var key2 = keyword.toLowerCase(); if (colors.hasOwnProperty(key2)) { c2 = new Color(colors[key2].slice(1)); } else if (key2 === "transparent") { c2 = new Color([0, 0, 0], 0); } if (c2) { c2.value = keyword; return c2; } }; function clamp$1(v2, max2) { return Math.min(Math.max(v2, 0), max2); } function toHex(v2) { return "#".concat(v2.map(function(c2) { c2 = clamp$1(Math.round(c2), 255); return (c2 < 16 ? "0" : "") + c2.toString(16); }).join("")); } var __assign2 = function() { __assign2 = Object.assign || function __assign3(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2)) t[p2] = s[p2]; } return t; }; return __assign2.apply(this, arguments); }; function __spreadArray2(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); } typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) { var e2 = new Error(message); return e2.name = "SuppressedError", e2.error = error, e2.suppressed = suppressed, e2; }; var Paren = function(node) { this.value = node; }; Paren.prototype = Object.assign(new Node2(), { type: "Paren", genCSS: function(context, output) { output.add("("); this.value.genCSS(context, output); output.add(")"); }, eval: function(context) { var paren = new Paren(this.value.eval(context)); if (this.noSpacing) { paren.noSpacing = true; } return paren; } }); var _noSpaceCombinators = { "": true, " ": true, "|": true }; var Combinator = function(value) { if (value === " ") { this.value = " "; this.emptyOrWhitespace = true; } else { this.value = value ? value.trim() : ""; this.emptyOrWhitespace = this.value === ""; } }; Combinator.prototype = Object.assign(new Node2(), { type: "Combinator", genCSS: function(context, output) { var spaceOrEmpty = context.compress || _noSpaceCombinators[this.value] ? "" : " "; output.add(spaceOrEmpty + this.value + spaceOrEmpty); } }); var Element2 = function(combinator, value, isVariable, index2, currentFileInfo, visibilityInfo) { this.combinator = combinator instanceof Combinator ? combinator : new Combinator(combinator); if (typeof value === "string") { this.value = value.trim(); } else if (value) { this.value = value; } else { this.value = ""; } this.isVariable = isVariable; this._index = index2; this._fileInfo = currentFileInfo; this.copyVisibilityInfo(visibilityInfo); this.setParent(this.combinator, this); }; Element2.prototype = Object.assign(new Node2(), { type: "Element", accept: function(visitor) { var value = this.value; this.combinator = visitor.visit(this.combinator); if (typeof value === "object") { this.value = visitor.visit(value); } }, eval: function(context) { return new Element2(this.combinator, this.value.eval ? this.value.eval(context) : this.value, this.isVariable, this.getIndex(), this.fileInfo(), this.visibilityInfo()); }, clone: function() { return new Element2(this.combinator, this.value, this.isVariable, this.getIndex(), this.fileInfo(), this.visibilityInfo()); }, genCSS: function(context, output) { output.add(this.toCSS(context), this.fileInfo(), this.getIndex()); }, toCSS: function(context) { context = context || {}; var value = this.value; var firstSelector = context.firstSelector; if (value instanceof Paren) { context.firstSelector = true; } value = value.toCSS ? value.toCSS(context) : value; context.firstSelector = firstSelector; if (value === "" && this.combinator.value.charAt(0) === "&") { return ""; } else { return this.combinator.toCSS(context) + value; } } }); var Math$1 = { ALWAYS: 0, PARENS_DIVISION: 1, PARENS: 2 // removed - STRICT_LEGACY: 3 }; var RewriteUrls = { OFF: 0, LOCAL: 1, ALL: 2 }; function getType2(payload) { return Object.prototype.toString.call(payload).slice(8, -1); } function isPlainObject2(payload) { if (getType2(payload) !== "Object") return false; return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype; } function isArray2(payload) { return getType2(payload) === "Array"; } function assignProp(carry, key2, newVal, originalObject, includeNonenumerable) { const propType = {}.propertyIsEnumerable.call(originalObject, key2) ? "enumerable" : "nonenumerable"; if (propType === "enumerable") carry[key2] = newVal; if (includeNonenumerable && propType === "nonenumerable") { Object.defineProperty(carry, key2, { value: newVal, enumerable: false, writable: true, configurable: true }); } } function copy(target, options3 = {}) { if (isArray2(target)) { return target.map((item) => copy(item, options3)); } if (!isPlainObject2(target)) { return target; } const props = Object.getOwnPropertyNames(target); const symbols = Object.getOwnPropertySymbols(target); return [...props, ...symbols].reduce((carry, key2) => { if (isArray2(options3.props) && !options3.props.includes(key2)) { return carry; } const val = target[key2]; const newVal = copy(val, options3); assignProp(carry, key2, newVal, target, options3.nonenumerable); return carry; }, {}); } function getLocation(index2, inputStream) { var n = index2 + 1; var line = null; var column = -1; while (--n >= 0 && inputStream.charAt(n) !== "\n") { column++; } if (typeof index2 === "number") { line = (inputStream.slice(0, index2).match(/\n/g) || "").length; } return { line, column }; } function copyArray(arr) { var i; var length = arr.length; var copy2 = new Array(length); for (i = 0; i < length; i++) { copy2[i] = arr[i]; } return copy2; } function clone(obj) { var cloned = {}; for (var prop in obj) { if (Object.prototype.hasOwnProperty.call(obj, prop)) { cloned[prop] = obj[prop]; } } return cloned; } function defaults(obj1, obj2) { var newObj = obj2 || {}; if (!obj2._defaults) { newObj = {}; var defaults_1 = copy(obj1); newObj._defaults = defaults_1; var cloned = obj2 ? copy(obj2) : {}; Object.assign(newObj, defaults_1, cloned); } return newObj; } function copyOptions(obj1, obj2) { if (obj2 && obj2._defaults) { return obj2; } var opts = defaults(obj1, obj2); if (opts.strictMath) { opts.math = Math$1.PARENS; } if (opts.relativeUrls) { opts.rewriteUrls = RewriteUrls.ALL; } if (typeof opts.math === "string") { switch (opts.math.toLowerCase()) { case "always": opts.math = Math$1.ALWAYS; break; case "parens-division": opts.math = Math$1.PARENS_DIVISION; break; case "strict": case "parens": opts.math = Math$1.PARENS; break; default: opts.math = Math$1.PARENS; } } if (typeof opts.rewriteUrls === "string") { switch (opts.rewriteUrls.toLowerCase()) { case "off": opts.rewriteUrls = RewriteUrls.OFF; break; case "local": opts.rewriteUrls = RewriteUrls.LOCAL; break; case "all": opts.rewriteUrls = RewriteUrls.ALL; break; } } return opts; } function merge(obj1, obj2) { for (var prop in obj2) { if (Object.prototype.hasOwnProperty.call(obj2, prop)) { obj1[prop] = obj2[prop]; } } return obj1; } function flattenArray(arr, result) { if (result === void 0) { result = []; } for (var i_1 = 0, length_1 = arr.length; i_1 < length_1; i_1++) { var value = arr[i_1]; if (Array.isArray(value)) { flattenArray(value, result); } else { if (value !== void 0) { result.push(value); } } } return result; } function isNullOrUndefined(val) { return val === null || val === void 0; } var utils = /* @__PURE__ */ Object.freeze({ __proto__: null, getLocation, copyArray, clone, defaults, copyOptions, merge, flattenArray, isNullOrUndefined }); var anonymousFunc = /(|Function):(\d+):(\d+)/; var LessError = function(e2, fileContentMap, currentFilename) { Error.call(this); var filename = e2.filename || currentFilename; this.message = e2.message; this.stack = e2.stack; this.type = e2.type || "Syntax"; if (fileContentMap && filename) { var input = fileContentMap.contents[filename]; var loc = getLocation(e2.index, input); var line = loc.line; var col = loc.column; var callLine = e2.call && getLocation(e2.call, input).line; var lines = input ? input.split("\n") : ""; this.filename = filename; this.index = e2.index; this.line = typeof line === "number" ? line + 1 : null; this.column = col; if (!this.line && this.stack) { var found = this.stack.match(anonymousFunc); var func = new Function("a", "throw new Error()"); var lineAdjust = 0; try { func(); } catch (e3) { var match = e3.stack.match(anonymousFunc); lineAdjust = 1 - parseInt(match[2]); } if (found) { if (found[2]) { this.line = parseInt(found[2]) + lineAdjust; } if (found[3]) { this.column = parseInt(found[3]); } } } this.callLine = callLine + 1; this.callExtract = lines[callLine]; this.extract = [ lines[this.line - 2], lines[this.line - 1], lines[this.line] ]; } }; if (typeof Object.create === "undefined") { var F2 = function() { }; F2.prototype = Error.prototype; LessError.prototype = new F2(); } else { LessError.prototype = Object.create(Error.prototype); } LessError.prototype.constructor = LessError; LessError.prototype.toString = function(options3) { var _a5; options3 = options3 || {}; var isWarning = ((_a5 = this.type) !== null && _a5 !== void 0 ? _a5 : "").toLowerCase().includes("warning"); var type = isWarning ? this.type : "".concat(this.type, "Error"); var color2 = isWarning ? "yellow" : "red"; var message = ""; var extract = this.extract || []; var error = []; var stylize = function(str) { return str; }; if (options3.stylize) { var type_1 = typeof options3.stylize; if (type_1 !== "function") { throw Error("options.stylize should be a function, got a ".concat(type_1, "!")); } stylize = options3.stylize; } if (this.line !== null) { if (!isWarning && typeof extract[0] === "string") { error.push(stylize("".concat(this.line - 1, " ").concat(extract[0]), "grey")); } if (typeof extract[1] === "string") { var errorTxt = "".concat(this.line, " "); if (extract[1]) { errorTxt += extract[1].slice(0, this.column) + stylize(stylize(stylize(extract[1].substr(this.column, 1), "bold") + extract[1].slice(this.column + 1), "red"), "inverse"); } error.push(errorTxt); } if (!isWarning && typeof extract[2] === "string") { error.push(stylize("".concat(this.line + 1, " ").concat(extract[2]), "grey")); } error = "".concat(error.join("\n") + stylize("", "reset"), "\n"); } message += stylize("".concat(type, ": ").concat(this.message), color2); if (this.filename) { message += stylize(" in ", color2) + this.filename; } if (this.line) { message += stylize(" on line ".concat(this.line, ", column ").concat(this.column + 1, ":"), "grey"); } message += "\n".concat(error); if (this.callLine) { message += "".concat(stylize("from ", color2) + (this.filename || ""), "/n"); message += "".concat(stylize(this.callLine, "grey"), " ").concat(this.callExtract, "/n"); } return message; }; var _visitArgs = { visitDeeper: true }; var _hasIndexed = false; function _noop(node) { return node; } function indexNodeTypes(parent, ticker) { var key2, child; for (key2 in parent) { child = parent[key2]; switch (typeof child) { case "function": if (child.prototype && child.prototype.type) { child.prototype.typeIndex = ticker++; } break; case "object": ticker = indexNodeTypes(child, ticker); break; } } return ticker; } var Visitor = ( /** @class */ (function() { function Visitor2(implementation) { this._implementation = implementation; this._visitInCache = {}; this._visitOutCache = {}; if (!_hasIndexed) { indexNodeTypes(tree, 1); _hasIndexed = true; } } Visitor2.prototype.visit = function(node) { if (!node) { return node; } var nodeTypeIndex = node.typeIndex; if (!nodeTypeIndex) { if (node.value && node.value.typeIndex) { this.visit(node.value); } return node; } var impl = this._implementation; var func = this._visitInCache[nodeTypeIndex]; var funcOut = this._visitOutCache[nodeTypeIndex]; var visitArgs = _visitArgs; var fnName; visitArgs.visitDeeper = true; if (!func) { fnName = "visit".concat(node.type); func = impl[fnName] || _noop; funcOut = impl["".concat(fnName, "Out")] || _noop; this._visitInCache[nodeTypeIndex] = func; this._visitOutCache[nodeTypeIndex] = funcOut; } if (func !== _noop) { var newNode = func.call(impl, node, visitArgs); if (node && impl.isReplacing) { node = newNode; } } if (visitArgs.visitDeeper && node) { if (node.length) { for (var i_1 = 0, cnt = node.length; i_1 < cnt; i_1++) { if (node[i_1].accept) { node[i_1].accept(this); } } } else if (node.accept) { node.accept(this); } } if (funcOut != _noop) { funcOut.call(impl, node); } return node; }; Visitor2.prototype.visitArray = function(nodes, nonReplacing) { if (!nodes) { return nodes; } var cnt = nodes.length; var i; if (nonReplacing || !this._implementation.isReplacing) { for (i = 0; i < cnt; i++) { this.visit(nodes[i]); } return nodes; } var out = []; for (i = 0; i < cnt; i++) { var evald = this.visit(nodes[i]); if (evald === void 0) { continue; } if (!evald.splice) { out.push(evald); } else if (evald.length) { this.flatten(evald, out); } } return out; }; Visitor2.prototype.flatten = function(arr, out) { if (!out) { out = []; } var cnt, i, item, nestedCnt, j2, nestedItem; for (i = 0, cnt = arr.length; i < cnt; i++) { item = arr[i]; if (item === void 0) { continue; } if (!item.splice) { out.push(item); continue; } for (j2 = 0, nestedCnt = item.length; j2 < nestedCnt; j2++) { nestedItem = item[j2]; if (nestedItem === void 0) { continue; } if (!nestedItem.splice) { out.push(nestedItem); } else if (nestedItem.length) { this.flatten(nestedItem, out); } } } return out; }; return Visitor2; })() ); var contexts = {}; var copyFromOriginal = function copyFromOriginal2(original, destination, propertiesToCopy) { if (!original) { return; } for (var i_1 = 0; i_1 < propertiesToCopy.length; i_1++) { if (Object.prototype.hasOwnProperty.call(original, propertiesToCopy[i_1])) { destination[propertiesToCopy[i_1]] = original[propertiesToCopy[i_1]]; } } }; var parseCopyProperties = [ // options "paths", "rewriteUrls", "rootpath", "strictImports", "insecure", "dumpLineNumbers", "compress", "syncImport", "mime", "useFileCache", // context "processImports", // Used by the import manager to stop multiple import visitors being created. "pluginManager", "quiet" // option - whether to log warnings ]; contexts.Parse = function(options3) { copyFromOriginal(options3, this, parseCopyProperties); if (typeof this.paths === "string") { this.paths = [this.paths]; } }; var evalCopyProperties = [ "paths", "compress", "math", "strictUnits", "sourceMap", "importMultiple", "urlArgs", "javascriptEnabled", "pluginManager", "importantScope", "rewriteUrls" // option - whether to adjust URL's to be relative ]; contexts.Eval = function(options3, frames) { copyFromOriginal(options3, this, evalCopyProperties); if (typeof this.paths === "string") { this.paths = [this.paths]; } this.frames = frames || []; this.importantScope = this.importantScope || []; }; contexts.Eval.prototype.enterCalc = function() { if (!this.calcStack) { this.calcStack = []; } this.calcStack.push(true); this.inCalc = true; }; contexts.Eval.prototype.exitCalc = function() { this.calcStack.pop(); if (!this.calcStack.length) { this.inCalc = false; } }; contexts.Eval.prototype.inParenthesis = function() { if (!this.parensStack) { this.parensStack = []; } this.parensStack.push(true); }; contexts.Eval.prototype.outOfParenthesis = function() { this.parensStack.pop(); }; contexts.Eval.prototype.inCalc = false; contexts.Eval.prototype.mathOn = true; contexts.Eval.prototype.isMathOn = function(op) { if (!this.mathOn) { return false; } if (op === "/" && this.math !== Math$1.ALWAYS && (!this.parensStack || !this.parensStack.length)) { return false; } if (this.math > Math$1.PARENS_DIVISION) { return this.parensStack && this.parensStack.length; } return true; }; contexts.Eval.prototype.pathRequiresRewrite = function(path) { var isRelative = this.rewriteUrls === RewriteUrls.LOCAL ? isPathLocalRelative : isPathRelative; return isRelative(path); }; contexts.Eval.prototype.rewritePath = function(path, rootpath) { var newPath; rootpath = rootpath || ""; newPath = this.normalizePath(rootpath + path); if (isPathLocalRelative(path) && isPathRelative(rootpath) && isPathLocalRelative(newPath) === false) { newPath = "./".concat(newPath); } return newPath; }; contexts.Eval.prototype.normalizePath = function(path) { var segments = path.split("/").reverse(); var segment; path = []; while (segments.length !== 0) { segment = segments.pop(); switch (segment) { case ".": break; case "..": if (path.length === 0 || path[path.length - 1] === "..") { path.push(segment); } else { path.pop(); } break; default: path.push(segment); break; } } return path.join("/"); }; function isPathRelative(path) { return !/^(?:[a-z-]+:|\/|#)/i.test(path); } function isPathLocalRelative(path) { return path.charAt(0) === "."; } var ImportSequencer = ( /** @class */ (function() { function ImportSequencer2(onSequencerEmpty) { this.imports = []; this.variableImports = []; this._onSequencerEmpty = onSequencerEmpty; this._currentDepth = 0; } ImportSequencer2.prototype.addImport = function(callback) { var importSequencer = this, importItem = { callback, args: null, isReady: false }; this.imports.push(importItem); return function() { importItem.args = Array.prototype.slice.call(arguments, 0); importItem.isReady = true; importSequencer.tryRun(); }; }; ImportSequencer2.prototype.addVariableImport = function(callback) { this.variableImports.push(callback); }; ImportSequencer2.prototype.tryRun = function() { this._currentDepth++; try { while (true) { while (this.imports.length > 0) { var importItem = this.imports[0]; if (!importItem.isReady) { return; } this.imports = this.imports.slice(1); importItem.callback.apply(null, importItem.args); } if (this.variableImports.length === 0) { break; } var variableImport = this.variableImports[0]; this.variableImports = this.variableImports.slice(1); variableImport(); } } finally { this._currentDepth--; } if (this._currentDepth === 0 && this._onSequencerEmpty) { this._onSequencerEmpty(); } }; return ImportSequencer2; })() ); var ImportVisitor = function(importer, finish) { this._visitor = new Visitor(this); this._importer = importer; this._finish = finish; this.context = new contexts.Eval(); this.importCount = 0; this.onceFileDetectionMap = {}; this.recursionDetector = {}; this._sequencer = new ImportSequencer(this._onSequencerEmpty.bind(this)); }; ImportVisitor.prototype = { isReplacing: false, run: function(root2) { try { this._visitor.visit(root2); } catch (e2) { this.error = e2; } this.isFinished = true; this._sequencer.tryRun(); }, _onSequencerEmpty: function() { if (!this.isFinished) { return; } this._finish(this.error); }, visitImport: function(importNode, visitArgs) { var inlineCSS = importNode.options.inline; if (!importNode.css || inlineCSS) { var context = new contexts.Eval(this.context, copyArray(this.context.frames)); var importParent = context.frames[0]; this.importCount++; if (importNode.isVariableImport()) { this._sequencer.addVariableImport(this.processImportNode.bind(this, importNode, context, importParent)); } else { this.processImportNode(importNode, context, importParent); } } visitArgs.visitDeeper = false; }, processImportNode: function(importNode, context, importParent) { var evaldImportNode; var inlineCSS = importNode.options.inline; try { evaldImportNode = importNode.evalForImport(context); } catch (e2) { if (!e2.filename) { e2.index = importNode.getIndex(); e2.filename = importNode.fileInfo().filename; } importNode.css = true; importNode.error = e2; } if (evaldImportNode && (!evaldImportNode.css || inlineCSS)) { if (evaldImportNode.options.multiple) { context.importMultiple = true; } var tryAppendLessExtension = evaldImportNode.css === void 0; for (var i_1 = 0; i_1 < importParent.rules.length; i_1++) { if (importParent.rules[i_1] === importNode) { importParent.rules[i_1] = evaldImportNode; break; } } var onImported = this.onImported.bind(this, evaldImportNode, context), sequencedOnImported = this._sequencer.addImport(onImported); this._importer.push(evaldImportNode.getPath(), tryAppendLessExtension, evaldImportNode.fileInfo(), evaldImportNode.options, sequencedOnImported); } else { this.importCount--; if (this.isFinished) { this._sequencer.tryRun(); } } }, onImported: function(importNode, context, e2, root2, importedAtRoot, fullPath) { if (e2) { if (!e2.filename) { e2.index = importNode.getIndex(); e2.filename = importNode.fileInfo().filename; } this.error = e2; } var importVisitor = this, inlineCSS = importNode.options.inline, isPlugin = importNode.options.isPlugin, isOptional = importNode.options.optional, duplicateImport = importedAtRoot || fullPath in importVisitor.recursionDetector; if (!context.importMultiple) { if (duplicateImport) { importNode.skip = true; } else { importNode.skip = function() { if (fullPath in importVisitor.onceFileDetectionMap) { return true; } importVisitor.onceFileDetectionMap[fullPath] = true; return false; }; } } if (!fullPath && isOptional) { importNode.skip = true; } if (root2) { importNode.root = root2; importNode.importedFilename = fullPath; if (!inlineCSS && !isPlugin && (context.importMultiple || !duplicateImport)) { importVisitor.recursionDetector[fullPath] = true; var oldContext = this.context; this.context = context; try { this._visitor.visit(root2); } catch (e3) { this.error = e3; } this.context = oldContext; } } importVisitor.importCount--; if (importVisitor.isFinished) { importVisitor._sequencer.tryRun(); } }, visitDeclaration: function(declNode, visitArgs) { if (declNode.value.type === "DetachedRuleset") { this.context.frames.unshift(declNode); } else { visitArgs.visitDeeper = false; } }, visitDeclarationOut: function(declNode) { if (declNode.value.type === "DetachedRuleset") { this.context.frames.shift(); } }, visitAtRule: function(atRuleNode, visitArgs) { if (atRuleNode.value) { this.context.frames.unshift(atRuleNode); } else if (atRuleNode.declarations && atRuleNode.declarations.length) { if (atRuleNode.isRooted) { this.context.frames.unshift(atRuleNode); } else { this.context.frames.unshift(atRuleNode.declarations[0]); } } else if (atRuleNode.rules && atRuleNode.rules.length) { this.context.frames.unshift(atRuleNode); } }, visitAtRuleOut: function(atRuleNode) { this.context.frames.shift(); }, visitMixinDefinition: function(mixinDefinitionNode, visitArgs) { this.context.frames.unshift(mixinDefinitionNode); }, visitMixinDefinitionOut: function(mixinDefinitionNode) { this.context.frames.shift(); }, visitRuleset: function(rulesetNode, visitArgs) { this.context.frames.unshift(rulesetNode); }, visitRulesetOut: function(rulesetNode) { this.context.frames.shift(); }, visitMedia: function(mediaNode, visitArgs) { this.context.frames.unshift(mediaNode.rules[0]); }, visitMediaOut: function(mediaNode) { this.context.frames.shift(); } }; var SetTreeVisibilityVisitor = ( /** @class */ (function() { function SetTreeVisibilityVisitor2(visible) { this.visible = visible; } SetTreeVisibilityVisitor2.prototype.run = function(root2) { this.visit(root2); }; SetTreeVisibilityVisitor2.prototype.visitArray = function(nodes) { if (!nodes) { return nodes; } var cnt = nodes.length; var i; for (i = 0; i < cnt; i++) { this.visit(nodes[i]); } return nodes; }; SetTreeVisibilityVisitor2.prototype.visit = function(node) { if (!node) { return node; } if (node.constructor === Array) { return this.visitArray(node); } if (!node.blocksVisibility || node.blocksVisibility()) { return node; } if (this.visible) { node.ensureVisibility(); } else { node.ensureInvisibility(); } node.accept(this); return node; }; return SetTreeVisibilityVisitor2; })() ); var ExtendFinderVisitor = ( /** @class */ (function() { function ExtendFinderVisitor2() { this._visitor = new Visitor(this); this.contexts = []; this.allExtendsStack = [[]]; } ExtendFinderVisitor2.prototype.run = function(root2) { root2 = this._visitor.visit(root2); root2.allExtends = this.allExtendsStack[0]; return root2; }; ExtendFinderVisitor2.prototype.visitDeclaration = function(declNode, visitArgs) { visitArgs.visitDeeper = false; }; ExtendFinderVisitor2.prototype.visitMixinDefinition = function(mixinDefinitionNode, visitArgs) { visitArgs.visitDeeper = false; }; ExtendFinderVisitor2.prototype.visitRuleset = function(rulesetNode, visitArgs) { if (rulesetNode.root) { return; } var i; var j2; var extend; var allSelectorsExtendList = []; var extendList; var rules = rulesetNode.rules, ruleCnt = rules ? rules.length : 0; for (i = 0; i < ruleCnt; i++) { if (rulesetNode.rules[i] instanceof tree.Extend) { allSelectorsExtendList.push(rules[i]); rulesetNode.extendOnEveryPath = true; } } var paths = rulesetNode.paths; for (i = 0; i < paths.length; i++) { var selectorPath = paths[i], selector = selectorPath[selectorPath.length - 1], selExtendList = selector.extendList; extendList = selExtendList ? copyArray(selExtendList).concat(allSelectorsExtendList) : allSelectorsExtendList; if (extendList) { extendList = extendList.map(function(allSelectorsExtend) { return allSelectorsExtend.clone(); }); } for (j2 = 0; j2 < extendList.length; j2++) { this.foundExtends = true; extend = extendList[j2]; extend.findSelfSelectors(selectorPath); extend.ruleset = rulesetNode; if (j2 === 0) { extend.firstExtendOnThisSelectorPath = true; } this.allExtendsStack[this.allExtendsStack.length - 1].push(extend); } } this.contexts.push(rulesetNode.selectors); }; ExtendFinderVisitor2.prototype.visitRulesetOut = function(rulesetNode) { if (!rulesetNode.root) { this.contexts.length = this.contexts.length - 1; } }; ExtendFinderVisitor2.prototype.visitMedia = function(mediaNode, visitArgs) { mediaNode.allExtends = []; this.allExtendsStack.push(mediaNode.allExtends); }; ExtendFinderVisitor2.prototype.visitMediaOut = function(mediaNode) { this.allExtendsStack.length = this.allExtendsStack.length - 1; }; ExtendFinderVisitor2.prototype.visitAtRule = function(atRuleNode, visitArgs) { atRuleNode.allExtends = []; this.allExtendsStack.push(atRuleNode.allExtends); }; ExtendFinderVisitor2.prototype.visitAtRuleOut = function(atRuleNode) { this.allExtendsStack.length = this.allExtendsStack.length - 1; }; return ExtendFinderVisitor2; })() ); var ProcessExtendsVisitor = ( /** @class */ (function() { function ProcessExtendsVisitor2() { this._visitor = new Visitor(this); } ProcessExtendsVisitor2.prototype.run = function(root2) { var extendFinder = new ExtendFinderVisitor(); this.extendIndices = {}; extendFinder.run(root2); if (!extendFinder.foundExtends) { return root2; } root2.allExtends = root2.allExtends.concat(this.doExtendChaining(root2.allExtends, root2.allExtends)); this.allExtendsStack = [root2.allExtends]; var newRoot = this._visitor.visit(root2); this.checkExtendsForNonMatched(root2.allExtends); return newRoot; }; ProcessExtendsVisitor2.prototype.checkExtendsForNonMatched = function(extendList) { var indices = this.extendIndices; extendList.filter(function(extend) { return !extend.hasFoundMatches && extend.parent_ids.length == 1; }).forEach(function(extend) { var selector = "_unknown_"; try { selector = extend.selector.toCSS({}); } catch (_2) { } if (!indices["".concat(extend.index, " ").concat(selector)]) { indices["".concat(extend.index, " ").concat(selector)] = true; logger$1.warn("WARNING: extend '".concat(selector, "' has no matches")); } }); }; ProcessExtendsVisitor2.prototype.doExtendChaining = function(extendsList, extendsListTarget, iterationCount) { var extendIndex; var targetExtendIndex; var matches; var extendsToAdd = []; var newSelector; var extendVisitor = this; var selectorPath; var extend; var targetExtend; var newExtend; iterationCount = iterationCount || 0; for (extendIndex = 0; extendIndex < extendsList.length; extendIndex++) { for (targetExtendIndex = 0; targetExtendIndex < extendsListTarget.length; targetExtendIndex++) { extend = extendsList[extendIndex]; targetExtend = extendsListTarget[targetExtendIndex]; if (extend.parent_ids.indexOf(targetExtend.object_id) >= 0) { continue; } selectorPath = [targetExtend.selfSelectors[0]]; matches = extendVisitor.findMatch(extend, selectorPath); if (matches.length) { extend.hasFoundMatches = true; extend.selfSelectors.forEach(function(selfSelector) { var info = targetExtend.visibilityInfo(); newSelector = extendVisitor.extendSelector(matches, selectorPath, selfSelector, extend.isVisible()); newExtend = new tree.Extend(targetExtend.selector, targetExtend.option, 0, targetExtend.fileInfo(), info); newExtend.selfSelectors = newSelector; newSelector[newSelector.length - 1].extendList = [newExtend]; extendsToAdd.push(newExtend); newExtend.ruleset = targetExtend.ruleset; newExtend.parent_ids = newExtend.parent_ids.concat(targetExtend.parent_ids, extend.parent_ids); if (targetExtend.firstExtendOnThisSelectorPath) { newExtend.firstExtendOnThisSelectorPath = true; targetExtend.ruleset.paths.push(newSelector); } }); } } } if (extendsToAdd.length) { this.extendChainCount++; if (iterationCount > 100) { var selectorOne = "{unable to calculate}"; var selectorTwo = "{unable to calculate}"; try { selectorOne = extendsToAdd[0].selfSelectors[0].toCSS(); selectorTwo = extendsToAdd[0].selector.toCSS(); } catch (e2) { } throw { message: "extend circular reference detected. One of the circular extends is currently:".concat(selectorOne, ":extend(").concat(selectorTwo, ")") }; } return extendsToAdd.concat(extendVisitor.doExtendChaining(extendsToAdd, extendsListTarget, iterationCount + 1)); } else { return extendsToAdd; } }; ProcessExtendsVisitor2.prototype.visitDeclaration = function(ruleNode, visitArgs) { visitArgs.visitDeeper = false; }; ProcessExtendsVisitor2.prototype.visitMixinDefinition = function(mixinDefinitionNode, visitArgs) { visitArgs.visitDeeper = false; }; ProcessExtendsVisitor2.prototype.visitSelector = function(selectorNode, visitArgs) { visitArgs.visitDeeper = false; }; ProcessExtendsVisitor2.prototype.visitRuleset = function(rulesetNode, visitArgs) { if (rulesetNode.root) { return; } var matches; var pathIndex; var extendIndex; var allExtends = this.allExtendsStack[this.allExtendsStack.length - 1]; var selectorsToAdd = []; var extendVisitor = this; var selectorPath; for (extendIndex = 0; extendIndex < allExtends.length; extendIndex++) { for (pathIndex = 0; pathIndex < rulesetNode.paths.length; pathIndex++) { selectorPath = rulesetNode.paths[pathIndex]; if (rulesetNode.extendOnEveryPath) { continue; } var extendList = selectorPath[selectorPath.length - 1].extendList; if (extendList && extendList.length) { continue; } matches = this.findMatch(allExtends[extendIndex], selectorPath); if (matches.length) { allExtends[extendIndex].hasFoundMatches = true; allExtends[extendIndex].selfSelectors.forEach(function(selfSelector) { var extendedSelectors; extendedSelectors = extendVisitor.extendSelector(matches, selectorPath, selfSelector, allExtends[extendIndex].isVisible()); selectorsToAdd.push(extendedSelectors); }); } } } rulesetNode.paths = rulesetNode.paths.concat(selectorsToAdd); }; ProcessExtendsVisitor2.prototype.findMatch = function(extend, haystackSelectorPath) { var haystackSelectorIndex; var hackstackSelector; var hackstackElementIndex; var haystackElement; var targetCombinator; var i; var extendVisitor = this; var needleElements = extend.selector.elements; var potentialMatches = []; var potentialMatch; var matches = []; for (haystackSelectorIndex = 0; haystackSelectorIndex < haystackSelectorPath.length; haystackSelectorIndex++) { hackstackSelector = haystackSelectorPath[haystackSelectorIndex]; for (hackstackElementIndex = 0; hackstackElementIndex < hackstackSelector.elements.length; hackstackElementIndex++) { haystackElement = hackstackSelector.elements[hackstackElementIndex]; if (extend.allowBefore || haystackSelectorIndex === 0 && hackstackElementIndex === 0) { potentialMatches.push({ pathIndex: haystackSelectorIndex, index: hackstackElementIndex, matched: 0, initialCombinator: haystackElement.combinator }); } for (i = 0; i < potentialMatches.length; i++) { potentialMatch = potentialMatches[i]; targetCombinator = haystackElement.combinator.value; if (targetCombinator === "" && hackstackElementIndex === 0) { targetCombinator = " "; } if (!extendVisitor.isElementValuesEqual(needleElements[potentialMatch.matched].value, haystackElement.value) || potentialMatch.matched > 0 && needleElements[potentialMatch.matched].combinator.value !== targetCombinator) { potentialMatch = null; } else { potentialMatch.matched++; } if (potentialMatch) { potentialMatch.finished = potentialMatch.matched === needleElements.length; if (potentialMatch.finished && (!extend.allowAfter && (hackstackElementIndex + 1 < hackstackSelector.elements.length || haystackSelectorIndex + 1 < haystackSelectorPath.length))) { potentialMatch = null; } } if (potentialMatch) { if (potentialMatch.finished) { potentialMatch.length = needleElements.length; potentialMatch.endPathIndex = haystackSelectorIndex; potentialMatch.endPathElementIndex = hackstackElementIndex + 1; potentialMatches.length = 0; matches.push(potentialMatch); } } else { potentialMatches.splice(i, 1); i--; } } } } return matches; }; ProcessExtendsVisitor2.prototype.isElementValuesEqual = function(elementValue1, elementValue2) { if (typeof elementValue1 === "string" || typeof elementValue2 === "string") { return elementValue1 === elementValue2; } if (elementValue1 instanceof tree.Attribute) { if (elementValue1.op !== elementValue2.op || elementValue1.key !== elementValue2.key) { return false; } if (!elementValue1.value || !elementValue2.value) { if (elementValue1.value || elementValue2.value) { return false; } return true; } elementValue1 = elementValue1.value.value || elementValue1.value; elementValue2 = elementValue2.value.value || elementValue2.value; return elementValue1 === elementValue2; } elementValue1 = elementValue1.value; elementValue2 = elementValue2.value; if (elementValue1 instanceof tree.Selector) { if (!(elementValue2 instanceof tree.Selector) || elementValue1.elements.length !== elementValue2.elements.length) { return false; } for (var i_1 = 0; i_1 < elementValue1.elements.length; i_1++) { if (elementValue1.elements[i_1].combinator.value !== elementValue2.elements[i_1].combinator.value) { if (i_1 !== 0 || (elementValue1.elements[i_1].combinator.value || " ") !== (elementValue2.elements[i_1].combinator.value || " ")) { return false; } } if (!this.isElementValuesEqual(elementValue1.elements[i_1].value, elementValue2.elements[i_1].value)) { return false; } } return true; } return false; }; ProcessExtendsVisitor2.prototype.extendSelector = function(matches, selectorPath, replacementSelector, isVisible) { var currentSelectorPathIndex = 0, currentSelectorPathElementIndex = 0, path = [], matchIndex, selector, firstElement, match, newElements; for (matchIndex = 0; matchIndex < matches.length; matchIndex++) { match = matches[matchIndex]; selector = selectorPath[match.pathIndex]; firstElement = new tree.Element(match.initialCombinator, replacementSelector.elements[0].value, replacementSelector.elements[0].isVariable, replacementSelector.elements[0].getIndex(), replacementSelector.elements[0].fileInfo()); if (match.pathIndex > currentSelectorPathIndex && currentSelectorPathElementIndex > 0) { path[path.length - 1].elements = path[path.length - 1].elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex)); currentSelectorPathElementIndex = 0; currentSelectorPathIndex++; } newElements = selector.elements.slice(currentSelectorPathElementIndex, match.index).concat([firstElement]).concat(replacementSelector.elements.slice(1)); if (currentSelectorPathIndex === match.pathIndex && matchIndex > 0) { path[path.length - 1].elements = path[path.length - 1].elements.concat(newElements); } else { path = path.concat(selectorPath.slice(currentSelectorPathIndex, match.pathIndex)); path.push(new tree.Selector(newElements)); } currentSelectorPathIndex = match.endPathIndex; currentSelectorPathElementIndex = match.endPathElementIndex; if (currentSelectorPathElementIndex >= selectorPath[currentSelectorPathIndex].elements.length) { currentSelectorPathElementIndex = 0; currentSelectorPathIndex++; } } if (currentSelectorPathIndex < selectorPath.length && currentSelectorPathElementIndex > 0) { path[path.length - 1].elements = path[path.length - 1].elements.concat(selectorPath[currentSelectorPathIndex].elements.slice(currentSelectorPathElementIndex)); currentSelectorPathIndex++; } path = path.concat(selectorPath.slice(currentSelectorPathIndex, selectorPath.length)); path = path.map(function(currentValue) { var derived = currentValue.createDerived(currentValue.elements); if (isVisible) { derived.ensureVisibility(); } else { derived.ensureInvisibility(); } return derived; }); return path; }; ProcessExtendsVisitor2.prototype.visitMedia = function(mediaNode, visitArgs) { var newAllExtends = mediaNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]); newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, mediaNode.allExtends)); this.allExtendsStack.push(newAllExtends); }; ProcessExtendsVisitor2.prototype.visitMediaOut = function(mediaNode) { var lastIndex = this.allExtendsStack.length - 1; this.allExtendsStack.length = lastIndex; }; ProcessExtendsVisitor2.prototype.visitAtRule = function(atRuleNode, visitArgs) { var newAllExtends = atRuleNode.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length - 1]); newAllExtends = newAllExtends.concat(this.doExtendChaining(newAllExtends, atRuleNode.allExtends)); this.allExtendsStack.push(newAllExtends); }; ProcessExtendsVisitor2.prototype.visitAtRuleOut = function(atRuleNode) { var lastIndex = this.allExtendsStack.length - 1; this.allExtendsStack.length = lastIndex; }; return ProcessExtendsVisitor2; })() ); var JoinSelectorVisitor = ( /** @class */ (function() { function JoinSelectorVisitor2() { this.contexts = [[]]; this._visitor = new Visitor(this); } JoinSelectorVisitor2.prototype.run = function(root2) { return this._visitor.visit(root2); }; JoinSelectorVisitor2.prototype.visitDeclaration = function(declNode, visitArgs) { visitArgs.visitDeeper = false; }; JoinSelectorVisitor2.prototype.visitMixinDefinition = function(mixinDefinitionNode, visitArgs) { visitArgs.visitDeeper = false; }; JoinSelectorVisitor2.prototype.visitRuleset = function(rulesetNode, visitArgs) { var context = this.contexts[this.contexts.length - 1]; var paths = []; var selectors; this.contexts.push(paths); if (!rulesetNode.root) { selectors = rulesetNode.selectors; if (selectors) { selectors = selectors.filter(function(selector) { return selector.getIsOutput(); }); rulesetNode.selectors = selectors.length ? selectors : selectors = null; if (selectors) { rulesetNode.joinSelectors(paths, context, selectors); } } if (!selectors) { rulesetNode.rules = null; } rulesetNode.paths = paths; } }; JoinSelectorVisitor2.prototype.visitRulesetOut = function(rulesetNode) { this.contexts.length = this.contexts.length - 1; }; JoinSelectorVisitor2.prototype.visitMedia = function(mediaNode, visitArgs) { var context = this.contexts[this.contexts.length - 1]; mediaNode.rules[0].root = context.length === 0 || context[0].multiMedia; }; JoinSelectorVisitor2.prototype.visitAtRule = function(atRuleNode, visitArgs) { var context = this.contexts[this.contexts.length - 1]; if (atRuleNode.declarations && atRuleNode.declarations.length) { atRuleNode.declarations[0].root = context.length === 0 || context[0].multiMedia; } else if (atRuleNode.rules && atRuleNode.rules.length) { atRuleNode.rules[0].root = atRuleNode.isRooted || context.length === 0 || null; } }; return JoinSelectorVisitor2; })() ); var CSSVisitorUtils = ( /** @class */ (function() { function CSSVisitorUtils2(context) { this._visitor = new Visitor(this); this._context = context; } CSSVisitorUtils2.prototype.containsSilentNonBlockedChild = function(bodyRules) { var rule; if (!bodyRules) { return false; } for (var r = 0; r < bodyRules.length; r++) { rule = bodyRules[r]; if (rule.isSilent && rule.isSilent(this._context) && !rule.blocksVisibility()) { return true; } } return false; }; CSSVisitorUtils2.prototype.keepOnlyVisibleChilds = function(owner) { if (owner && owner.rules) { owner.rules = owner.rules.filter(function(thing) { return thing.isVisible(); }); } }; CSSVisitorUtils2.prototype.isEmpty = function(owner) { return owner && owner.rules ? owner.rules.length === 0 : true; }; CSSVisitorUtils2.prototype.hasVisibleSelector = function(rulesetNode) { return rulesetNode && rulesetNode.paths ? rulesetNode.paths.length > 0 : false; }; CSSVisitorUtils2.prototype.resolveVisibility = function(node) { if (!node.blocksVisibility()) { if (this.isEmpty(node)) { return; } return node; } var compiledRulesBody = node.rules[0]; this.keepOnlyVisibleChilds(compiledRulesBody); if (this.isEmpty(compiledRulesBody)) { return; } node.ensureVisibility(); node.removeVisibilityBlock(); return node; }; CSSVisitorUtils2.prototype.isVisibleRuleset = function(rulesetNode) { if (rulesetNode.firstRoot) { return true; } if (this.isEmpty(rulesetNode)) { return false; } if (!rulesetNode.root && !this.hasVisibleSelector(rulesetNode)) { return false; } return true; }; return CSSVisitorUtils2; })() ); var ToCSSVisitor = function(context) { this._visitor = new Visitor(this); this._context = context; this.utils = new CSSVisitorUtils(context); }; ToCSSVisitor.prototype = { isReplacing: true, run: function(root2) { return this._visitor.visit(root2); }, visitDeclaration: function(declNode, visitArgs) { if (declNode.blocksVisibility() || declNode.variable) { return; } return declNode; }, visitMixinDefinition: function(mixinNode, visitArgs) { mixinNode.frames = []; }, visitExtend: function(extendNode, visitArgs) { }, visitComment: function(commentNode, visitArgs) { if (commentNode.blocksVisibility() || commentNode.isSilent(this._context)) { return; } return commentNode; }, visitMedia: function(mediaNode, visitArgs) { var originalRules = mediaNode.rules[0].rules; mediaNode.accept(this._visitor); visitArgs.visitDeeper = false; return this.utils.resolveVisibility(mediaNode, originalRules); }, visitImport: function(importNode, visitArgs) { if (importNode.blocksVisibility()) { return; } return importNode; }, visitAtRule: function(atRuleNode, visitArgs) { if (atRuleNode.rules && atRuleNode.rules.length) { return this.visitAtRuleWithBody(atRuleNode, visitArgs); } else { return this.visitAtRuleWithoutBody(atRuleNode, visitArgs); } }, visitAnonymous: function(anonymousNode, visitArgs) { if (!anonymousNode.blocksVisibility()) { anonymousNode.accept(this._visitor); return anonymousNode; } }, visitAtRuleWithBody: function(atRuleNode, visitArgs) { function hasFakeRuleset(atRuleNode2) { var bodyRules = atRuleNode2.rules; return bodyRules.length === 1 && (!bodyRules[0].paths || bodyRules[0].paths.length === 0); } function getBodyRules(atRuleNode2) { var nodeRules = atRuleNode2.rules; if (hasFakeRuleset(atRuleNode2)) { return nodeRules[0].rules; } return nodeRules; } var originalRules = getBodyRules(atRuleNode); atRuleNode.accept(this._visitor); visitArgs.visitDeeper = false; if (!this.utils.isEmpty(atRuleNode)) { this._mergeRules(atRuleNode.rules[0].rules); } return this.utils.resolveVisibility(atRuleNode, originalRules); }, visitAtRuleWithoutBody: function(atRuleNode, visitArgs) { if (atRuleNode.blocksVisibility()) { return; } if (atRuleNode.name === "@charset") { if (this.charset) { if (atRuleNode.debugInfo) { var comment = new tree.Comment("/* ".concat(atRuleNode.toCSS(this._context).replace(/\n/g, ""), " */\n")); comment.debugInfo = atRuleNode.debugInfo; return this._visitor.visit(comment); } return; } this.charset = true; } return atRuleNode; }, checkValidNodes: function(rules, isRoot) { if (!rules) { return; } for (var i_1 = 0; i_1 < rules.length; i_1++) { var ruleNode = rules[i_1]; if (isRoot && ruleNode instanceof tree.Declaration && !ruleNode.variable) { throw { message: "Properties must be inside selector blocks. They cannot be in the root", index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename }; } if (ruleNode instanceof tree.Call) { throw { message: "Function '".concat(ruleNode.name, "' did not return a root node"), index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename }; } if (ruleNode.type && !ruleNode.allowRoot) { throw { message: "".concat(ruleNode.type, " node returned by a function is not valid here"), index: ruleNode.getIndex(), filename: ruleNode.fileInfo() && ruleNode.fileInfo().filename }; } } }, visitRuleset: function(rulesetNode, visitArgs) { var rule; var rulesets = []; this.checkValidNodes(rulesetNode.rules, rulesetNode.firstRoot); if (!rulesetNode.root) { this._compileRulesetPaths(rulesetNode); var nodeRules = rulesetNode.rules; var nodeRuleCnt = nodeRules ? nodeRules.length : 0; for (var i_2 = 0; i_2 < nodeRuleCnt; ) { rule = nodeRules[i_2]; if (rule && rule.rules) { rulesets.push(this._visitor.visit(rule)); nodeRules.splice(i_2, 1); nodeRuleCnt--; continue; } i_2++; } if (nodeRuleCnt > 0) { rulesetNode.accept(this._visitor); } else { rulesetNode.rules = null; } visitArgs.visitDeeper = false; } else { rulesetNode.accept(this._visitor); visitArgs.visitDeeper = false; } if (rulesetNode.rules) { this._mergeRules(rulesetNode.rules); this._removeDuplicateRules(rulesetNode.rules); } if (this.utils.isVisibleRuleset(rulesetNode)) { rulesetNode.ensureVisibility(); rulesets.splice(0, 0, rulesetNode); } if (rulesets.length === 1) { return rulesets[0]; } return rulesets; }, _compileRulesetPaths: function(rulesetNode) { if (rulesetNode.paths) { rulesetNode.paths = rulesetNode.paths.filter(function(p2) { var i; if (p2[0].elements[0].combinator.value === " ") { p2[0].elements[0].combinator = new tree.Combinator(""); } for (i = 0; i < p2.length; i++) { if (p2[i].isVisible() && p2[i].getIsOutput()) { return true; } } return false; }); } }, _removeDuplicateRules: function(rules) { if (!rules) { return; } var ruleCache = {}; var ruleList; var rule; var i; for (i = rules.length - 1; i >= 0; i--) { rule = rules[i]; if (rule instanceof tree.Declaration) { if (!ruleCache[rule.name]) { ruleCache[rule.name] = rule; } else { ruleList = ruleCache[rule.name]; if (ruleList instanceof tree.Declaration) { ruleList = ruleCache[rule.name] = [ruleCache[rule.name].toCSS(this._context)]; } var ruleCSS = rule.toCSS(this._context); if (ruleList.indexOf(ruleCSS) !== -1) { rules.splice(i, 1); } else { ruleList.push(ruleCSS); } } } } }, _mergeRules: function(rules) { if (!rules) { return; } var groups = {}; var groupsArr = []; for (var i_3 = 0; i_3 < rules.length; i_3++) { var rule = rules[i_3]; if (rule.merge) { var key2 = rule.name; groups[key2] ? rules.splice(i_3--, 1) : groupsArr.push(groups[key2] = []); groups[key2].push(rule); } } groupsArr.forEach(function(group) { if (group.length > 0) { var result_1 = group[0]; var space_1 = []; var comma_1 = [new tree.Expression(space_1)]; group.forEach(function(rule2) { if (rule2.merge === "+" && space_1.length > 0) { comma_1.push(new tree.Expression(space_1 = [])); } space_1.push(rule2.value); result_1.important = result_1.important || rule2.important; }); result_1.value = new tree.Value(comma_1); } }); } }; var visitors = { Visitor, ImportVisitor, MarkVisibleSelectorsVisitor: SetTreeVisibilityVisitor, ExtendVisitor: ProcessExtendsVisitor, JoinSelectorVisitor, ToCSSVisitor }; var getParserInput = (function() { var input; var j2; var saveStack = []; var furthest; var furthestPossibleErrorMessage; var chunks; var current2; var currentPos; var parserInput = {}; var CHARCODE_SPACE = 32; var CHARCODE_TAB = 9; var CHARCODE_LF = 10; var CHARCODE_CR = 13; var CHARCODE_PLUS = 43; var CHARCODE_COMMA = 44; var CHARCODE_FORWARD_SLASH = 47; var CHARCODE_9 = 57; function skipWhitespace(length) { var oldi = parserInput.i; var oldj = j2; var curr = parserInput.i - currentPos; var endIndex = parserInput.i + current2.length - curr; var mem = parserInput.i += length; var inp = input; var c2; var nextChar; var comment; for (; parserInput.i < endIndex; parserInput.i++) { c2 = inp.charCodeAt(parserInput.i); if (parserInput.autoCommentAbsorb && c2 === CHARCODE_FORWARD_SLASH) { nextChar = inp.charAt(parserInput.i + 1); if (nextChar === "/") { comment = { index: parserInput.i, isLineComment: true }; var nextNewLine = inp.indexOf("\n", parserInput.i + 2); if (nextNewLine < 0) { nextNewLine = endIndex; } parserInput.i = nextNewLine; comment.text = inp.substr(comment.index, parserInput.i - comment.index); parserInput.commentStore.push(comment); continue; } else if (nextChar === "*") { var nextStarSlash = inp.indexOf("*/", parserInput.i + 2); if (nextStarSlash >= 0) { comment = { index: parserInput.i, text: inp.substr(parserInput.i, nextStarSlash + 2 - parserInput.i), isLineComment: false }; parserInput.i += comment.text.length - 1; parserInput.commentStore.push(comment); continue; } } break; } if (c2 !== CHARCODE_SPACE && c2 !== CHARCODE_LF && c2 !== CHARCODE_TAB && c2 !== CHARCODE_CR) { break; } } current2 = current2.slice(length + parserInput.i - mem + curr); currentPos = parserInput.i; if (!current2.length) { if (j2 < chunks.length - 1) { current2 = chunks[++j2]; skipWhitespace(0); return true; } parserInput.finished = true; } return oldi !== parserInput.i || oldj !== j2; } parserInput.save = function() { currentPos = parserInput.i; saveStack.push({ current: current2, i: parserInput.i, j: j2 }); }; parserInput.restore = function(possibleErrorMessage) { if (parserInput.i > furthest || parserInput.i === furthest && possibleErrorMessage && !furthestPossibleErrorMessage) { furthest = parserInput.i; furthestPossibleErrorMessage = possibleErrorMessage; } var state = saveStack.pop(); current2 = state.current; currentPos = parserInput.i = state.i; j2 = state.j; }; parserInput.forget = function() { saveStack.pop(); }; parserInput.isWhitespace = function(offset4) { var pos = parserInput.i + (offset4 || 0); var code = input.charCodeAt(pos); return code === CHARCODE_SPACE || code === CHARCODE_CR || code === CHARCODE_TAB || code === CHARCODE_LF; }; parserInput.$re = function(tok) { if (parserInput.i > currentPos) { current2 = current2.slice(parserInput.i - currentPos); currentPos = parserInput.i; } var m = tok.exec(current2); if (!m) { return null; } skipWhitespace(m[0].length); if (typeof m === "string") { return m; } return m.length === 1 ? m[0] : m; }; parserInput.$char = function(tok) { if (input.charAt(parserInput.i) !== tok) { return null; } skipWhitespace(1); return tok; }; parserInput.$peekChar = function(tok) { if (input.charAt(parserInput.i) !== tok) { return null; } return tok; }; parserInput.$str = function(tok) { var tokLength = tok.length; for (var i_1 = 0; i_1 < tokLength; i_1++) { if (input.charAt(parserInput.i + i_1) !== tok.charAt(i_1)) { return null; } } skipWhitespace(tokLength); return tok; }; parserInput.$quoted = function(loc) { var pos = loc || parserInput.i; var startChar = input.charAt(pos); if (startChar !== "'" && startChar !== '"') { return; } var length = input.length; var currentPosition = pos; for (var i_2 = 1; i_2 + currentPosition < length; i_2++) { var nextChar = input.charAt(i_2 + currentPosition); switch (nextChar) { case "\\": i_2++; continue; case "\r": case "\n": break; case startChar: { var str = input.substr(currentPosition, i_2 + 1); if (!loc && loc !== 0) { skipWhitespace(i_2 + 1); return str; } return [startChar, str]; } } } return null; }; parserInput.$parseUntil = function(tok) { var quote = ""; var returnVal = null; var inComment = false; var blockDepth = 0; var blockStack = []; var parseGroups = []; var length = input.length; var startPos = parserInput.i; var lastPos = parserInput.i; var i = parserInput.i; var loop = true; var testChar; if (typeof tok === "string") { testChar = function(char) { return char === tok; }; } else { testChar = function(char) { return tok.test(char); }; } do { var nextChar = input.charAt(i); if (blockDepth === 0 && testChar(nextChar)) { returnVal = input.substr(lastPos, i - lastPos); if (returnVal) { parseGroups.push(returnVal); } else { parseGroups.push(" "); } returnVal = parseGroups; skipWhitespace(i - startPos); loop = false; } else { if (inComment) { if (nextChar === "*" && input.charAt(i + 1) === "/") { i++; blockDepth--; inComment = false; } i++; continue; } switch (nextChar) { case "\\": i++; nextChar = input.charAt(i); parseGroups.push(input.substr(lastPos, i - lastPos + 1)); lastPos = i + 1; break; case "/": if (input.charAt(i + 1) === "*") { i++; inComment = true; blockDepth++; } break; case "'": case '"': quote = parserInput.$quoted(i); if (quote) { parseGroups.push(input.substr(lastPos, i - lastPos), quote); i += quote[1].length - 1; lastPos = i + 1; } else { skipWhitespace(i - startPos); returnVal = nextChar; loop = false; } break; case "{": blockStack.push("}"); blockDepth++; break; case "(": blockStack.push(")"); blockDepth++; break; case "[": blockStack.push("]"); blockDepth++; break; case "}": case ")": case "]": { var expected = blockStack.pop(); if (nextChar === expected) { blockDepth--; } else { skipWhitespace(i - startPos); returnVal = expected; loop = false; } } } i++; if (i > length) { loop = false; } } } while (loop); return returnVal ? returnVal : null; }; parserInput.autoCommentAbsorb = true; parserInput.commentStore = []; parserInput.finished = false; parserInput.peek = function(tok) { if (typeof tok === "string") { for (var i_3 = 0; i_3 < tok.length; i_3++) { if (input.charAt(parserInput.i + i_3) !== tok.charAt(i_3)) { return false; } } return true; } else { return tok.test(current2); } }; parserInput.peekChar = function(tok) { return input.charAt(parserInput.i) === tok; }; parserInput.currentChar = function() { return input.charAt(parserInput.i); }; parserInput.prevChar = function() { return input.charAt(parserInput.i - 1); }; parserInput.getInput = function() { return input; }; parserInput.peekNotNumeric = function() { var c2 = input.charCodeAt(parserInput.i); return c2 > CHARCODE_9 || c2 < CHARCODE_PLUS || c2 === CHARCODE_FORWARD_SLASH || c2 === CHARCODE_COMMA; }; parserInput.start = function(str) { input = str; parserInput.i = j2 = currentPos = furthest = 0; chunks = [str]; current2 = chunks[0]; skipWhitespace(0); }; parserInput.end = function() { var message; var isFinished = parserInput.i >= input.length; if (parserInput.i < furthest) { message = furthestPossibleErrorMessage; parserInput.i = furthest; } return { isFinished, furthest: parserInput.i, furthestPossibleErrorMessage: message, furthestReachedEnd: parserInput.i >= input.length - 1, furthestChar: input[parserInput.i] }; }; return parserInput; }); function makeRegistry(base) { return { _data: {}, add: function(name, func) { name = name.toLowerCase(); if (this._data.hasOwnProperty(name)) ; this._data[name] = func; }, addMultiple: function(functions2) { var _this = this; Object.keys(functions2).forEach(function(name) { _this.add(name, functions2[name]); }); }, get: function(name) { return this._data[name] || base && base.get(name); }, getLocalFunctions: function() { return this._data; }, inherit: function() { return makeRegistry(this); }, create: function(base2) { return makeRegistry(base2); } }; } var functionRegistry = makeRegistry(null); var MediaSyntaxOptions = { queryInParens: true }; var ContainerSyntaxOptions = { queryInParens: true }; var Anonymous = function(value, index2, currentFileInfo, mapLines, rulesetLike, visibilityInfo) { this.value = value; this._index = index2; this._fileInfo = currentFileInfo; this.mapLines = mapLines; this.rulesetLike = typeof rulesetLike === "undefined" ? false : rulesetLike; this.allowRoot = true; this.copyVisibilityInfo(visibilityInfo); }; Anonymous.prototype = Object.assign(new Node2(), { type: "Anonymous", eval: function() { return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo()); }, compare: function(other) { return other.toCSS && this.toCSS() === other.toCSS() ? 0 : void 0; }, isRulesetLike: function() { return this.rulesetLike; }, genCSS: function(context, output) { this.nodeVisible = Boolean(this.value); if (this.nodeVisible) { output.add(this.value, this._fileInfo, this._index, this.mapLines); } } }); var Parser = function Parser2(context, imports, fileInfo, currentIndex) { currentIndex = currentIndex || 0; var parsers; var parserInput = getParserInput(); function error(msg, type) { throw new LessError({ index: parserInput.i, filename: fileInfo.filename, type: type || "Syntax", message: msg }, imports); } function warn(msg, index2, type) { if (!context.quiet) { logger$1.warn(new LessError({ index: index2 !== null && index2 !== void 0 ? index2 : parserInput.i, filename: fileInfo.filename, type: type ? "".concat(type.toUpperCase(), " WARNING") : "WARNING", message: msg }, imports).toString()); } } function expect(arg, msg) { var result = arg instanceof Function ? arg.call(parsers) : parserInput.$re(arg); if (result) { return result; } error(msg || (typeof arg === "string" ? "expected '".concat(arg, "' got '").concat(parserInput.currentChar(), "'") : "unexpected token")); } function expectChar(arg, msg) { if (parserInput.$char(arg)) { return arg; } error(msg || "expected '".concat(arg, "' got '").concat(parserInput.currentChar(), "'")); } function getDebugInfo(index2) { var filename = fileInfo.filename; return { lineNumber: getLocation(index2, parserInput.getInput()).line + 1, fileName: filename }; } function parseNode(str, parseList, callback) { var result; var returnNodes = []; var parser2 = parserInput; try { parser2.start(str); for (var x2 = 0, p2 = void 0; p2 = parseList[x2]; x2++) { result = parsers[p2](); returnNodes.push(result || null); } var endInfo = parser2.end(); if (endInfo.isFinished) { callback(null, returnNodes); } else { callback(true, null); } } catch (e2) { throw new LessError({ index: e2.index + currentIndex, message: e2.message }, imports, fileInfo.filename); } } return { parserInput, imports, fileInfo, parseNode, // // Parse an input string into an abstract syntax tree, // @param str A string containing 'less' markup // @param callback call `callback` when done. // @param [additionalData] An optional map which can contains vars - a map (key, value) of variables to apply // parse: function(str, callback, additionalData) { var root2; var err = null; var globalVars; var modifyVars; var ignored; var preText = ""; if (additionalData && additionalData.disablePluginRule) { parsers.plugin = function() { var dir = parserInput.$re(/^@plugin?\s+/); if (dir) { error("@plugin statements are not allowed when disablePluginRule is set to true"); } }; } globalVars = additionalData && additionalData.globalVars ? "".concat(Parser2.serializeVars(additionalData.globalVars), "\n") : ""; modifyVars = additionalData && additionalData.modifyVars ? "\n".concat(Parser2.serializeVars(additionalData.modifyVars)) : ""; if (context.pluginManager) { var preProcessors = context.pluginManager.getPreProcessors(); for (var i_1 = 0; i_1 < preProcessors.length; i_1++) { str = preProcessors[i_1].process(str, { context, imports, fileInfo }); } } if (globalVars || additionalData && additionalData.banner) { preText = (additionalData && additionalData.banner ? additionalData.banner : "") + globalVars; ignored = imports.contentsIgnoredChars; ignored[fileInfo.filename] = ignored[fileInfo.filename] || 0; ignored[fileInfo.filename] += preText.length; } str = str.replace(/\r\n?/g, "\n"); str = preText + str.replace(/^\uFEFF/, "") + modifyVars; imports.contents[fileInfo.filename] = str; try { parserInput.start(str); tree.Node.prototype.parse = this; root2 = new tree.Ruleset(null, this.parsers.primary()); tree.Node.prototype.rootNode = root2; root2.root = true; root2.firstRoot = true; root2.functionRegistry = functionRegistry.inherit(); } catch (e2) { return callback(new LessError(e2, imports, fileInfo.filename)); } var endInfo = parserInput.end(); if (!endInfo.isFinished) { var message = endInfo.furthestPossibleErrorMessage; if (!message) { message = "Unrecognised input"; if (endInfo.furthestChar === "}") { message += ". Possibly missing opening '{'"; } else if (endInfo.furthestChar === ")") { message += ". Possibly missing opening '('"; } else if (endInfo.furthestReachedEnd) { message += ". Possibly missing something"; } } err = new LessError({ type: "Parse", message, index: endInfo.furthest, filename: fileInfo.filename }, imports); } var finish = function(e2) { e2 = err || e2 || imports.error; if (e2) { if (!(e2 instanceof LessError)) { e2 = new LessError(e2, imports, fileInfo.filename); } return callback(e2); } else { return callback(null, root2); } }; if (context.processImports !== false) { new visitors.ImportVisitor(imports, finish).run(root2); } else { return finish(); } }, // // Here in, the parsing rules/functions // // The basic structure of the syntax tree generated is as follows: // // Ruleset -> Declaration -> Value -> Expression -> Entity // // Here's some Less code: // // .class { // color: #fff; // border: 1px solid #000; // width: @w + 4px; // > .child {...} // } // // And here's what the parse tree might look like: // // Ruleset (Selector '.class', [ // Declaration ("color", Value ([Expression [Color #fff]])) // Declaration ("border", Value ([Expression [Dimension 1px][Keyword "solid"][Color #000]])) // Declaration ("width", Value ([Expression [Operation " + " [Variable "@w"][Dimension 4px]]])) // Ruleset (Selector [Element '>', '.child'], [...]) // ]) // // In general, most rules will try to parse a token with the `$re()` function, and if the return // value is truly, will return a new node, of the relevant type. Sometimes, we need to check // first, before parsing, that's when we use `peek()`. // parsers: parsers = { // // The `primary` rule is the *entry* and *exit* point of the parser. // The rules here can appear at any level of the parse tree. // // The recursive nature of the grammar is an interplay between the `block` // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule, // as represented by this simplified grammar: // // primary → (ruleset | declaration)+ // ruleset → selector+ block // block → '{' primary '}' // // Only at one point is the primary rule not called from the // block rule: at the root level. // primary: function() { var mixin = this.mixin; var root2 = []; var node; while (true) { while (true) { node = this.comment(); if (!node) { break; } root2.push(node); } if (parserInput.finished) { break; } if (parserInput.peek("}")) { break; } node = this.extendRule(); if (node) { root2 = root2.concat(node); continue; } node = mixin.definition() || this.declaration() || mixin.call(false, false) || this.ruleset() || this.variableCall() || this.entities.call() || this.atrule(); if (node) { root2.push(node); } else { var foundSemiColon = false; while (parserInput.$char(";")) { foundSemiColon = true; } if (!foundSemiColon) { break; } } } return root2; }, // comments are collected by the main parsing mechanism and then assigned to nodes // where the current structure allows it comment: function() { if (parserInput.commentStore.length) { var comment = parserInput.commentStore.shift(); return new tree.Comment(comment.text, comment.isLineComment, comment.index + currentIndex, fileInfo); } }, // // Entities are tokens which can be found inside an Expression // entities: { mixinLookup: function() { return parsers.mixin.call(true, true); }, // // A string, which supports escaping " and ' // // "milky way" 'he\'s the one!' // quoted: function(forceEscaped) { var str; var index2 = parserInput.i; var isEscaped = false; parserInput.save(); if (parserInput.$char("~")) { isEscaped = true; } else if (forceEscaped) { parserInput.restore(); return; } str = parserInput.$quoted(); if (!str) { parserInput.restore(); return; } parserInput.forget(); return new tree.Quoted(str.charAt(0), str.substr(1, str.length - 2), isEscaped, index2 + currentIndex, fileInfo); }, // // A catch-all word, such as: // // black border-collapse // keyword: function() { var k2 = parserInput.$char("%") || parserInput.$re(/^\[?(?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+\]?/); if (k2) { return tree.Color.fromKeyword(k2) || new tree.Keyword(k2); } }, // // A function call // // rgb(255, 0, 255) // // The arguments are parsed with the `entities.arguments` parser. // call: function() { var name; var args; var func; var index2 = parserInput.i; if (parserInput.peek(/^url\(/i)) { return; } parserInput.save(); name = parserInput.$re(/^([\w-]+|%|~|progid:[\w.]+)\(/); if (!name) { parserInput.forget(); return; } name = name[1]; func = this.customFuncCall(name); if (func) { args = func.parse(); if (args && func.stop) { parserInput.forget(); return args; } } args = this.arguments(args); if (!parserInput.$char(")")) { parserInput.restore("Could not parse call arguments or missing ')'"); return; } parserInput.forget(); return new tree.Call(name, args, index2 + currentIndex, fileInfo); }, declarationCall: function() { var validCall; var args; var index2 = parserInput.i; parserInput.save(); validCall = parserInput.$re(/^[\w]+\(/); if (!validCall) { parserInput.forget(); return; } validCall = validCall.substring(0, validCall.length - 1); var rule = this.ruleProperty(); var value; if (rule) { value = this.value(); } if (rule && value) { args = [new tree.Declaration(rule, value, null, null, parserInput.i + currentIndex, fileInfo, true)]; } if (!parserInput.$char(")")) { parserInput.restore("Could not parse call arguments or missing ')'"); return; } parserInput.forget(); return new tree.Call(validCall, args, index2 + currentIndex, fileInfo); }, // // Parsing rules for functions with non-standard args, e.g.: // // boolean(not(2 > 1)) // // This is a quick prototype, to be modified/improved when // more custom-parsed funcs come (e.g. `selector(...)`) // customFuncCall: function(name) { return { alpha: f2(parsers.ieAlpha, true), boolean: f2(condition), "if": f2(condition) }[name.toLowerCase()]; function f2(parse3, stop) { return { parse: parse3, stop // when true - stop after parse() and return its result, // otherwise continue for plain args }; } function condition() { return [expect(parsers.condition, "expected condition")]; } }, arguments: function(prevArgs) { var argsComma = prevArgs || []; var argsSemiColon = []; var isSemiColonSeparated; var value; parserInput.save(); while (true) { if (prevArgs) { prevArgs = false; } else { value = parsers.detachedRuleset() || this.assignment() || parsers.expression(); if (!value) { break; } if (value.value && value.value.length == 1) { value = value.value[0]; } argsComma.push(value); } if (parserInput.$char(",")) { continue; } if (parserInput.$char(";") || isSemiColonSeparated) { isSemiColonSeparated = true; value = argsComma.length < 1 ? argsComma[0] : new tree.Value(argsComma); argsSemiColon.push(value); argsComma = []; } } parserInput.forget(); return isSemiColonSeparated ? argsSemiColon : argsComma; }, literal: function() { return this.dimension() || this.color() || this.quoted() || this.unicodeDescriptor(); }, // Assignments are argument entities for calls. // They are present in ie filter properties as shown below. // // filter: progid:DXImageTransform.Microsoft.Alpha( *opacity=50* ) // assignment: function() { var key2; var value; parserInput.save(); key2 = parserInput.$re(/^\w+(?=\s?=)/i); if (!key2) { parserInput.restore(); return; } if (!parserInput.$char("=")) { parserInput.restore(); return; } value = parsers.entity(); if (value) { parserInput.forget(); return new tree.Assignment(key2, value); } else { parserInput.restore(); } }, // // Parse url() tokens // // We use a specific rule for urls, because they don't really behave like // standard function calls. The difference is that the argument doesn't have // to be enclosed within a string, so it can't be parsed as an Expression. // url: function() { var value; var index2 = parserInput.i; parserInput.autoCommentAbsorb = false; if (!parserInput.$str("url(")) { parserInput.autoCommentAbsorb = true; return; } value = this.quoted() || this.variable() || this.property() || parserInput.$re(/^(?:(?:\\[()'"])|[^()'"])+/) || ""; parserInput.autoCommentAbsorb = true; expectChar(")"); return new tree.URL(value.value !== void 0 || value instanceof tree.Variable || value instanceof tree.Property ? value : new tree.Anonymous(value, index2), index2 + currentIndex, fileInfo); }, // // A Variable entity, such as `@fink`, in // // width: @fink + 2px // // We use a different parser for variable definitions, // see `parsers.variable`. // variable: function() { var ch; var name; var index2 = parserInput.i; parserInput.save(); if (parserInput.currentChar() === "@" && (name = parserInput.$re(/^@@?[\w-]+/))) { ch = parserInput.currentChar(); if (ch === "(" || ch === "[" && !parserInput.prevChar().match(/^\s/)) { var result = parsers.variableCall(name); if (result) { parserInput.forget(); return result; } } parserInput.forget(); return new tree.Variable(name, index2 + currentIndex, fileInfo); } parserInput.restore(); }, // A variable entity using the protective {} e.g. @{var} variableCurly: function() { var curly; var index2 = parserInput.i; if (parserInput.currentChar() === "@" && (curly = parserInput.$re(/^@\{([\w-]+)\}/))) { return new tree.Variable("@".concat(curly[1]), index2 + currentIndex, fileInfo); } }, // // A Property accessor, such as `$color`, in // // background-color: $color // property: function() { var name; var index2 = parserInput.i; if (parserInput.currentChar() === "$" && (name = parserInput.$re(/^\$[\w-]+/))) { return new tree.Property(name, index2 + currentIndex, fileInfo); } }, // A property entity useing the protective {} e.g. ${prop} propertyCurly: function() { var curly; var index2 = parserInput.i; if (parserInput.currentChar() === "$" && (curly = parserInput.$re(/^\$\{([\w-]+)\}/))) { return new tree.Property("$".concat(curly[1]), index2 + currentIndex, fileInfo); } }, // // A Hexadecimal color // // #4F3C2F // // `rgb` and `hsl` colors are parsed through the `entities.call` parser. // color: function() { var rgb; parserInput.save(); if (parserInput.currentChar() === "#" && (rgb = parserInput.$re(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})([\w.#[])?/))) { if (!rgb[2]) { parserInput.forget(); return new tree.Color(rgb[1], void 0, rgb[0]); } } parserInput.restore(); }, colorKeyword: function() { parserInput.save(); var autoCommentAbsorb = parserInput.autoCommentAbsorb; parserInput.autoCommentAbsorb = false; var k2 = parserInput.$re(/^[_A-Za-z-][_A-Za-z0-9-]+/); parserInput.autoCommentAbsorb = autoCommentAbsorb; if (!k2) { parserInput.forget(); return; } parserInput.restore(); var color2 = tree.Color.fromKeyword(k2); if (color2) { parserInput.$str(k2); return color2; } }, // // A Dimension, that is, a number and a unit // // 0.5em 95% // dimension: function() { if (parserInput.peekNotNumeric()) { return; } var value = parserInput.$re(/^([+-]?\d*\.?\d+)(%|[a-z_]+)?/i); if (value) { return new tree.Dimension(value[1], value[2]); } }, // // A unicode descriptor, as is used in unicode-range // // U+0?? or U+00A1-00A9 // unicodeDescriptor: function() { var ud; ud = parserInput.$re(/^U\+[0-9a-fA-F?]+(-[0-9a-fA-F?]+)?/); if (ud) { return new tree.UnicodeDescriptor(ud[0]); } }, // // JavaScript code to be evaluated // // `window.location.href` // javascript: function() { var js; var index2 = parserInput.i; parserInput.save(); var escape2 = parserInput.$char("~"); var jsQuote = parserInput.$char("`"); if (!jsQuote) { parserInput.restore(); return; } js = parserInput.$re(/^[^`]*`/); if (js) { parserInput.forget(); return new tree.JavaScript(js.substr(0, js.length - 1), Boolean(escape2), index2 + currentIndex, fileInfo); } parserInput.restore("invalid javascript definition"); } }, // // The variable part of a variable definition. Used in the `rule` parser // // @fink: // variable: function() { var name; if (parserInput.currentChar() === "@" && (name = parserInput.$re(/^(@[\w-]+)\s*:/))) { return name[1]; } }, // // Call a variable value to retrieve a detached ruleset // or a value from a detached ruleset's rules. // // @fink(); // @fink; // color: @fink[@color]; // variableCall: function(parsedName) { var lookups; var i = parserInput.i; var inValue = !!parsedName; var name = parsedName; parserInput.save(); if (name || parserInput.currentChar() === "@" && (name = parserInput.$re(/^(@[\w-]+)(\(\s*\))?/))) { lookups = this.mixin.ruleLookups(); if (!lookups && (inValue && parserInput.$str("()") !== "()" || name[2] !== "()")) { parserInput.restore("Missing '[...]' lookup in variable call"); return; } if (!inValue) { name = name[1]; } var call = new tree.VariableCall(name, i, fileInfo); if (!inValue && parsers.end()) { parserInput.forget(); return call; } else { parserInput.forget(); return new tree.NamespaceValue(call, lookups, i, fileInfo); } } parserInput.restore(); }, // // extend syntax - used to extend selectors // extend: function(isRule) { var elements; var e2; var index2 = parserInput.i; var option; var extendList; var extend; if (!parserInput.$str(isRule ? "&:extend(" : ":extend(")) { return; } do { option = null; elements = null; var first = true; while (!(option = parserInput.$re(/^(!?all)(?=\s*(\)|,))/))) { e2 = this.element(); if (!e2) { break; } if (!first && e2.combinator.value) { warn("Targeting complex selectors can have unexpected behavior, and this behavior may change in the future.", index2); } first = false; if (elements) { elements.push(e2); } else { elements = [e2]; } } option = option && option[1]; if (!elements) { error("Missing target selector for :extend()."); } extend = new tree.Extend(new tree.Selector(elements), option, index2 + currentIndex, fileInfo); if (extendList) { extendList.push(extend); } else { extendList = [extend]; } } while (parserInput.$char(",")); expect(/^\)/); if (isRule) { expect(/^;/); } return extendList; }, // // extendRule - used in a rule to extend all the parent selectors // extendRule: function() { return this.extend(true); }, // // Mixins // mixin: { // // A Mixin call, with an optional argument list // // #mixins > .square(#fff); // #mixins.square(#fff); // .rounded(4px, black); // .button; // // We can lookup / return a value using the lookup syntax: // // color: #mixin.square(#fff)[@color]; // // The `while` loop is there because mixins can be // namespaced, but we only support the child and descendant // selector for now. // call: function(inValue, getLookup) { var s = parserInput.currentChar(); var important = false; var lookups; var index2 = parserInput.i; var elements; var args; var hasParens; var parensIndex; var parensWS = false; if (s !== "." && s !== "#") { return; } parserInput.save(); elements = this.elements(); if (elements) { parensIndex = parserInput.i; if (parserInput.$char("(")) { parensWS = parserInput.isWhitespace(-2); args = this.args(true).args; expectChar(")"); hasParens = true; if (parensWS) { warn("Whitespace between a mixin name and parentheses for a mixin call is deprecated", parensIndex, "DEPRECATED"); } } if (getLookup !== false) { lookups = this.ruleLookups(); } if (getLookup === true && !lookups) { parserInput.restore(); return; } if (inValue && !lookups && !hasParens) { parserInput.restore(); return; } if (!inValue && parsers.important()) { important = true; } if (inValue || parsers.end()) { parserInput.forget(); var mixin = new tree.mixin.Call(elements, args, index2 + currentIndex, fileInfo, !lookups && important); if (lookups) { return new tree.NamespaceValue(mixin, lookups); } else { if (!hasParens) { warn("Calling a mixin without parentheses is deprecated", parensIndex, "DEPRECATED"); } return mixin; } } } parserInput.restore(); }, /** * Matching elements for mixins * (Start with . or # and can have > ) */ elements: function() { var elements; var e2; var c2; var elem; var elemIndex; var re = /^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/; while (true) { elemIndex = parserInput.i; e2 = parserInput.$re(re); if (!e2) { break; } elem = new tree.Element(c2, e2, false, elemIndex + currentIndex, fileInfo); if (elements) { elements.push(elem); } else { elements = [elem]; } c2 = parserInput.$char(">"); } return elements; }, args: function(isCall) { var entities = parsers.entities; var returner = { args: null, variadic: false }; var expressions = []; var argsSemiColon = []; var argsComma = []; var isSemiColonSeparated; var expressionContainsNamed; var name; var nameLoop; var value; var arg; var expand2; var hasSep = true; parserInput.save(); while (true) { if (isCall) { arg = parsers.detachedRuleset() || parsers.expression(); } else { parserInput.commentStore.length = 0; if (parserInput.$str("...")) { returner.variadic = true; if (parserInput.$char(";") && !isSemiColonSeparated) { isSemiColonSeparated = true; } (isSemiColonSeparated ? argsSemiColon : argsComma).push({ variadic: true }); break; } arg = entities.variable() || entities.property() || entities.literal() || entities.keyword() || this.call(true); } if (!arg || !hasSep) { break; } nameLoop = null; if (arg.throwAwayComments) { arg.throwAwayComments(); } value = arg; var val = null; if (isCall) { if (arg.value && arg.value.length == 1) { val = arg.value[0]; } } else { val = arg; } if (val && (val instanceof tree.Variable || val instanceof tree.Property)) { if (parserInput.$char(":")) { if (expressions.length > 0) { if (isSemiColonSeparated) { error("Cannot mix ; and , as delimiter types"); } expressionContainsNamed = true; } value = parsers.detachedRuleset() || parsers.expression(); if (!value) { if (isCall) { error("could not understand value for named argument"); } else { parserInput.restore(); returner.args = []; return returner; } } nameLoop = name = val.name; } else if (parserInput.$str("...")) { if (!isCall) { returner.variadic = true; if (parserInput.$char(";") && !isSemiColonSeparated) { isSemiColonSeparated = true; } (isSemiColonSeparated ? argsSemiColon : argsComma).push({ name: arg.name, variadic: true }); break; } else { expand2 = true; } } else if (!isCall) { name = nameLoop = val.name; value = null; } } if (value) { expressions.push(value); } argsComma.push({ name: nameLoop, value, expand: expand2 }); if (parserInput.$char(",")) { hasSep = true; continue; } hasSep = parserInput.$char(";") === ";"; if (hasSep || isSemiColonSeparated) { if (expressionContainsNamed) { error("Cannot mix ; and , as delimiter types"); } isSemiColonSeparated = true; if (expressions.length > 1) { value = new tree.Value(expressions); } argsSemiColon.push({ name, value, expand: expand2 }); name = null; expressions = []; expressionContainsNamed = false; } } parserInput.forget(); returner.args = isSemiColonSeparated ? argsSemiColon : argsComma; return returner; }, // // A Mixin definition, with a list of parameters // // .rounded (@radius: 2px, @color) { // ... // } // // Until we have a finer grained state-machine, we have to // do a look-ahead, to make sure we don't have a mixin call. // See the `rule` function for more information. // // We start by matching `.rounded (`, and then proceed on to // the argument list, which has optional default values. // We store the parameters in `params`, with a `value` key, // if there is a value, such as in the case of `@radius`. // // Once we've got our params list, and a closing `)`, we parse // the `{...}` block. // definition: function() { var name; var params = []; var match; var ruleset; var cond; var variadic = false; if (parserInput.currentChar() !== "." && parserInput.currentChar() !== "#" || parserInput.peek(/^[^{]*\}/)) { return; } parserInput.save(); match = parserInput.$re(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/); if (match) { name = match[1]; var argInfo = this.args(false); params = argInfo.args; variadic = argInfo.variadic; if (!parserInput.$char(")")) { parserInput.restore("Missing closing ')'"); return; } parserInput.commentStore.length = 0; if (parserInput.$str("when")) { cond = expect(parsers.conditions, "expected condition"); } ruleset = parsers.block(); if (ruleset) { parserInput.forget(); return new tree.mixin.Definition(name, params, ruleset, cond, variadic); } else { parserInput.restore(); } } else { parserInput.restore(); } }, ruleLookups: function() { var rule; var lookups = []; if (parserInput.currentChar() !== "[") { return; } while (true) { parserInput.save(); rule = this.lookupValue(); if (!rule && rule !== "") { parserInput.restore(); break; } lookups.push(rule); parserInput.forget(); } if (lookups.length > 0) { return lookups; } }, lookupValue: function() { parserInput.save(); if (!parserInput.$char("[")) { parserInput.restore(); return; } var name = parserInput.$re(/^(?:[@$]{0,2})[_a-zA-Z0-9-]*/); if (!parserInput.$char("]")) { parserInput.restore(); return; } if (name || name === "") { parserInput.forget(); return name; } parserInput.restore(); } }, // // Entities are the smallest recognized token, // and can be found inside a rule's value. // entity: function() { var entities = this.entities; return this.comment() || entities.literal() || entities.variable() || entities.url() || entities.property() || entities.call() || entities.keyword() || this.mixin.call(true) || entities.javascript(); }, // // A Declaration terminator. Note that we use `peek()` to check for '}', // because the `block` rule will be expecting it, but we still need to make sure // it's there, if ';' was omitted. // end: function() { return parserInput.$char(";") || parserInput.peek("}"); }, // // IE's alpha function // // alpha(opacity=88) // ieAlpha: function() { var value; if (!parserInput.$re(/^opacity=/i)) { return; } value = parserInput.$re(/^\d+/); if (!value) { value = expect(parsers.entities.variable, "Could not parse alpha"); value = "@{".concat(value.name.slice(1), "}"); } expectChar(")"); return new tree.Quoted("", "alpha(opacity=".concat(value, ")")); }, /** * A Selector Element * * div * + h1 * #socks * input[type="text"] * * Elements are the building blocks for Selectors, * they are made out of a `Combinator` (see combinator rule), * and an element name, such as a tag a class, or `*`. */ element: function() { var e2; var c2; var v2; var index2 = parserInput.i; c2 = this.combinator(); e2 = parserInput.$re(/^(?:\d+\.\d+|\d+)%/) || // eslint-disable-next-line no-control-regex parserInput.$re(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) || parserInput.$char("*") || parserInput.$char("&") || this.attribute() || parserInput.$re(/^\([^&()@]+\)/) || parserInput.$re(/^[.#:](?=@)/) || this.entities.variableCurly(); if (!e2) { parserInput.save(); if (parserInput.$char("(")) { if (v2 = this.selector(false)) { var selectors = []; while (parserInput.$char(",")) { selectors.push(v2); selectors.push(new Anonymous(",")); v2 = this.selector(false); } selectors.push(v2); if (parserInput.$char(")")) { if (selectors.length > 1) { e2 = new tree.Paren(new Selector(selectors)); } else { e2 = new tree.Paren(v2); } parserInput.forget(); } else { parserInput.restore("Missing closing ')'"); } } else { parserInput.restore("Missing closing ')'"); } } else { parserInput.forget(); } } if (e2) { return new tree.Element(c2, e2, e2 instanceof tree.Variable, index2 + currentIndex, fileInfo); } }, // // Combinators combine elements together, in a Selector. // // Because our parser isn't white-space sensitive, special care // has to be taken, when parsing the descendant combinator, ` `, // as it's an empty space. We have to check the previous character // in the input, to see if it's a ` ` character. More info on how // we deal with this in *combinator.js*. // combinator: function() { var c2 = parserInput.currentChar(); if (c2 === "/") { parserInput.save(); var slashedCombinator = parserInput.$re(/^\/[a-z]+\//i); if (slashedCombinator) { parserInput.forget(); return new tree.Combinator(slashedCombinator); } parserInput.restore(); } if (c2 === ">" || c2 === "+" || c2 === "~" || c2 === "|" || c2 === "^") { parserInput.i++; if (c2 === "^" && parserInput.currentChar() === "^") { c2 = "^^"; parserInput.i++; } while (parserInput.isWhitespace()) { parserInput.i++; } return new tree.Combinator(c2); } else if (parserInput.isWhitespace(-1)) { return new tree.Combinator(" "); } else { return new tree.Combinator(null); } }, // // A CSS Selector // with less extensions e.g. the ability to extend and guard // // .class > div + h1 // li a:hover // // Selectors are made out of one or more Elements, see above. // selector: function(isLess) { var index2 = parserInput.i; var elements; var extendList; var c2; var e2; var allExtends; var when; var condition; isLess = isLess !== false; while (isLess && (extendList = this.extend()) || isLess && (when = parserInput.$str("when")) || (e2 = this.element())) { if (when) { condition = expect(this.conditions, "expected condition"); } else if (condition) { error("CSS guard can only be used at the end of selector"); } else if (extendList) { if (allExtends) { allExtends = allExtends.concat(extendList); } else { allExtends = extendList; } } else { if (allExtends) { error("Extend can only be used at the end of selector"); } c2 = parserInput.currentChar(); if (Array.isArray(e2)) { e2.forEach(function(ele) { return elements.push(ele); }); } if (elements) { elements.push(e2); } else { elements = [e2]; } e2 = null; } if (c2 === "{" || c2 === "}" || c2 === ";" || c2 === "," || c2 === ")") { break; } } if (elements) { return new tree.Selector(elements, allExtends, condition, index2 + currentIndex, fileInfo); } if (allExtends) { error("Extend must be used to extend a selector, it cannot be used on its own"); } }, selectors: function() { var s; var selectors; while (true) { s = this.selector(); if (!s) { break; } if (selectors) { selectors.push(s); } else { selectors = [s]; } parserInput.commentStore.length = 0; if (s.condition && selectors.length > 1) { error("Guards are only currently allowed on a single selector."); } if (!parserInput.$char(",")) { break; } if (s.condition) { error("Guards are only currently allowed on a single selector."); } parserInput.commentStore.length = 0; } return selectors; }, attribute: function() { if (!parserInput.$char("[")) { return; } var entities = this.entities; var key2; var val; var op; var cif; if (!(key2 = entities.variableCurly())) { key2 = expect(/^(?:[_A-Za-z0-9-*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/); } op = parserInput.$re(/^[|~*$^]?=/); if (op) { val = entities.quoted() || parserInput.$re(/^[0-9]+%/) || parserInput.$re(/^[\w-]+/) || entities.variableCurly(); if (val) { cif = parserInput.$re(/^[iIsS]/); } } expectChar("]"); return new tree.Attribute(key2, op, val, cif); }, // // The `block` rule is used by `ruleset` and `mixin.definition`. // It's a wrapper around the `primary` rule, with added `{}`. // block: function() { var content; if (parserInput.$char("{") && (content = this.primary()) && parserInput.$char("}")) { return content; } }, blockRuleset: function() { var block2 = this.block(); if (block2) { block2 = new tree.Ruleset(null, block2); } return block2; }, detachedRuleset: function() { var argInfo; var params; var variadic; parserInput.save(); if (parserInput.$re(/^[.#]\(/)) { argInfo = this.mixin.args(false); params = argInfo.args; variadic = argInfo.variadic; if (!parserInput.$char(")")) { parserInput.restore(); return; } } var blockRuleset = this.blockRuleset(); if (blockRuleset) { parserInput.forget(); if (params) { return new tree.mixin.Definition(null, params, blockRuleset, null, variadic); } return new tree.DetachedRuleset(blockRuleset); } parserInput.restore(); }, // // div, .class, body > p {...} // ruleset: function() { var selectors; var rules; var debugInfo2; parserInput.save(); if (context.dumpLineNumbers) { debugInfo2 = getDebugInfo(parserInput.i); } selectors = this.selectors(); if (selectors && (rules = this.block())) { parserInput.forget(); var ruleset = new tree.Ruleset(selectors, rules, context.strictImports); if (context.dumpLineNumbers) { ruleset.debugInfo = debugInfo2; } return ruleset; } else { parserInput.restore(); } }, declaration: function() { var name; var value; var index2 = parserInput.i; var hasDR; var c2 = parserInput.currentChar(); var important; var merge2; var isVariable; if (c2 === "." || c2 === "#" || c2 === "&" || c2 === ":") { return; } parserInput.save(); name = this.variable() || this.ruleProperty(); if (name) { isVariable = typeof name === "string"; if (isVariable) { value = this.detachedRuleset(); if (value) { hasDR = true; } } parserInput.commentStore.length = 0; if (!value) { merge2 = !isVariable && name.length > 1 && name.pop().value; if (name[0].value && name[0].value.slice(0, 2) === "--") { if (parserInput.$char(";")) { value = new Anonymous(""); } else { value = this.permissiveValue(/[;}]/, true); } } else { value = this.anonymousValue(); } if (value) { parserInput.forget(); return new tree.Declaration(name, value, false, merge2, index2 + currentIndex, fileInfo); } if (!value) { value = this.value(); } if (value) { important = this.important(); } else if (isVariable) { value = this.permissiveValue(); } } if (value && (this.end() || hasDR)) { parserInput.forget(); return new tree.Declaration(name, value, important, merge2, index2 + currentIndex, fileInfo); } else { parserInput.restore(); } } else { parserInput.restore(); } }, anonymousValue: function() { var index2 = parserInput.i; var match = parserInput.$re(/^([^.#@$+/'"*`(;{}-]*);/); if (match) { return new tree.Anonymous(match[1], index2 + currentIndex); } }, /** * Used for custom properties, at-rules, and variables (as fallback) * Parses almost anything inside of {} [] () "" blocks * until it reaches outer-most tokens. * * First, it will try to parse comments and entities to reach * the end. This is mostly like the Expression parser except no * math is allowed. * * @param {RexExp} untilTokens - Characters to stop parsing at */ permissiveValue: function(untilTokens) { var i; var e2; var done; var value; var tok = untilTokens || ";"; var index2 = parserInput.i; var result = []; function testCurrentChar() { var char = parserInput.currentChar(); if (typeof tok === "string") { return char === tok; } else { return tok.test(char); } } if (testCurrentChar()) { return; } value = []; do { e2 = this.comment(); if (e2) { value.push(e2); continue; } e2 = this.entity(); if (e2) { value.push(e2); } if (parserInput.peek(",")) { value.push(new tree.Anonymous(",", parserInput.i)); parserInput.$char(","); } } while (e2); done = testCurrentChar(); if (value.length > 0) { value = new tree.Expression(value); if (done) { return value; } else { result.push(value); } if (parserInput.prevChar() === " ") { result.push(new tree.Anonymous(" ", index2)); } } parserInput.save(); value = parserInput.$parseUntil(tok); if (value) { if (typeof value === "string") { error("Expected '".concat(value, "'"), "Parse"); } if (value.length === 1 && value[0] === " ") { parserInput.forget(); return new tree.Anonymous("", index2); } var item = void 0; for (i = 0; i < value.length; i++) { item = value[i]; if (Array.isArray(item)) { result.push(new tree.Quoted(item[0], item[1], true, index2, fileInfo)); } else { if (i === value.length - 1) { item = item.trim(); } var quote = new tree.Quoted("'", item, true, index2, fileInfo); var variableRegex = /@([\w-]+)/g; var propRegex = /\$([\w-]+)/g; if (variableRegex.test(item)) { warn("@[ident] in unknown values will not be evaluated as variables in the future. Use @{[ident]}", index2, "DEPRECATED"); } if (propRegex.test(item)) { warn("$[ident] in unknown values will not be evaluated as property references in the future. Use ${[ident]}", index2, "DEPRECATED"); } quote.variableRegex = /@([\w-]+)|@{([\w-]+)}/g; quote.propRegex = /\$([\w-]+)|\${([\w-]+)}/g; result.push(quote); } } parserInput.forget(); return new tree.Expression(result, true); } parserInput.restore(); }, // // An @import atrule // // @import "lib"; // // Depending on our environment, importing is done differently: // In the browser, it's an XHR request, in Node, it would be a // file-system operation. The function used for importing is // stored in `import`, which we pass to the Import constructor. // "import": function() { var path; var features; var index2 = parserInput.i; var dir = parserInput.$re(/^@import\s+/); if (dir) { var options3 = (dir ? this.importOptions() : null) || {}; if (path = this.entities.quoted() || this.entities.url()) { features = this.mediaFeatures({}); if (!parserInput.$char(";")) { parserInput.i = index2; error("missing semi-colon or unrecognised media features on import"); } features = features && new tree.Value(features); return new tree.Import(path, features, options3, index2 + currentIndex, fileInfo); } else { parserInput.i = index2; error("malformed import statement"); } } }, importOptions: function() { var o; var options3 = {}; var optionName; var value; if (!parserInput.$char("(")) { return null; } do { o = this.importOption(); if (o) { optionName = o; value = true; switch (optionName) { case "css": optionName = "less"; value = false; break; case "once": optionName = "multiple"; value = false; break; } options3[optionName] = value; if (!parserInput.$char(",")) { break; } } } while (o); expectChar(")"); return options3; }, importOption: function() { var opt = parserInput.$re(/^(less|css|multiple|once|inline|reference|optional)/); if (opt) { return opt[1]; } }, mediaFeature: function(syntaxOptions) { var entities = this.entities; var nodes = []; var e2; var p2; var rangeP; var spacing = false; parserInput.save(); do { parserInput.save(); if (parserInput.$re(/^[0-9a-z-]*\s+\(/)) { spacing = true; } parserInput.restore(); e2 = entities.declarationCall.bind(this)() || entities.keyword() || entities.variable() || entities.mixinLookup(); if (e2) { nodes.push(e2); } else if (parserInput.$char("(")) { p2 = this.property(); parserInput.save(); if (!p2 && syntaxOptions.queryInParens && parserInput.$re(/^[0-9a-z-]*\s*([<>]=|<=|>=|[<>]|=)/)) { parserInput.restore(); p2 = this.condition(); parserInput.save(); rangeP = this.atomicCondition(null, p2.rvalue); if (!rangeP) { parserInput.restore(); } } else { parserInput.restore(); e2 = this.value(); } if (parserInput.$char(")")) { if (p2 && !e2) { nodes.push(new tree.Paren(new tree.QueryInParens(p2.op, p2.lvalue, p2.rvalue, rangeP ? rangeP.op : null, rangeP ? rangeP.rvalue : null, p2._index))); e2 = p2; } else if (p2 && e2) { nodes.push(new tree.Paren(new tree.Declaration(p2, e2, null, null, parserInput.i + currentIndex, fileInfo, true))); if (!spacing) { nodes[nodes.length - 1].noSpacing = true; } spacing = false; } else if (e2) { nodes.push(new tree.Paren(e2)); spacing = false; } else { error("badly formed media feature definition"); } } else { error("Missing closing ')'", "Parse"); } } } while (e2); parserInput.forget(); if (nodes.length > 0) { return new tree.Expression(nodes); } }, mediaFeatures: function(syntaxOptions) { var entities = this.entities; var features = []; var e2; do { e2 = this.mediaFeature(syntaxOptions); if (e2) { features.push(e2); if (!parserInput.$char(",")) { break; } else if (!features[features.length - 1].noSpacing) { features[features.length - 1].noSpacing = false; } } else { e2 = entities.variable() || entities.mixinLookup(); if (e2) { features.push(e2); if (!parserInput.$char(",")) { break; } else if (!features[features.length - 1].noSpacing) { features[features.length - 1].noSpacing = false; } } } } while (e2); return features.length > 0 ? features : null; }, prepareAndGetNestableAtRule: function(treeType, index2, debugInfo2, syntaxOptions) { var features = this.mediaFeatures(syntaxOptions); var rules = this.block(); if (!rules) { error("media definitions require block statements after any features"); } parserInput.forget(); var atRule = new treeType(rules, features, index2 + currentIndex, fileInfo); if (context.dumpLineNumbers) { atRule.debugInfo = debugInfo2; } return atRule; }, nestableAtRule: function() { var debugInfo2; var index2 = parserInput.i; if (context.dumpLineNumbers) { debugInfo2 = getDebugInfo(index2); } parserInput.save(); if (parserInput.$peekChar("@")) { if (parserInput.$str("@media")) { return this.prepareAndGetNestableAtRule(tree.Media, index2, debugInfo2, MediaSyntaxOptions); } if (parserInput.$str("@container")) { return this.prepareAndGetNestableAtRule(tree.Container, index2, debugInfo2, ContainerSyntaxOptions); } } parserInput.restore(); }, // // A @plugin directive, used to import plugins dynamically. // // @plugin (args) "lib"; // plugin: function() { var path; var args; var options3; var index2 = parserInput.i; var dir = parserInput.$re(/^@plugin\s+/); if (dir) { args = this.pluginArgs(); if (args) { options3 = { pluginArgs: args, isPlugin: true }; } else { options3 = { isPlugin: true }; } if (path = this.entities.quoted() || this.entities.url()) { if (!parserInput.$char(";")) { parserInput.i = index2; error("missing semi-colon on @plugin"); } return new tree.Import(path, null, options3, index2 + currentIndex, fileInfo); } else { parserInput.i = index2; error("malformed @plugin statement"); } } }, pluginArgs: function() { parserInput.save(); if (!parserInput.$char("(")) { parserInput.restore(); return null; } var args = parserInput.$re(/^\s*([^);]+)\)\s*/); if (args[1]) { parserInput.forget(); return args[1].trim(); } else { parserInput.restore(); return null; } }, atruleUnknown: function(value, name, hasBlock) { value = this.permissiveValue(/^[{;]/); hasBlock = parserInput.currentChar() === "{"; if (!value) { if (!hasBlock && parserInput.currentChar() !== ";") { error("".concat(name, " rule is missing block or ending semi-colon")); } } else if (!value.value) { value = null; } return [value, hasBlock]; }, atruleBlock: function(rules, value, isRooted, isKeywordList) { rules = this.blockRuleset(); parserInput.save(); if (!rules && !isRooted) { value = this.entity(); rules = this.blockRuleset(); } if (!rules && !isRooted) { parserInput.restore(); var e2 = []; value = this.entity(); while (parserInput.$char(",")) { e2.push(value); value = this.entity(); } if (value && e2.length > 0) { e2.push(value); value = e2; isKeywordList = true; } else { rules = this.blockRuleset(); } } else { parserInput.forget(); } return [rules, value, isKeywordList]; }, // // A CSS AtRule // // @charset "utf-8"; // atrule: function() { var index2 = parserInput.i; var name; var value; var rules; var nonVendorSpecificName; var hasIdentifier; var hasExpression; var hasUnknown; var hasBlock = true; var isRooted = true; var isKeywordList = false; if (parserInput.currentChar() !== "@") { return; } value = this["import"]() || this.plugin() || this.nestableAtRule(); if (value) { return value; } parserInput.save(); name = parserInput.$re(/^@[a-z-]+/); if (!name) { return; } nonVendorSpecificName = name; if (name.charAt(1) == "-" && name.indexOf("-", 2) > 0) { nonVendorSpecificName = "@".concat(name.slice(name.indexOf("-", 2) + 1)); } switch (nonVendorSpecificName) { case "@charset": hasIdentifier = true; hasBlock = false; break; case "@namespace": hasExpression = true; hasBlock = false; break; case "@keyframes": case "@counter-style": hasIdentifier = true; break; case "@document": case "@supports": hasUnknown = true; isRooted = false; break; case "@starting-style": isRooted = false; break; case "@layer": isRooted = false; break; default: hasUnknown = true; break; } parserInput.commentStore.length = 0; if (hasIdentifier) { value = this.entity(); if (!value) { error("expected ".concat(name, " identifier")); } } else if (hasExpression) { value = this.expression(); if (!value) { error("expected ".concat(name, " expression")); } } else if (hasUnknown) { var unknownPackage = this.atruleUnknown(value, name, hasBlock); value = unknownPackage[0]; hasBlock = unknownPackage[1]; } if (hasBlock) { var blockPackage = this.atruleBlock(rules, value, isRooted, isKeywordList); rules = blockPackage[0]; value = blockPackage[1]; isKeywordList = blockPackage[2]; if (!rules && !hasUnknown) { parserInput.restore(); name = parserInput.$re(/^@[a-z-]+/); var unknownPackage = this.atruleUnknown(value, name, hasBlock); value = unknownPackage[0]; hasBlock = unknownPackage[1]; if (hasBlock) { blockPackage = this.atruleBlock(rules, value, isRooted, isKeywordList); rules = blockPackage[0]; value = blockPackage[1]; isKeywordList = blockPackage[2]; } } } if (rules || isKeywordList || !hasBlock && value && parserInput.$char(";")) { parserInput.forget(); return new tree.AtRule(name, value, rules, index2 + currentIndex, fileInfo, context.dumpLineNumbers ? getDebugInfo(index2) : null, isRooted); } parserInput.restore("at-rule options not recognised"); }, // // A Value is a comma-delimited list of Expressions // // font-family: Baskerville, Georgia, serif; // // In a Rule, a Value represents everything after the `:`, // and before the `;`. // value: function() { var e2; var expressions = []; var index2 = parserInput.i; do { e2 = this.expression(); if (e2) { expressions.push(e2); if (!parserInput.$char(",")) { break; } } } while (e2); if (expressions.length > 0) { return new tree.Value(expressions, index2 + currentIndex); } }, important: function() { if (parserInput.currentChar() === "!") { return parserInput.$re(/^! *important/); } }, sub: function() { var a; var e2; parserInput.save(); if (parserInput.$char("(")) { a = this.addition(); if (a && parserInput.$char(")")) { parserInput.forget(); e2 = new tree.Expression([a]); e2.parens = true; return e2; } parserInput.restore("Expected ')'"); return; } parserInput.restore(); }, colorOperand: function() { parserInput.save(); var match = parserInput.$re(/^[lchrgbs]\s+/); if (match) { return new tree.Keyword(match[0]); } parserInput.restore(); }, multiplication: function() { var m; var a; var op; var operation; var isSpaced; m = this.operand(); if (m) { isSpaced = parserInput.isWhitespace(-1); while (true) { if (parserInput.peek(/^\/[*/]/)) { break; } parserInput.save(); op = parserInput.$char("/") || parserInput.$char("*"); if (!op) { var index2 = parserInput.i; op = parserInput.$str("./"); if (op) { warn("./ operator is deprecated", index2, "DEPRECATED"); } } if (!op) { parserInput.forget(); break; } a = this.operand(); if (!a) { parserInput.restore(); break; } parserInput.forget(); m.parensInOp = true; a.parensInOp = true; operation = new tree.Operation(op, [operation || m, a], isSpaced); isSpaced = parserInput.isWhitespace(-1); } return operation || m; } }, addition: function() { var m; var a; var op; var operation; var isSpaced; m = this.multiplication(); if (m) { isSpaced = parserInput.isWhitespace(-1); while (true) { op = parserInput.$re(/^[-+]\s+/) || !isSpaced && (parserInput.$char("+") || parserInput.$char("-")); if (!op) { break; } a = this.multiplication(); if (!a) { break; } m.parensInOp = true; a.parensInOp = true; operation = new tree.Operation(op, [operation || m, a], isSpaced); isSpaced = parserInput.isWhitespace(-1); } return operation || m; } }, conditions: function() { var a; var b2; var index2 = parserInput.i; var condition; a = this.condition(true); if (a) { while (true) { if (!parserInput.peek(/^,\s*(not\s*)?\(/) || !parserInput.$char(",")) { break; } b2 = this.condition(true); if (!b2) { break; } condition = new tree.Condition("or", condition || a, b2, index2 + currentIndex); } return condition || a; } }, condition: function(needsParens) { var result; var logical; var next; function or() { return parserInput.$str("or"); } result = this.conditionAnd(needsParens); if (!result) { return; } logical = or(); if (logical) { next = this.condition(needsParens); if (next) { result = new tree.Condition(logical, result, next); } else { return; } } return result; }, conditionAnd: function(needsParens) { var result; var logical; var next; var self2 = this; function insideCondition() { var cond = self2.negatedCondition(needsParens) || self2.parenthesisCondition(needsParens); if (!cond && !needsParens) { return self2.atomicCondition(needsParens); } return cond; } function and() { return parserInput.$str("and"); } result = insideCondition(); if (!result) { return; } logical = and(); if (logical) { next = this.conditionAnd(needsParens); if (next) { result = new tree.Condition(logical, result, next); } else { return; } } return result; }, negatedCondition: function(needsParens) { if (parserInput.$str("not")) { var result = this.parenthesisCondition(needsParens); if (result) { result.negate = !result.negate; } return result; } }, parenthesisCondition: function(needsParens) { function tryConditionFollowedByParenthesis(me) { var body2; parserInput.save(); body2 = me.condition(needsParens); if (!body2) { parserInput.restore(); return; } if (!parserInput.$char(")")) { parserInput.restore(); return; } parserInput.forget(); return body2; } var body; parserInput.save(); if (!parserInput.$str("(")) { parserInput.restore(); return; } body = tryConditionFollowedByParenthesis(this); if (body) { parserInput.forget(); return body; } body = this.atomicCondition(needsParens); if (!body) { parserInput.restore(); return; } if (!parserInput.$char(")")) { parserInput.restore("expected ')' got '".concat(parserInput.currentChar(), "'")); return; } parserInput.forget(); return body; }, atomicCondition: function(needsParens, preparsedCond) { var entities = this.entities; var index2 = parserInput.i; var a; var b2; var c2; var op; var cond = (function() { return this.addition() || entities.keyword() || entities.quoted() || entities.mixinLookup(); }).bind(this); if (preparsedCond) { a = preparsedCond; } else { a = cond(); } if (a) { if (parserInput.$char(">")) { if (parserInput.$char("=")) { op = ">="; } else { op = ">"; } } else if (parserInput.$char("<")) { if (parserInput.$char("=")) { op = "<="; } else { op = "<"; } } else if (parserInput.$char("=")) { if (parserInput.$char(">")) { op = "=>"; } else if (parserInput.$char("<")) { op = "=<"; } else { op = "="; } } if (op) { b2 = cond(); if (b2) { c2 = new tree.Condition(op, a, b2, index2 + currentIndex, false); } else { error("expected expression"); } } else if (!preparsedCond) { c2 = new tree.Condition("=", a, new tree.Keyword("true"), index2 + currentIndex, false); } return c2; } }, // // An operand is anything that can be part of an operation, // such as a Color, or a Variable // operand: function() { var entities = this.entities; var negate; if (parserInput.peek(/^-[@$(]/)) { negate = parserInput.$char("-"); } var o = this.sub() || entities.dimension() || entities.color() || entities.variable() || entities.property() || entities.call() || entities.quoted(true) || entities.colorKeyword() || this.colorOperand() || entities.mixinLookup(); if (negate) { o.parensInOp = true; o = new tree.Negative(o); } return o; }, // // Expressions either represent mathematical operations, // or white-space delimited Entities. // // 1px solid black // @var * 2 // expression: function() { var entities = []; var e2; var delim; var index2 = parserInput.i; do { e2 = this.comment(); if (e2 && !e2.isLineComment) { entities.push(e2); continue; } e2 = this.addition() || this.entity(); if (e2 instanceof tree.Comment) { e2 = null; } if (e2) { entities.push(e2); if (!parserInput.peek(/^\/[/*]/)) { delim = parserInput.$char("/"); if (delim) { entities.push(new tree.Anonymous(delim, index2 + currentIndex)); } } } } while (e2); if (entities.length > 0) { return new tree.Expression(entities); } }, property: function() { var name = parserInput.$re(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/); if (name) { return name[1]; } }, ruleProperty: function() { var name = []; var index2 = []; var s; var k2; parserInput.save(); var simpleProperty = parserInput.$re(/^([_a-zA-Z0-9-]+)\s*:/); if (simpleProperty) { name = [new tree.Keyword(simpleProperty[1])]; parserInput.forget(); return name; } function match(re) { var i = parserInput.i; var chunk = parserInput.$re(re); if (chunk) { index2.push(i); return name.push(chunk[1]); } } match(/^(\*?)/); while (true) { if (!match(/^((?:[\w-]+)|(?:[@$]\{[\w-]+\}))/)) { break; } } if (name.length > 1 && match(/^((?:\+_|\+)?)\s*:/)) { parserInput.forget(); if (name[0] === "") { name.shift(); index2.shift(); } for (k2 = 0; k2 < name.length; k2++) { s = name[k2]; name[k2] = s.charAt(0) !== "@" && s.charAt(0) !== "$" ? new tree.Keyword(s) : s.charAt(0) === "@" ? new tree.Variable("@".concat(s.slice(2, -1)), index2[k2] + currentIndex, fileInfo) : new tree.Property("$".concat(s.slice(2, -1)), index2[k2] + currentIndex, fileInfo); } return name; } parserInput.restore(); } } }; }; Parser.serializeVars = function(vars) { var s = ""; for (var name_1 in vars) { if (Object.hasOwnProperty.call(vars, name_1)) { var value = vars[name_1]; s += "".concat((name_1[0] === "@" ? "" : "@") + name_1, ": ").concat(value).concat(String(value).slice(-1) === ";" ? "" : ";"); } } return s; }; var Selector = function(elements, extendList, condition, index2, currentFileInfo, visibilityInfo) { this.extendList = extendList; this.condition = condition; this.evaldCondition = !condition; this._index = index2; this._fileInfo = currentFileInfo; this.elements = this.getElements(elements); this.mixinElements_ = void 0; this.copyVisibilityInfo(visibilityInfo); this.setParent(this.elements, this); }; Selector.prototype = Object.assign(new Node2(), { type: "Selector", accept: function(visitor) { if (this.elements) { this.elements = visitor.visitArray(this.elements); } if (this.extendList) { this.extendList = visitor.visitArray(this.extendList); } if (this.condition) { this.condition = visitor.visit(this.condition); } }, createDerived: function(elements, extendList, evaldCondition) { elements = this.getElements(elements); var newSelector = new Selector(elements, extendList || this.extendList, null, this.getIndex(), this.fileInfo(), this.visibilityInfo()); newSelector.evaldCondition = !isNullOrUndefined(evaldCondition) ? evaldCondition : this.evaldCondition; newSelector.mediaEmpty = this.mediaEmpty; return newSelector; }, getElements: function(els) { if (!els) { return [new Element2("", "&", false, this._index, this._fileInfo)]; } if (typeof els === "string") { new Parser(this.parse.context, this.parse.importManager, this._fileInfo, this._index).parseNode(els, ["selector"], function(err, result) { if (err) { throw new LessError({ index: err.index, message: err.message }, this.parse.imports, this._fileInfo.filename); } els = result[0].elements; }); } return els; }, createEmptySelectors: function() { var el = new Element2("", "&", false, this._index, this._fileInfo), sels = [new Selector([el], null, null, this._index, this._fileInfo)]; sels[0].mediaEmpty = true; return sels; }, match: function(other) { var elements = this.elements; var len = elements.length; var olen; var i; other = other.mixinElements(); olen = other.length; if (olen === 0 || len < olen) { return 0; } else { for (i = 0; i < olen; i++) { if (elements[i].value !== other[i]) { return 0; } } } return olen; }, mixinElements: function() { if (this.mixinElements_) { return this.mixinElements_; } var elements = this.elements.map(function(v2) { return v2.combinator.value + (v2.value.value || v2.value); }).join("").match(/[,&#*.\w-]([\w-]|(\\.))*/g); if (elements) { if (elements[0] === "&") { elements.shift(); } } else { elements = []; } return this.mixinElements_ = elements; }, isJustParentSelector: function() { return !this.mediaEmpty && this.elements.length === 1 && this.elements[0].value === "&" && (this.elements[0].combinator.value === " " || this.elements[0].combinator.value === ""); }, eval: function(context) { var evaldCondition = this.condition && this.condition.eval(context); var elements = this.elements; var extendList = this.extendList; elements = elements && elements.map(function(e2) { return e2.eval(context); }); extendList = extendList && extendList.map(function(extend) { return extend.eval(context); }); return this.createDerived(elements, extendList, evaldCondition); }, genCSS: function(context, output) { var i, element; if ((!context || !context.firstSelector) && this.elements[0].combinator.value === "") { output.add(" ", this.fileInfo(), this.getIndex()); } for (i = 0; i < this.elements.length; i++) { element = this.elements[i]; element.genCSS(context, output); } }, getIsOutput: function() { return this.evaldCondition; } }); var Value2 = function(value) { if (!value) { throw new Error("Value requires an array argument"); } if (!Array.isArray(value)) { this.value = [value]; } else { this.value = value; } }; Value2.prototype = Object.assign(new Node2(), { type: "Value", accept: function(visitor) { if (this.value) { this.value = visitor.visitArray(this.value); } }, eval: function(context) { if (this.value.length === 1) { return this.value[0].eval(context); } else { return new Value2(this.value.map(function(v2) { return v2.eval(context); })); } }, genCSS: function(context, output) { var i; for (i = 0; i < this.value.length; i++) { this.value[i].genCSS(context, output); if (i + 1 < this.value.length) { output.add(context && context.compress ? "," : ", "); } } } }); var Keyword = function(value) { this.value = value; }; Keyword.prototype = Object.assign(new Node2(), { type: "Keyword", genCSS: function(context, output) { if (this.value === "%") { throw { type: "Syntax", message: "Invalid % without number" }; } output.add(this.value); } }); Keyword.True = new Keyword("true"); Keyword.False = new Keyword("false"); var MATH$1 = Math$1; function evalName(context, name) { var value = ""; var i; var n = name.length; var output = { add: function(s) { value += s; } }; for (i = 0; i < n; i++) { name[i].eval(context).genCSS(context, output); } return value; } var Declaration = function(name, value, important, merge2, index2, currentFileInfo, inline4, variable) { this.name = name; this.value = value instanceof Node2 ? value : new Value2([value ? new Anonymous(value) : null]); this.important = important ? " ".concat(important.trim()) : ""; this.merge = merge2; this._index = index2; this._fileInfo = currentFileInfo; this.inline = inline4 || false; this.variable = variable !== void 0 ? variable : name.charAt && name.charAt(0) === "@"; this.allowRoot = true; this.setParent(this.value, this); }; Declaration.prototype = Object.assign(new Node2(), { type: "Declaration", genCSS: function(context, output) { output.add(this.name + (context.compress ? ":" : ": "), this.fileInfo(), this.getIndex()); try { this.value.genCSS(context, output); } catch (e2) { e2.index = this._index; e2.filename = this._fileInfo.filename; throw e2; } output.add(this.important + (this.inline || context.lastRule && context.compress ? "" : ";"), this._fileInfo, this._index); }, eval: function(context) { var mathBypass = false, prevMath, name = this.name, evaldValue, variable = this.variable; if (typeof name !== "string") { name = name.length === 1 && name[0] instanceof Keyword ? name[0].value : evalName(context, name); variable = false; } if (name === "font" && context.math === MATH$1.ALWAYS) { mathBypass = true; prevMath = context.math; context.math = MATH$1.PARENS_DIVISION; } try { context.importantScope.push({}); evaldValue = this.value.eval(context); if (!this.variable && evaldValue.type === "DetachedRuleset") { throw { message: "Rulesets cannot be evaluated on a property.", index: this.getIndex(), filename: this.fileInfo().filename }; } var important = this.important; var importantResult = context.importantScope.pop(); if (!important && importantResult.important) { important = importantResult.important; } return new Declaration(name, evaldValue, important, this.merge, this.getIndex(), this.fileInfo(), this.inline, variable); } catch (e2) { if (typeof e2.index !== "number") { e2.index = this.getIndex(); e2.filename = this.fileInfo().filename; } throw e2; } finally { if (mathBypass) { context.math = prevMath; } } }, makeImportant: function() { return new Declaration(this.name, this.value, "!important", this.merge, this.getIndex(), this.fileInfo(), this.inline); } }); function asComment(ctx) { return "/* line ".concat(ctx.debugInfo.lineNumber, ", ").concat(ctx.debugInfo.fileName, " */\n"); } function asMediaQuery(ctx) { var filenameWithProtocol = ctx.debugInfo.fileName; if (!/^[a-z]+:\/\//i.test(filenameWithProtocol)) { filenameWithProtocol = "file://".concat(filenameWithProtocol); } return "@media -sass-debug-info{filename{font-family:".concat(filenameWithProtocol.replace(/([.:/\\])/g, function(a) { if (a == "\\") { a = "/"; } return "\\".concat(a); }), "}line{font-family:\\00003").concat(ctx.debugInfo.lineNumber, "}}\n"); } function debugInfo(context, ctx, lineSeparator) { var result = ""; if (context.dumpLineNumbers && !context.compress) { switch (context.dumpLineNumbers) { case "comments": result = asComment(ctx); break; case "mediaquery": result = asMediaQuery(ctx); break; case "all": result = asComment(ctx) + (lineSeparator || "") + asMediaQuery(ctx); break; } } return result; } var Comment2 = function(value, isLineComment, index2, currentFileInfo) { this.value = value; this.isLineComment = isLineComment; this._index = index2; this._fileInfo = currentFileInfo; this.allowRoot = true; }; Comment2.prototype = Object.assign(new Node2(), { type: "Comment", genCSS: function(context, output) { if (this.debugInfo) { output.add(debugInfo(context, this), this.fileInfo(), this.getIndex()); } output.add(this.value); }, isSilent: function(context) { var isCompressed = context.compress && this.value[2] !== "!"; return this.isLineComment || isCompressed; } }); var defaultFunc = { eval: function() { var v2 = this.value_; var e2 = this.error_; if (e2) { throw e2; } if (!isNullOrUndefined(v2)) { return v2 ? Keyword.True : Keyword.False; } }, value: function(v2) { this.value_ = v2; }, error: function(e2) { this.error_ = e2; }, reset: function() { this.value_ = this.error_ = null; } }; var Ruleset = function(selectors, rules, strictImports, visibilityInfo) { this.selectors = selectors; this.rules = rules; this._lookups = {}; this._variables = null; this._properties = null; this.strictImports = strictImports; this.copyVisibilityInfo(visibilityInfo); this.allowRoot = true; this.setParent(this.selectors, this); this.setParent(this.rules, this); }; Ruleset.prototype = Object.assign(new Node2(), { type: "Ruleset", isRuleset: true, isRulesetLike: function() { return true; }, accept: function(visitor) { if (this.paths) { this.paths = visitor.visitArray(this.paths, true); } else if (this.selectors) { this.selectors = visitor.visitArray(this.selectors); } if (this.rules && this.rules.length) { this.rules = visitor.visitArray(this.rules); } }, eval: function(context) { var selectors; var selCnt; var selector; var i; var hasVariable; var hasOnePassingSelector = false; if (this.selectors && (selCnt = this.selectors.length)) { selectors = new Array(selCnt); defaultFunc.error({ type: "Syntax", message: "it is currently only allowed in parametric mixin guards," }); for (i = 0; i < selCnt; i++) { selector = this.selectors[i].eval(context); for (var j2 = 0; j2 < selector.elements.length; j2++) { if (selector.elements[j2].isVariable) { hasVariable = true; break; } } selectors[i] = selector; if (selector.evaldCondition) { hasOnePassingSelector = true; } } if (hasVariable) { var toParseSelectors = new Array(selCnt); for (i = 0; i < selCnt; i++) { selector = selectors[i]; toParseSelectors[i] = selector.toCSS(context); } var startingIndex = selectors[0].getIndex(); var selectorFileInfo = selectors[0].fileInfo(); new Parser(context, this.parse.importManager, selectorFileInfo, startingIndex).parseNode(toParseSelectors.join(","), ["selectors"], function(err, result) { if (result) { selectors = flattenArray(result); } }); } defaultFunc.reset(); } else { hasOnePassingSelector = true; } var rules = this.rules ? copyArray(this.rules) : null; var ruleset = new Ruleset(selectors, rules, this.strictImports, this.visibilityInfo()); var rule; var subRule; ruleset.originalRuleset = this; ruleset.root = this.root; ruleset.firstRoot = this.firstRoot; ruleset.allowImports = this.allowImports; if (this.debugInfo) { ruleset.debugInfo = this.debugInfo; } if (!hasOnePassingSelector) { rules.length = 0; } ruleset.functionRegistry = (function(frames) { var i2 = 0; var n = frames.length; var found; for (; i2 !== n; ++i2) { found = frames[i2].functionRegistry; if (found) { return found; } } return functionRegistry; })(context.frames).inherit(); var ctxFrames = context.frames; ctxFrames.unshift(ruleset); var ctxSelectors = context.selectors; if (!ctxSelectors) { context.selectors = ctxSelectors = []; } ctxSelectors.unshift(this.selectors); if (ruleset.root || ruleset.allowImports || !ruleset.strictImports) { ruleset.evalImports(context); } var rsRules = ruleset.rules; for (i = 0; rule = rsRules[i]; i++) { if (rule.evalFirst) { rsRules[i] = rule.eval(context); } } var mediaBlockCount = context.mediaBlocks && context.mediaBlocks.length || 0; for (i = 0; rule = rsRules[i]; i++) { if (rule.type === "MixinCall") { rules = rule.eval(context).filter(function(r) { if (r instanceof Declaration && r.variable) { return !ruleset.variable(r.name); } return true; }); rsRules.splice.apply(rsRules, [i, 1].concat(rules)); i += rules.length - 1; ruleset.resetCache(); } else if (rule.type === "VariableCall") { rules = rule.eval(context).rules.filter(function(r) { if (r instanceof Declaration && r.variable) { return false; } return true; }); rsRules.splice.apply(rsRules, [i, 1].concat(rules)); i += rules.length - 1; ruleset.resetCache(); } } for (i = 0; rule = rsRules[i]; i++) { if (!rule.evalFirst) { rsRules[i] = rule = rule.eval ? rule.eval(context) : rule; } } for (i = 0; rule = rsRules[i]; i++) { if (rule instanceof Ruleset && rule.selectors && rule.selectors.length === 1) { if (rule.selectors[0] && rule.selectors[0].isJustParentSelector()) { rsRules.splice(i--, 1); for (var j2 = 0; subRule = rule.rules[j2]; j2++) { if (subRule instanceof Node2) { subRule.copyVisibilityInfo(rule.visibilityInfo()); if (!(subRule instanceof Declaration) || !subRule.variable) { rsRules.splice(++i, 0, subRule); } } } } } } ctxFrames.shift(); ctxSelectors.shift(); if (context.mediaBlocks) { for (i = mediaBlockCount; i < context.mediaBlocks.length; i++) { context.mediaBlocks[i].bubbleSelectors(selectors); } } return ruleset; }, evalImports: function(context) { var rules = this.rules; var i; var importRules; if (!rules) { return; } for (i = 0; i < rules.length; i++) { if (rules[i].type === "Import") { importRules = rules[i].eval(context); if (importRules && (importRules.length || importRules.length === 0)) { rules.splice.apply(rules, [i, 1].concat(importRules)); i += importRules.length - 1; } else { rules.splice(i, 1, importRules); } this.resetCache(); } } }, makeImportant: function() { var result = new Ruleset(this.selectors, this.rules.map(function(r) { if (r.makeImportant) { return r.makeImportant(); } else { return r; } }), this.strictImports, this.visibilityInfo()); return result; }, matchArgs: function(args) { return !args || args.length === 0; }, // lets you call a css selector with a guard matchCondition: function(args, context) { var lastSelector = this.selectors[this.selectors.length - 1]; if (!lastSelector.evaldCondition) { return false; } if (lastSelector.condition && !lastSelector.condition.eval(new contexts.Eval(context, context.frames))) { return false; } return true; }, resetCache: function() { this._rulesets = null; this._variables = null; this._properties = null; this._lookups = {}; }, variables: function() { if (!this._variables) { this._variables = !this.rules ? {} : this.rules.reduce(function(hash2, r) { if (r instanceof Declaration && r.variable === true) { hash2[r.name] = r; } if (r.type === "Import" && r.root && r.root.variables) { var vars = r.root.variables(); for (var name_1 in vars) { if (vars.hasOwnProperty(name_1)) { hash2[name_1] = r.root.variable(name_1); } } } return hash2; }, {}); } return this._variables; }, properties: function() { if (!this._properties) { this._properties = !this.rules ? {} : this.rules.reduce(function(hash2, r) { if (r instanceof Declaration && r.variable !== true) { var name_2 = r.name.length === 1 && r.name[0] instanceof Keyword ? r.name[0].value : r.name; if (!hash2["$".concat(name_2)]) { hash2["$".concat(name_2)] = [r]; } else { hash2["$".concat(name_2)].push(r); } } return hash2; }, {}); } return this._properties; }, variable: function(name) { var decl = this.variables()[name]; if (decl) { return this.parseValue(decl); } }, property: function(name) { var decl = this.properties()[name]; if (decl) { return this.parseValue(decl); } }, lastDeclaration: function() { for (var i_1 = this.rules.length; i_1 > 0; i_1--) { var decl = this.rules[i_1 - 1]; if (decl instanceof Declaration) { return this.parseValue(decl); } } }, parseValue: function(toParse) { var self2 = this; function transformDeclaration(decl) { if (decl.value instanceof Anonymous && !decl.parsed) { if (typeof decl.value.value === "string") { new Parser(this.parse.context, this.parse.importManager, decl.fileInfo(), decl.value.getIndex()).parseNode(decl.value.value, ["value", "important"], function(err, result) { if (err) { decl.parsed = true; } if (result) { decl.value = result[0]; decl.important = result[1] || ""; decl.parsed = true; } }); } else { decl.parsed = true; } return decl; } else { return decl; } } if (!Array.isArray(toParse)) { return transformDeclaration.call(self2, toParse); } else { var nodes_1 = []; toParse.forEach(function(n) { nodes_1.push(transformDeclaration.call(self2, n)); }); return nodes_1; } }, rulesets: function() { if (!this.rules) { return []; } var filtRules = []; var rules = this.rules; var i; var rule; for (i = 0; rule = rules[i]; i++) { if (rule.isRuleset) { filtRules.push(rule); } } return filtRules; }, prependRule: function(rule) { var rules = this.rules; if (rules) { rules.unshift(rule); } else { this.rules = [rule]; } this.setParent(rule, this); }, find: function(selector, self2, filter) { self2 = self2 || this; var rules = []; var match; var foundMixins; var key2 = selector.toCSS(); if (key2 in this._lookups) { return this._lookups[key2]; } this.rulesets().forEach(function(rule) { if (rule !== self2) { for (var j2 = 0; j2 < rule.selectors.length; j2++) { match = selector.match(rule.selectors[j2]); if (match) { if (selector.elements.length > match) { if (!filter || filter(rule)) { foundMixins = rule.find(new Selector(selector.elements.slice(match)), self2, filter); for (var i_2 = 0; i_2 < foundMixins.length; ++i_2) { foundMixins[i_2].path.push(rule); } Array.prototype.push.apply(rules, foundMixins); } } else { rules.push({ rule, path: [] }); } break; } } } }); this._lookups[key2] = rules; return rules; }, genCSS: function(context, output) { var i; var j2; var charsetRuleNodes = []; var ruleNodes = []; var debugInfo$1; var rule; var path; context.tabLevel = context.tabLevel || 0; if (!this.root) { context.tabLevel++; } var tabRuleStr = context.compress ? "" : Array(context.tabLevel + 1).join(" "); var tabSetStr = context.compress ? "" : Array(context.tabLevel).join(" "); var sep; var charsetNodeIndex = 0; var importNodeIndex = 0; for (i = 0; rule = this.rules[i]; i++) { if (rule instanceof Comment2) { if (importNodeIndex === i) { importNodeIndex++; } ruleNodes.push(rule); } else if (rule.isCharset && rule.isCharset()) { ruleNodes.splice(charsetNodeIndex, 0, rule); charsetNodeIndex++; importNodeIndex++; } else if (rule.type === "Import") { ruleNodes.splice(importNodeIndex, 0, rule); importNodeIndex++; } else { ruleNodes.push(rule); } } ruleNodes = charsetRuleNodes.concat(ruleNodes); if (!this.root) { debugInfo$1 = debugInfo(context, this, tabSetStr); if (debugInfo$1) { output.add(debugInfo$1); output.add(tabSetStr); } var paths = this.paths; var pathCnt = paths.length; var pathSubCnt = void 0; sep = context.compress ? "," : ",\n".concat(tabSetStr); for (i = 0; i < pathCnt; i++) { path = paths[i]; if (!(pathSubCnt = path.length)) { continue; } if (i > 0) { output.add(sep); } context.firstSelector = true; path[0].genCSS(context, output); context.firstSelector = false; for (j2 = 1; j2 < pathSubCnt; j2++) { path[j2].genCSS(context, output); } } output.add((context.compress ? "{" : " {\n") + tabRuleStr); } for (i = 0; rule = ruleNodes[i]; i++) { if (i + 1 === ruleNodes.length) { context.lastRule = true; } var currentLastRule = context.lastRule; if (rule.isRulesetLike(rule)) { context.lastRule = false; } if (rule.genCSS) { rule.genCSS(context, output); } else if (rule.value) { output.add(rule.value.toString()); } context.lastRule = currentLastRule; if (!context.lastRule && rule.isVisible()) { output.add(context.compress ? "" : "\n".concat(tabRuleStr)); } else { context.lastRule = false; } } if (!this.root) { output.add(context.compress ? "}" : "\n".concat(tabSetStr, "}")); context.tabLevel--; } if (!output.isEmpty() && !context.compress && this.firstRoot) { output.add("\n"); } }, joinSelectors: function(paths, context, selectors) { for (var s = 0; s < selectors.length; s++) { this.joinSelector(paths, context, selectors[s]); } }, joinSelector: function(paths, context, selector) { function createParenthesis(elementsToPak, originalElement) { var replacementParen, j2; if (elementsToPak.length === 0) { replacementParen = new Paren(elementsToPak[0]); } else { var insideParent = new Array(elementsToPak.length); for (j2 = 0; j2 < elementsToPak.length; j2++) { insideParent[j2] = new Element2(null, elementsToPak[j2], originalElement.isVariable, originalElement._index, originalElement._fileInfo); } replacementParen = new Paren(new Selector(insideParent)); } return replacementParen; } function createSelector(containedElement, originalElement) { var element, selector2; element = new Element2(null, containedElement, originalElement.isVariable, originalElement._index, originalElement._fileInfo); selector2 = new Selector([element]); return selector2; } function addReplacementIntoPath(beginningPath, addPath, replacedElement, originalSelector) { var newSelectorPath, lastSelector, newJoinedSelector; newSelectorPath = []; if (beginningPath.length > 0) { newSelectorPath = copyArray(beginningPath); lastSelector = newSelectorPath.pop(); newJoinedSelector = originalSelector.createDerived(copyArray(lastSelector.elements)); } else { newJoinedSelector = originalSelector.createDerived([]); } if (addPath.length > 0) { var combinator = replacedElement.combinator; var parentEl = addPath[0].elements[0]; if (combinator.emptyOrWhitespace && !parentEl.combinator.emptyOrWhitespace) { combinator = parentEl.combinator; } newJoinedSelector.elements.push(new Element2(combinator, parentEl.value, replacedElement.isVariable, replacedElement._index, replacedElement._fileInfo)); newJoinedSelector.elements = newJoinedSelector.elements.concat(addPath[0].elements.slice(1)); } if (newJoinedSelector.elements.length !== 0) { newSelectorPath.push(newJoinedSelector); } if (addPath.length > 1) { var restOfPath = addPath.slice(1); restOfPath = restOfPath.map(function(selector2) { return selector2.createDerived(selector2.elements, []); }); newSelectorPath = newSelectorPath.concat(restOfPath); } return newSelectorPath; } function addAllReplacementsIntoPath(beginningPath, addPaths, replacedElement, originalSelector, result) { var j2; for (j2 = 0; j2 < beginningPath.length; j2++) { var newSelectorPath = addReplacementIntoPath(beginningPath[j2], addPaths, replacedElement, originalSelector); result.push(newSelectorPath); } return result; } function mergeElementsOnToSelectors(elements, selectors) { var i2, sel; if (elements.length === 0) { return; } if (selectors.length === 0) { selectors.push([new Selector(elements)]); return; } for (i2 = 0; sel = selectors[i2]; i2++) { if (sel.length > 0) { sel[sel.length - 1] = sel[sel.length - 1].createDerived(sel[sel.length - 1].elements.concat(elements)); } else { sel.push(new Selector(elements)); } } } function replaceParentSelector(paths2, context2, inSelector) { var i2, j2, k2, currentElements, newSelectors, selectorsMultiplied, sel, el, hadParentSelector2 = false, length, lastSelector; function findNestedSelector(element) { var maybeSelector; if (!(element.value instanceof Paren)) { return null; } maybeSelector = element.value.value; if (!(maybeSelector instanceof Selector)) { return null; } return maybeSelector; } currentElements = []; newSelectors = [ [] ]; for (i2 = 0; el = inSelector.elements[i2]; i2++) { if (el.value !== "&") { var nestedSelector = findNestedSelector(el); if (nestedSelector !== null) { mergeElementsOnToSelectors(currentElements, newSelectors); var nestedPaths = []; var replaced = void 0; var replacedNewSelectors = []; replaced = replaceParentSelector(nestedPaths, context2, nestedSelector); hadParentSelector2 = hadParentSelector2 || replaced; for (k2 = 0; k2 < nestedPaths.length; k2++) { var replacementSelector = createSelector(createParenthesis(nestedPaths[k2], el), el); addAllReplacementsIntoPath(newSelectors, [replacementSelector], el, inSelector, replacedNewSelectors); } newSelectors = replacedNewSelectors; currentElements = []; } else { currentElements.push(el); } } else { hadParentSelector2 = true; selectorsMultiplied = []; mergeElementsOnToSelectors(currentElements, newSelectors); for (j2 = 0; j2 < newSelectors.length; j2++) { sel = newSelectors[j2]; if (context2.length === 0) { if (sel.length > 0) { sel[0].elements.push(new Element2(el.combinator, "", el.isVariable, el._index, el._fileInfo)); } selectorsMultiplied.push(sel); } else { for (k2 = 0; k2 < context2.length; k2++) { var newSelectorPath = addReplacementIntoPath(sel, context2[k2], el, inSelector); selectorsMultiplied.push(newSelectorPath); } } } newSelectors = selectorsMultiplied; currentElements = []; } } mergeElementsOnToSelectors(currentElements, newSelectors); for (i2 = 0; i2 < newSelectors.length; i2++) { length = newSelectors[i2].length; if (length > 0) { paths2.push(newSelectors[i2]); lastSelector = newSelectors[i2][length - 1]; newSelectors[i2][length - 1] = lastSelector.createDerived(lastSelector.elements, inSelector.extendList); } } return hadParentSelector2; } function deriveSelector(visibilityInfo, deriveFrom) { var newSelector = deriveFrom.createDerived(deriveFrom.elements, deriveFrom.extendList, deriveFrom.evaldCondition); newSelector.copyVisibilityInfo(visibilityInfo); return newSelector; } var i, newPaths, hadParentSelector; newPaths = []; hadParentSelector = replaceParentSelector(newPaths, context, selector); if (!hadParentSelector) { if (context.length > 0) { newPaths = []; for (i = 0; i < context.length; i++) { var concatenated = context[i].map(deriveSelector.bind(this, selector.visibilityInfo())); concatenated.push(selector); newPaths.push(concatenated); } } else { newPaths = [[selector]]; } } for (i = 0; i < newPaths.length; i++) { paths.push(newPaths[i]); } } }); var Unit = function(numerator, denominator, backupUnit) { this.numerator = numerator ? copyArray(numerator).sort() : []; this.denominator = denominator ? copyArray(denominator).sort() : []; if (backupUnit) { this.backupUnit = backupUnit; } else if (numerator && numerator.length) { this.backupUnit = numerator[0]; } }; Unit.prototype = Object.assign(new Node2(), { type: "Unit", clone: function() { return new Unit(copyArray(this.numerator), copyArray(this.denominator), this.backupUnit); }, genCSS: function(context, output) { var strictUnits = context && context.strictUnits; if (this.numerator.length === 1) { output.add(this.numerator[0]); } else if (!strictUnits && this.backupUnit) { output.add(this.backupUnit); } else if (!strictUnits && this.denominator.length) { output.add(this.denominator[0]); } }, toString: function() { var i, returnStr = this.numerator.join("*"); for (i = 0; i < this.denominator.length; i++) { returnStr += "/".concat(this.denominator[i]); } return returnStr; }, compare: function(other) { return this.is(other.toString()) ? 0 : void 0; }, is: function(unitString) { return this.toString().toUpperCase() === unitString.toUpperCase(); }, isLength: function() { return RegExp("^(px|em|ex|ch|rem|in|cm|mm|pc|pt|ex|vw|vh|vmin|vmax)$", "gi").test(this.toCSS()); }, isEmpty: function() { return this.numerator.length === 0 && this.denominator.length === 0; }, isSingular: function() { return this.numerator.length <= 1 && this.denominator.length === 0; }, map: function(callback) { var i; for (i = 0; i < this.numerator.length; i++) { this.numerator[i] = callback(this.numerator[i], false); } for (i = 0; i < this.denominator.length; i++) { this.denominator[i] = callback(this.denominator[i], true); } }, usedUnits: function() { var group; var result = {}; var mapUnit; var groupName; mapUnit = function(atomicUnit) { if (group.hasOwnProperty(atomicUnit) && !result[groupName]) { result[groupName] = atomicUnit; } return atomicUnit; }; for (groupName in unitConversions) { if (unitConversions.hasOwnProperty(groupName)) { group = unitConversions[groupName]; this.map(mapUnit); } } return result; }, cancel: function() { var counter = {}; var atomicUnit; var i; for (i = 0; i < this.numerator.length; i++) { atomicUnit = this.numerator[i]; counter[atomicUnit] = (counter[atomicUnit] || 0) + 1; } for (i = 0; i < this.denominator.length; i++) { atomicUnit = this.denominator[i]; counter[atomicUnit] = (counter[atomicUnit] || 0) - 1; } this.numerator = []; this.denominator = []; for (atomicUnit in counter) { if (counter.hasOwnProperty(atomicUnit)) { var count3 = counter[atomicUnit]; if (count3 > 0) { for (i = 0; i < count3; i++) { this.numerator.push(atomicUnit); } } else if (count3 < 0) { for (i = 0; i < -count3; i++) { this.denominator.push(atomicUnit); } } } } this.numerator.sort(); this.denominator.sort(); } }); var Dimension = function(value, unit) { this.value = parseFloat(value); if (isNaN(this.value)) { throw new Error("Dimension is not a number."); } this.unit = unit && unit instanceof Unit ? unit : new Unit(unit ? [unit] : void 0); this.setParent(this.unit, this); }; Dimension.prototype = Object.assign(new Node2(), { type: "Dimension", accept: function(visitor) { this.unit = visitor.visit(this.unit); }, // remove when Nodes have JSDoc types // eslint-disable-next-line no-unused-vars eval: function(context) { return this; }, toColor: function() { return new Color([this.value, this.value, this.value]); }, genCSS: function(context, output) { if (context && context.strictUnits && !this.unit.isSingular()) { throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: ".concat(this.unit.toString())); } var value = this.fround(context, this.value); var strValue = String(value); if (value !== 0 && value < 1e-6 && value > -1e-6) { strValue = value.toFixed(20).replace(/0+$/, ""); } if (context && context.compress) { if (value === 0 && this.unit.isLength()) { output.add(strValue); return; } if (value > 0 && value < 1) { strValue = strValue.substr(1); } } output.add(strValue); this.unit.genCSS(context, output); }, // In an operation between two Dimensions, // we default to the first Dimension's unit, // so `1px + 2` will yield `3px`. operate: function(context, op, other) { var value = this._operate(context, op, this.value, other.value); var unit = this.unit.clone(); if (op === "+" || op === "-") { if (unit.numerator.length === 0 && unit.denominator.length === 0) { unit = other.unit.clone(); if (this.unit.backupUnit) { unit.backupUnit = this.unit.backupUnit; } } else if (other.unit.numerator.length === 0 && unit.denominator.length === 0) ; else { other = other.convertTo(this.unit.usedUnits()); if (context.strictUnits && other.unit.toString() !== unit.toString()) { throw new Error("Incompatible units. Change the units or use the unit function. " + "Bad units: '".concat(unit.toString(), "' and '").concat(other.unit.toString(), "'.")); } value = this._operate(context, op, this.value, other.value); } } else if (op === "*") { unit.numerator = unit.numerator.concat(other.unit.numerator).sort(); unit.denominator = unit.denominator.concat(other.unit.denominator).sort(); unit.cancel(); } else if (op === "/") { unit.numerator = unit.numerator.concat(other.unit.denominator).sort(); unit.denominator = unit.denominator.concat(other.unit.numerator).sort(); unit.cancel(); } return new Dimension(value, unit); }, compare: function(other) { var a, b2; if (!(other instanceof Dimension)) { return void 0; } if (this.unit.isEmpty() || other.unit.isEmpty()) { a = this; b2 = other; } else { a = this.unify(); b2 = other.unify(); if (a.unit.compare(b2.unit) !== 0) { return void 0; } } return Node2.numericCompare(a.value, b2.value); }, unify: function() { return this.convertTo({ length: "px", duration: "s", angle: "rad" }); }, convertTo: function(conversions) { var value = this.value; var unit = this.unit.clone(); var i; var groupName; var group; var targetUnit; var derivedConversions = {}; var applyUnit; if (typeof conversions === "string") { for (i in unitConversions) { if (unitConversions[i].hasOwnProperty(conversions)) { derivedConversions = {}; derivedConversions[i] = conversions; } } conversions = derivedConversions; } applyUnit = function(atomicUnit, denominator) { if (group.hasOwnProperty(atomicUnit)) { if (denominator) { value = value / (group[atomicUnit] / group[targetUnit]); } else { value = value * (group[atomicUnit] / group[targetUnit]); } return targetUnit; } return atomicUnit; }; for (groupName in conversions) { if (conversions.hasOwnProperty(groupName)) { targetUnit = conversions[groupName]; group = unitConversions[groupName]; unit.map(applyUnit); } } unit.cancel(); return new Dimension(value, unit); } }); var Expression = function(value, noSpacing) { this.value = value; this.noSpacing = noSpacing; if (!value) { throw new Error("Expression requires an array parameter"); } }; Expression.prototype = Object.assign(new Node2(), { type: "Expression", accept: function(visitor) { this.value = visitor.visitArray(this.value); }, eval: function(context) { var noSpacing = this.noSpacing; var returnValue; var mathOn = context.isMathOn(); var inParenthesis = this.parens; var doubleParen = false; if (inParenthesis) { context.inParenthesis(); } if (this.value.length > 1) { returnValue = new Expression(this.value.map(function(e2) { if (!e2.eval) { return e2; } return e2.eval(context); }), this.noSpacing); } else if (this.value.length === 1) { if (this.value[0].parens && !this.value[0].parensInOp && !context.inCalc) { doubleParen = true; } returnValue = this.value[0].eval(context); } else { returnValue = this; } if (inParenthesis) { context.outOfParenthesis(); } if (this.parens && this.parensInOp && !mathOn && !doubleParen && !(returnValue instanceof Dimension)) { returnValue = new Paren(returnValue); } returnValue.noSpacing = returnValue.noSpacing || noSpacing; return returnValue; }, genCSS: function(context, output) { for (var i_1 = 0; i_1 < this.value.length; i_1++) { this.value[i_1].genCSS(context, output); if (!this.noSpacing && i_1 + 1 < this.value.length) { if (i_1 + 1 < this.value.length && !(this.value[i_1 + 1] instanceof Anonymous) || this.value[i_1 + 1] instanceof Anonymous && this.value[i_1 + 1].value !== ",") { output.add(" "); } } } }, throwAwayComments: function() { this.value = this.value.filter(function(v2) { return !(v2 instanceof Comment2); }); } }); var NestableAtRulePrototype = { isRulesetLike: function() { return true; }, accept: function(visitor) { if (this.features) { this.features = visitor.visit(this.features); } if (this.rules) { this.rules = visitor.visitArray(this.rules); } }, evalFunction: function() { if (!this.features || !Array.isArray(this.features.value) || this.features.value.length < 1) { return; } var exprValues = this.features.value; var expr, paren; for (var index2 = 0; index2 < exprValues.length; ++index2) { expr = exprValues[index2]; if (expr.type === "Keyword" && index2 + 1 < exprValues.length && (expr.noSpacing || expr.noSpacing == null)) { paren = exprValues[index2 + 1]; if (paren.type === "Paren" && paren.noSpacing) { exprValues[index2] = new Expression([expr, paren]); exprValues.splice(index2 + 1, 1); exprValues[index2].noSpacing = true; } } } }, evalTop: function(context) { this.evalFunction(); var result = this; if (context.mediaBlocks.length > 1) { var selectors = new Selector([], null, null, this.getIndex(), this.fileInfo()).createEmptySelectors(); result = new Ruleset(selectors, context.mediaBlocks); result.multiMedia = true; result.copyVisibilityInfo(this.visibilityInfo()); this.setParent(result, this); } delete context.mediaBlocks; delete context.mediaPath; return result; }, evalNested: function(context) { this.evalFunction(); var i; var value; var path = context.mediaPath.concat([this]); for (i = 0; i < path.length; i++) { if (path[i].type !== this.type) { context.mediaBlocks.splice(i, 1); return this; } value = path[i].features instanceof Value2 ? path[i].features.value : path[i].features; path[i] = Array.isArray(value) ? value : [value]; } this.features = new Value2(this.permute(path).map(function(path2) { path2 = path2.map(function(fragment) { return fragment.toCSS ? fragment : new Anonymous(fragment); }); for (i = path2.length - 1; i > 0; i--) { path2.splice(i, 0, new Anonymous("and")); } return new Expression(path2); })); this.setParent(this.features, this); return new Ruleset([], []); }, permute: function(arr) { if (arr.length === 0) { return []; } else if (arr.length === 1) { return arr[0]; } else { var result = []; var rest = this.permute(arr.slice(1)); for (var i_1 = 0; i_1 < rest.length; i_1++) { for (var j2 = 0; j2 < arr[0].length; j2++) { result.push([arr[0][j2]].concat(rest[i_1])); } } return result; } }, bubbleSelectors: function(selectors) { if (!selectors) { return; } this.rules = [new Ruleset(copyArray(selectors), [this.rules[0]])]; this.setParent(this.rules, this); } }; var AtRule = function(name, value, rules, index2, currentFileInfo, debugInfo2, isRooted, visibilityInfo) { var _this = this; var i; var selectors = new Selector([], null, null, this._index, this._fileInfo).createEmptySelectors(); this.name = name; this.value = value instanceof Node2 ? value : value ? new Anonymous(value) : value; if (rules) { if (Array.isArray(rules)) { var allDeclarations = this.declarationsBlock(rules); var allRulesetDeclarations_1 = true; rules.forEach(function(rule) { if (rule.type === "Ruleset" && rule.rules) allRulesetDeclarations_1 = allRulesetDeclarations_1 && _this.declarationsBlock(rule.rules, true); }); if (allDeclarations && !isRooted) { this.simpleBlock = true; this.declarations = rules; } else if (allRulesetDeclarations_1 && rules.length === 1 && !isRooted && !value) { this.simpleBlock = true; this.declarations = rules[0].rules ? rules[0].rules : rules; } else { this.rules = rules; } } else { var allDeclarations = this.declarationsBlock(rules.rules); if (allDeclarations && !isRooted && !value) { this.simpleBlock = true; this.declarations = rules.rules; } else { this.rules = [rules]; this.rules[0].selectors = new Selector([], null, null, index2, currentFileInfo).createEmptySelectors(); } } if (!this.simpleBlock) { for (i = 0; i < this.rules.length; i++) { this.rules[i].allowImports = true; } } this.setParent(selectors, this); this.setParent(this.rules, this); } this._index = index2; this._fileInfo = currentFileInfo; this.debugInfo = debugInfo2; this.isRooted = isRooted || false; this.copyVisibilityInfo(visibilityInfo); this.allowRoot = true; }; AtRule.prototype = Object.assign(new Node2(), __assign2(__assign2({ type: "AtRule" }, NestableAtRulePrototype), { declarationsBlock: function(rules, mergeable) { if (mergeable === void 0) { mergeable = false; } if (!mergeable) { return rules.filter(function(node) { return (node.type === "Declaration" || node.type === "Comment") && !node.merge; }).length === rules.length; } else { return rules.filter(function(node) { return node.type === "Declaration" || node.type === "Comment"; }).length === rules.length; } }, keywordList: function(rules) { if (!Array.isArray(rules)) { return false; } else { return rules.filter(function(node) { return node.type === "Keyword" || node.type === "Comment"; }).length === rules.length; } }, accept: function(visitor) { var value = this.value, rules = this.rules, declarations = this.declarations; if (rules) { this.rules = visitor.visitArray(rules); } else if (declarations) { this.declarations = visitor.visitArray(declarations); } if (value) { this.value = visitor.visit(value); } }, isRulesetLike: function() { return this.rules || !this.isCharset(); }, isCharset: function() { return "@charset" === this.name; }, genCSS: function(context, output) { var value = this.value, rules = this.rules || this.declarations; output.add(this.name, this.fileInfo(), this.getIndex()); if (value) { output.add(" "); value.genCSS(context, output); } if (this.simpleBlock) { this.outputRuleset(context, output, this.declarations); } else if (rules) { this.outputRuleset(context, output, rules); } else { output.add(";"); } }, eval: function(context) { var mediaPathBackup, mediaBlocksBackup, value = this.value, rules = this.rules || this.declarations; mediaPathBackup = context.mediaPath; mediaBlocksBackup = context.mediaBlocks; context.mediaPath = []; context.mediaBlocks = []; if (value) { value = value.eval(context); if (value.value && this.keywordList(value.value)) { value = new Anonymous(value.value.map(function(keyword) { return keyword.value; }).join(", "), this.getIndex(), this.fileInfo()); } } if (rules) { rules = this.evalRoot(context, rules); } if (Array.isArray(rules) && rules[0].rules && Array.isArray(rules[0].rules) && rules[0].rules.length) { var allMergeableDeclarations = this.declarationsBlock(rules[0].rules, true); if (allMergeableDeclarations && !this.isRooted && !value) { var mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules; mergeRules(rules[0].rules); rules = rules[0].rules; rules.forEach(function(rule) { return rule.merge = false; }); } } if (this.simpleBlock && rules) { rules[0].functionRegistry = context.frames[0].functionRegistry.inherit(); rules = rules.map(function(rule) { return rule.eval(context); }); } context.mediaPath = mediaPathBackup; context.mediaBlocks = mediaBlocksBackup; return new AtRule(this.name, value, rules, this.getIndex(), this.fileInfo(), this.debugInfo, this.isRooted, this.visibilityInfo()); }, evalRoot: function(context, rules) { var ampersandCount = 0; var noAmpersandCount = 0; var noAmpersands = true; var allAmpersands = false; if (!this.simpleBlock) { rules = [rules[0].eval(context)]; } var precedingSelectors = []; if (context.frames.length > 0) { var _loop_1 = function(index3) { var frame = context.frames[index3]; if (frame.type === "Ruleset" && frame.rules && frame.rules.length > 0) { if (frame && !frame.root && frame.selectors && frame.selectors.length > 0) { precedingSelectors = precedingSelectors.concat(frame.selectors); } } if (precedingSelectors.length > 0) { var value_1 = ""; var output = { add: function(s) { value_1 += s; } }; for (var i_1 = 0; i_1 < precedingSelectors.length; i_1++) { precedingSelectors[i_1].genCSS(context, output); } if (/^&+$/.test(value_1.replace(/\s+/g, ""))) { noAmpersands = false; noAmpersandCount++; } else { allAmpersands = false; ampersandCount++; } } }; for (var index2 = 0; index2 < context.frames.length; index2++) { _loop_1(index2); } } var mixedAmpersands = ampersandCount > 0 && noAmpersandCount > 0 && !allAmpersands && !noAmpersands; if (this.isRooted && ampersandCount > 0 && noAmpersandCount === 0 && !allAmpersands && noAmpersands || !mixedAmpersands) { rules[0].root = true; } return rules; }, variable: function(name) { if (this.rules) { return Ruleset.prototype.variable.call(this.rules[0], name); } }, find: function() { if (this.rules) { return Ruleset.prototype.find.apply(this.rules[0], arguments); } }, rulesets: function() { if (this.rules) { return Ruleset.prototype.rulesets.apply(this.rules[0]); } }, outputRuleset: function(context, output, rules) { var ruleCnt = rules.length; var i; context.tabLevel = (context.tabLevel | 0) + 1; if (context.compress) { output.add("{"); for (i = 0; i < ruleCnt; i++) { rules[i].genCSS(context, output); } output.add("}"); context.tabLevel--; return; } var tabSetStr = "\n".concat(Array(context.tabLevel).join(" ")), tabRuleStr = "".concat(tabSetStr, " "); if (!ruleCnt) { output.add(" {".concat(tabSetStr, "}")); } else { output.add(" {".concat(tabRuleStr)); rules[0].genCSS(context, output); for (i = 1; i < ruleCnt; i++) { output.add(tabRuleStr); rules[i].genCSS(context, output); } output.add("".concat(tabSetStr, "}")); } context.tabLevel--; } })); var DetachedRuleset = function(ruleset, frames) { this.ruleset = ruleset; this.frames = frames; this.setParent(this.ruleset, this); }; DetachedRuleset.prototype = Object.assign(new Node2(), { type: "DetachedRuleset", evalFirst: true, accept: function(visitor) { this.ruleset = visitor.visit(this.ruleset); }, eval: function(context) { var frames = this.frames || copyArray(context.frames); return new DetachedRuleset(this.ruleset, frames); }, callEval: function(context) { return this.ruleset.eval(this.frames ? new contexts.Eval(context, this.frames.concat(context.frames)) : context); } }); var MATH = Math$1; var Operation = function(op, operands, isSpaced) { this.op = op.trim(); this.operands = operands; this.isSpaced = isSpaced; }; Operation.prototype = Object.assign(new Node2(), { type: "Operation", accept: function(visitor) { this.operands = visitor.visitArray(this.operands); }, eval: function(context) { var a = this.operands[0].eval(context), b2 = this.operands[1].eval(context), op; if (context.isMathOn(this.op)) { op = this.op === "./" ? "/" : this.op; if (a instanceof Dimension && b2 instanceof Color) { a = a.toColor(); } if (b2 instanceof Dimension && a instanceof Color) { b2 = b2.toColor(); } if (!a.operate || !b2.operate) { if ((a instanceof Operation || b2 instanceof Operation) && a.op === "/" && context.math === MATH.PARENS_DIVISION) { return new Operation(this.op, [a, b2], this.isSpaced); } throw { type: "Operation", message: "Operation on an invalid type" }; } return a.operate(context, op, b2); } else { return new Operation(this.op, [a, b2], this.isSpaced); } }, genCSS: function(context, output) { this.operands[0].genCSS(context, output); if (this.isSpaced) { output.add(" "); } output.add(this.op); if (this.isSpaced) { output.add(" "); } this.operands[1].genCSS(context, output); } }); var functionCaller = ( /** @class */ (function() { function functionCaller2(name, context, index2, currentFileInfo) { this.name = name.toLowerCase(); this.index = index2; this.context = context; this.currentFileInfo = currentFileInfo; this.func = context.frames[0].functionRegistry.get(this.name); } functionCaller2.prototype.isValid = function() { return Boolean(this.func); }; functionCaller2.prototype.call = function(args) { var _this = this; if (!Array.isArray(args)) { args = [args]; } var evalArgs = this.func.evalArgs; if (evalArgs !== false) { args = args.map(function(a) { return a.eval(_this.context); }); } var commentFilter = function(item) { return !(item.type === "Comment"); }; args = args.filter(commentFilter).map(function(item) { if (item.type === "Expression") { var subNodes = item.value.filter(commentFilter); if (subNodes.length === 1) { if (item.parens && subNodes[0].op === "/") { return item; } return subNodes[0]; } else { return new Expression(subNodes); } } return item; }); if (evalArgs === false) { return this.func.apply(this, __spreadArray2([this.context], args, false)); } return this.func.apply(this, args); }; return functionCaller2; })() ); var Call = function(name, args, index2, currentFileInfo) { this.name = name; this.args = args; this.calc = name === "calc"; this._index = index2; this._fileInfo = currentFileInfo; }; Call.prototype = Object.assign(new Node2(), { type: "Call", accept: function(visitor) { if (this.args) { this.args = visitor.visitArray(this.args); } }, // // When evaluating a function call, // we either find the function in the functionRegistry, // in which case we call it, passing the evaluated arguments, // if this returns null or we cannot find the function, we // simply print it out as it appeared originally [2]. // // The reason why we evaluate the arguments, is in the case where // we try to pass a variable to a function, like: `saturate(@color)`. // The function should receive the value, not the variable. // eval: function(context) { var _this = this; var currentMathContext = context.mathOn; context.mathOn = !this.calc; if (this.calc || context.inCalc) { context.enterCalc(); } var exitCalc = function() { if (_this.calc || context.inCalc) { context.exitCalc(); } context.mathOn = currentMathContext; }; var result; var funcCaller = new functionCaller(this.name, context, this.getIndex(), this.fileInfo()); if (funcCaller.isValid()) { try { result = funcCaller.call(this.args); exitCalc(); } catch (e2) { if (e2.hasOwnProperty("line") && e2.hasOwnProperty("column")) { throw e2; } throw { type: e2.type || "Runtime", message: "Error evaluating function `".concat(this.name, "`").concat(e2.message ? ": ".concat(e2.message) : ""), index: this.getIndex(), filename: this.fileInfo().filename, line: e2.lineNumber, column: e2.columnNumber }; } } if (result !== null && result !== void 0) { if (!(result instanceof Node2)) { if (!result || result === true) { result = new Anonymous(null); } else { result = new Anonymous(result.toString()); } } result._index = this._index; result._fileInfo = this._fileInfo; return result; } var args = this.args.map(function(a) { return a.eval(context); }); exitCalc(); return new Call(this.name, args, this.getIndex(), this.fileInfo()); }, genCSS: function(context, output) { output.add("".concat(this.name, "("), this.fileInfo(), this.getIndex()); for (var i_1 = 0; i_1 < this.args.length; i_1++) { this.args[i_1].genCSS(context, output); if (i_1 + 1 < this.args.length) { output.add(", "); } } output.add(")"); } }); var Variable = function(name, index2, currentFileInfo) { this.name = name; this._index = index2; this._fileInfo = currentFileInfo; }; Variable.prototype = Object.assign(new Node2(), { type: "Variable", eval: function(context) { var variable, name = this.name; if (name.indexOf("@@") === 0) { name = "@".concat(new Variable(name.slice(1), this.getIndex(), this.fileInfo()).eval(context).value); } if (this.evaluating) { throw { type: "Name", message: "Recursive variable definition for ".concat(name), filename: this.fileInfo().filename, index: this.getIndex() }; } this.evaluating = true; variable = this.find(context.frames, function(frame) { var v2 = frame.variable(name); if (v2) { if (v2.important) { var importantScope = context.importantScope[context.importantScope.length - 1]; importantScope.important = v2.important; } if (context.inCalc) { return new Call("_SELF", [v2.value]).eval(context); } else { return v2.value.eval(context); } } }); if (variable) { this.evaluating = false; return variable; } else { throw { type: "Name", message: "variable ".concat(name, " is undefined"), filename: this.fileInfo().filename, index: this.getIndex() }; } }, find: function(obj, fun) { for (var i_1 = 0, r = void 0; i_1 < obj.length; i_1++) { r = fun.call(obj, obj[i_1]); if (r) { return r; } } return null; } }); var Property = function(name, index2, currentFileInfo) { this.name = name; this._index = index2; this._fileInfo = currentFileInfo; }; Property.prototype = Object.assign(new Node2(), { type: "Property", eval: function(context) { var property; var name = this.name; var mergeRules = context.pluginManager.less.visitors.ToCSSVisitor.prototype._mergeRules; if (this.evaluating) { throw { type: "Name", message: "Recursive property reference for ".concat(name), filename: this.fileInfo().filename, index: this.getIndex() }; } this.evaluating = true; property = this.find(context.frames, function(frame) { var v2; var vArr = frame.property(name); if (vArr) { for (var i_1 = 0; i_1 < vArr.length; i_1++) { v2 = vArr[i_1]; vArr[i_1] = new Declaration(v2.name, v2.value, v2.important, v2.merge, v2.index, v2.currentFileInfo, v2.inline, v2.variable); } mergeRules(vArr); v2 = vArr[vArr.length - 1]; if (v2.important) { var importantScope = context.importantScope[context.importantScope.length - 1]; importantScope.important = v2.important; } v2 = v2.value.eval(context); return v2; } }); if (property) { this.evaluating = false; return property; } else { throw { type: "Name", message: "Property '".concat(name, "' is undefined"), filename: this.currentFileInfo.filename, index: this.index }; } }, find: function(obj, fun) { for (var i_2 = 0, r = void 0; i_2 < obj.length; i_2++) { r = fun.call(obj, obj[i_2]); if (r) { return r; } } return null; } }); var Attribute = function(key2, op, value, cif) { this.key = key2; this.op = op; this.value = value; this.cif = cif; }; Attribute.prototype = Object.assign(new Node2(), { type: "Attribute", eval: function(context) { return new Attribute(this.key.eval ? this.key.eval(context) : this.key, this.op, this.value && this.value.eval ? this.value.eval(context) : this.value, this.cif); }, genCSS: function(context, output) { output.add(this.toCSS(context)); }, toCSS: function(context) { var value = this.key.toCSS ? this.key.toCSS(context) : this.key; if (this.op) { value += this.op; value += this.value.toCSS ? this.value.toCSS(context) : this.value; } if (this.cif) { value = value + " " + this.cif; } return "[".concat(value, "]"); } }); var Quoted = function(str, content, escaped, index2, currentFileInfo) { this.escaped = escaped === void 0 ? true : escaped; this.value = content || ""; this.quote = str.charAt(0); this._index = index2; this._fileInfo = currentFileInfo; this.variableRegex = /@\{([\w-]+)\}/g; this.propRegex = /\$\{([\w-]+)\}/g; this.allowRoot = escaped; }; Quoted.prototype = Object.assign(new Node2(), { type: "Quoted", genCSS: function(context, output) { if (!this.escaped) { output.add(this.quote, this.fileInfo(), this.getIndex()); } output.add(this.value); if (!this.escaped) { output.add(this.quote); } }, containsVariables: function() { return this.value.match(this.variableRegex); }, eval: function(context) { var that = this; var value = this.value; var variableReplacement = function(_2, name1, name2) { var v2 = new Variable("@".concat(name1 !== null && name1 !== void 0 ? name1 : name2), that.getIndex(), that.fileInfo()).eval(context, true); return v2 instanceof Quoted ? v2.value : v2.toCSS(); }; var propertyReplacement = function(_2, name1, name2) { var v2 = new Property("$".concat(name1 !== null && name1 !== void 0 ? name1 : name2), that.getIndex(), that.fileInfo()).eval(context, true); return v2 instanceof Quoted ? v2.value : v2.toCSS(); }; function iterativeReplace(value2, regexp, replacementFnc) { var evaluatedValue = value2; do { value2 = evaluatedValue.toString(); evaluatedValue = value2.replace(regexp, replacementFnc); } while (value2 !== evaluatedValue); return evaluatedValue; } value = iterativeReplace(value, this.variableRegex, variableReplacement); value = iterativeReplace(value, this.propRegex, propertyReplacement); return new Quoted(this.quote + value + this.quote, value, this.escaped, this.getIndex(), this.fileInfo()); }, compare: function(other) { if (other.type === "Quoted" && !this.escaped && !other.escaped) { return Node2.numericCompare(this.value, other.value); } else { return other.toCSS && this.toCSS() === other.toCSS() ? 0 : void 0; } } }); function escapePath(path) { return path.replace(/[()'"\s]/g, function(match) { return "\\".concat(match); }); } var URL2 = function(val, index2, currentFileInfo, isEvald) { this.value = val; this._index = index2; this._fileInfo = currentFileInfo; this.isEvald = isEvald; }; URL2.prototype = Object.assign(new Node2(), { type: "Url", accept: function(visitor) { this.value = visitor.visit(this.value); }, genCSS: function(context, output) { output.add("url("); this.value.genCSS(context, output); output.add(")"); }, eval: function(context) { var val = this.value.eval(context); var rootpath; if (!this.isEvald) { rootpath = this.fileInfo() && this.fileInfo().rootpath; if (typeof rootpath === "string" && typeof val.value === "string" && context.pathRequiresRewrite(val.value)) { if (!val.quote) { rootpath = escapePath(rootpath); } val.value = context.rewritePath(val.value, rootpath); } else { val.value = context.normalizePath(val.value); } if (context.urlArgs) { if (!val.value.match(/^\s*data:/)) { var delimiter = val.value.indexOf("?") === -1 ? "?" : "&"; var urlArgs = delimiter + context.urlArgs; if (val.value.indexOf("#") !== -1) { val.value = val.value.replace("#", "".concat(urlArgs, "#")); } else { val.value += urlArgs; } } } } return new URL2(val, this.getIndex(), this.fileInfo(), true); } }); var Media = function(value, features, index2, currentFileInfo, visibilityInfo) { this._index = index2; this._fileInfo = currentFileInfo; var selectors = new Selector([], null, null, this._index, this._fileInfo).createEmptySelectors(); this.features = new Value2(features); this.rules = [new Ruleset(selectors, value)]; this.rules[0].allowImports = true; this.copyVisibilityInfo(visibilityInfo); this.allowRoot = true; this.setParent(selectors, this); this.setParent(this.features, this); this.setParent(this.rules, this); }; Media.prototype = Object.assign(new AtRule(), __assign2(__assign2({ type: "Media" }, NestableAtRulePrototype), { genCSS: function(context, output) { output.add("@media ", this._fileInfo, this._index); this.features.genCSS(context, output); this.outputRuleset(context, output, this.rules); }, eval: function(context) { if (!context.mediaBlocks) { context.mediaBlocks = []; context.mediaPath = []; } var media = new Media(null, [], this._index, this._fileInfo, this.visibilityInfo()); if (this.debugInfo) { this.rules[0].debugInfo = this.debugInfo; media.debugInfo = this.debugInfo; } media.features = this.features.eval(context); context.mediaPath.push(media); context.mediaBlocks.push(media); this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit(); context.frames.unshift(this.rules[0]); media.rules = [this.rules[0].eval(context)]; context.frames.shift(); context.mediaPath.pop(); return context.mediaPath.length === 0 ? media.evalTop(context) : media.evalNested(context); } })); var Import = function(path, features, options3, index2, currentFileInfo, visibilityInfo) { this.options = options3; this._index = index2; this._fileInfo = currentFileInfo; this.path = path; this.features = features; this.allowRoot = true; if (this.options.less !== void 0 || this.options.inline) { this.css = !this.options.less || this.options.inline; } else { var pathValue = this.getPath(); if (pathValue && /[#.&?]css([?;].*)?$/.test(pathValue)) { this.css = true; } } this.copyVisibilityInfo(visibilityInfo); this.setParent(this.features, this); this.setParent(this.path, this); }; Import.prototype = Object.assign(new Node2(), { type: "Import", accept: function(visitor) { if (this.features) { this.features = visitor.visit(this.features); } this.path = visitor.visit(this.path); if (!this.options.isPlugin && !this.options.inline && this.root) { this.root = visitor.visit(this.root); } }, genCSS: function(context, output) { if (this.css && this.path._fileInfo.reference === void 0) { output.add("@import ", this._fileInfo, this._index); this.path.genCSS(context, output); if (this.features) { output.add(" "); this.features.genCSS(context, output); } output.add(";"); } }, getPath: function() { return this.path instanceof URL2 ? this.path.value.value : this.path.value; }, isVariableImport: function() { var path = this.path; if (path instanceof URL2) { path = path.value; } if (path instanceof Quoted) { return path.containsVariables(); } return true; }, evalForImport: function(context) { var path = this.path; if (path instanceof URL2) { path = path.value; } return new Import(path.eval(context), this.features, this.options, this._index, this._fileInfo, this.visibilityInfo()); }, evalPath: function(context) { var path = this.path.eval(context); var fileInfo = this._fileInfo; if (!(path instanceof URL2)) { var pathValue = path.value; if (fileInfo && pathValue && context.pathRequiresRewrite(pathValue)) { path.value = context.rewritePath(pathValue, fileInfo.rootpath); } else { path.value = context.normalizePath(path.value); } } return path; }, eval: function(context) { var result = this.doEval(context); if (this.options.reference || this.blocksVisibility()) { if (result.length || result.length === 0) { result.forEach(function(node) { node.addVisibilityBlock(); }); } else { result.addVisibilityBlock(); } } return result; }, doEval: function(context) { var ruleset; var registry; var features = this.features && this.features.eval(context); if (this.options.isPlugin) { if (this.root && this.root.eval) { try { this.root.eval(context); } catch (e2) { e2.message = "Plugin error during evaluation"; throw new LessError(e2, this.root.imports, this.root.filename); } } registry = context.frames[0] && context.frames[0].functionRegistry; if (registry && this.root && this.root.functions) { registry.addMultiple(this.root.functions); } return []; } if (this.skip) { if (typeof this.skip === "function") { this.skip = this.skip(); } if (this.skip) { return []; } } if (this.features) { var featureValue = this.features.value; if (Array.isArray(featureValue) && featureValue.length >= 1) { var expr = featureValue[0]; if (expr.type === "Expression" && Array.isArray(expr.value) && expr.value.length >= 2) { featureValue = expr.value; var isLayer = featureValue[0].type === "Keyword" && featureValue[0].value === "layer" && featureValue[1].type === "Paren"; if (isLayer) { this.css = false; } } } } if (this.options.inline) { var contents = new Anonymous(this.root, 0, { filename: this.importedFilename, reference: this.path._fileInfo && this.path._fileInfo.reference }, true, true); return this.features ? new Media([contents], this.features.value) : [contents]; } else if (this.css || this.layerCss) { var newImport = new Import(this.evalPath(context), features, this.options, this._index); if (this.layerCss) { newImport.css = this.layerCss; newImport.path._fileInfo = this._fileInfo; } if (!newImport.css && this.error) { throw this.error; } return newImport; } else if (this.root) { if (this.features) { var featureValue = this.features.value; if (Array.isArray(featureValue) && featureValue.length === 1) { var expr = featureValue[0]; if (expr.type === "Expression" && Array.isArray(expr.value) && expr.value.length >= 2) { featureValue = expr.value; var isLayer = featureValue[0].type === "Keyword" && featureValue[0].value === "layer" && featureValue[1].type === "Paren"; if (isLayer) { this.layerCss = true; featureValue[0] = new Expression(featureValue.slice(0, 2)); featureValue.splice(1, 1); featureValue[0].noSpacing = true; return this; } } } } ruleset = new Ruleset(null, copyArray(this.root.rules)); ruleset.evalImports(context); return this.features ? new Media(ruleset.rules, this.features.value) : ruleset.rules; } else { if (this.features) { var featureValue = this.features.value; if (Array.isArray(featureValue) && featureValue.length >= 1) { featureValue = featureValue[0].value; if (Array.isArray(featureValue) && featureValue.length >= 2) { var isLayer = featureValue[0].type === "Keyword" && featureValue[0].value === "layer" && featureValue[1].type === "Paren"; if (isLayer) { this.css = true; featureValue[0] = new Expression(featureValue.slice(0, 2)); featureValue.splice(1, 1); featureValue[0].noSpacing = true; return this; } } } } return []; } } }); var JsEvalNode = function() { }; JsEvalNode.prototype = Object.assign(new Node2(), { evaluateJavaScript: function(expression, context) { var result; var that = this; var evalContext = {}; if (!context.javascriptEnabled) { throw { message: "Inline JavaScript is not enabled. Is it set in your options?", filename: this.fileInfo().filename, index: this.getIndex() }; } expression = expression.replace(/@\{([\w-]+)\}/g, function(_2, name) { return that.jsify(new Variable("@".concat(name), that.getIndex(), that.fileInfo()).eval(context)); }); try { expression = new Function("return (".concat(expression, ")")); } catch (e2) { throw { message: "JavaScript evaluation error: ".concat(e2.message, " from `").concat(expression, "`"), filename: this.fileInfo().filename, index: this.getIndex() }; } var variables = context.frames[0].variables(); for (var k2 in variables) { if (variables.hasOwnProperty(k2)) { evalContext[k2.slice(1)] = { value: variables[k2].value, toJS: function() { return this.value.eval(context).toCSS(); } }; } } try { result = expression.call(evalContext); } catch (e2) { throw { message: "JavaScript evaluation error: '".concat(e2.name, ": ").concat(e2.message.replace(/["]/g, "'"), "'"), filename: this.fileInfo().filename, index: this.getIndex() }; } return result; }, jsify: function(obj) { if (Array.isArray(obj.value) && obj.value.length > 1) { return "[".concat(obj.value.map(function(v2) { return v2.toCSS(); }).join(", "), "]"); } else { return obj.toCSS(); } } }); var JavaScript = function(string2, escaped, index2, currentFileInfo) { this.escaped = escaped; this.expression = string2; this._index = index2; this._fileInfo = currentFileInfo; }; JavaScript.prototype = Object.assign(new JsEvalNode(), { type: "JavaScript", eval: function(context) { var result = this.evaluateJavaScript(this.expression, context); var type = typeof result; if (type === "number" && !isNaN(result)) { return new Dimension(result); } else if (type === "string") { return new Quoted('"'.concat(result, '"'), result, this.escaped, this._index); } else if (Array.isArray(result)) { return new Anonymous(result.join(", ")); } else { return new Anonymous(result); } } }); var Assignment = function(key2, val) { this.key = key2; this.value = val; }; Assignment.prototype = Object.assign(new Node2(), { type: "Assignment", accept: function(visitor) { this.value = visitor.visit(this.value); }, eval: function(context) { if (this.value.eval) { return new Assignment(this.key, this.value.eval(context)); } return this; }, genCSS: function(context, output) { output.add("".concat(this.key, "=")); if (this.value.genCSS) { this.value.genCSS(context, output); } else { output.add(this.value); } } }); var Condition = function(op, l, r, i, negate) { this.op = op.trim(); this.lvalue = l; this.rvalue = r; this._index = i; this.negate = negate; }; Condition.prototype = Object.assign(new Node2(), { type: "Condition", accept: function(visitor) { this.lvalue = visitor.visit(this.lvalue); this.rvalue = visitor.visit(this.rvalue); }, eval: function(context) { var result = (function(op, a, b2) { switch (op) { case "and": return a && b2; case "or": return a || b2; default: switch (Node2.compare(a, b2)) { case -1: return op === "<" || op === "=<" || op === "<="; case 0: return op === "=" || op === ">=" || op === "=<" || op === "<="; case 1: return op === ">" || op === ">="; default: return false; } } })(this.op, this.lvalue.eval(context), this.rvalue.eval(context)); return this.negate ? !result : result; } }); var QueryInParens = function(op, l, m, op2, r, i) { this.op = op.trim(); this.lvalue = l; this.mvalue = m; this.op2 = op2 ? op2.trim() : null; this.rvalue = r; this._index = i; this.mvalues = []; }; QueryInParens.prototype = Object.assign(new Node2(), { type: "QueryInParens", accept: function(visitor) { this.lvalue = visitor.visit(this.lvalue); this.mvalue = visitor.visit(this.mvalue); if (this.rvalue) { this.rvalue = visitor.visit(this.rvalue); } }, eval: function(context) { this.lvalue = this.lvalue.eval(context); var variableDeclaration; var rule; for (var i_1 = 0; rule = context.frames[i_1]; i_1++) { if (rule.type === "Ruleset") { variableDeclaration = rule.rules.find(function(r) { if (r instanceof Declaration && r.variable) { return true; } return false; }); if (variableDeclaration) { break; } } } if (!this.mvalueCopy) { this.mvalueCopy = copy(this.mvalue); } if (variableDeclaration) { this.mvalue = this.mvalueCopy; this.mvalue = this.mvalue.eval(context); this.mvalues.push(this.mvalue); } else { this.mvalue = this.mvalue.eval(context); } if (this.rvalue) { this.rvalue = this.rvalue.eval(context); } return this; }, genCSS: function(context, output) { this.lvalue.genCSS(context, output); output.add(" " + this.op + " "); if (this.mvalues.length > 0) { this.mvalue = this.mvalues.shift(); } this.mvalue.genCSS(context, output); if (this.rvalue) { output.add(" " + this.op2 + " "); this.rvalue.genCSS(context, output); } } }); var Container = function(value, features, index2, currentFileInfo, visibilityInfo) { this._index = index2; this._fileInfo = currentFileInfo; var selectors = new Selector([], null, null, this._index, this._fileInfo).createEmptySelectors(); this.features = new Value2(features); this.rules = [new Ruleset(selectors, value)]; this.rules[0].allowImports = true; this.copyVisibilityInfo(visibilityInfo); this.allowRoot = true; this.setParent(selectors, this); this.setParent(this.features, this); this.setParent(this.rules, this); }; Container.prototype = Object.assign(new AtRule(), __assign2(__assign2({ type: "Container" }, NestableAtRulePrototype), { genCSS: function(context, output) { output.add("@container ", this._fileInfo, this._index); this.features.genCSS(context, output); this.outputRuleset(context, output, this.rules); }, eval: function(context) { if (!context.mediaBlocks) { context.mediaBlocks = []; context.mediaPath = []; } var media = new Container(null, [], this._index, this._fileInfo, this.visibilityInfo()); if (this.debugInfo) { this.rules[0].debugInfo = this.debugInfo; media.debugInfo = this.debugInfo; } media.features = this.features.eval(context); context.mediaPath.push(media); context.mediaBlocks.push(media); this.rules[0].functionRegistry = context.frames[0].functionRegistry.inherit(); context.frames.unshift(this.rules[0]); media.rules = [this.rules[0].eval(context)]; context.frames.shift(); context.mediaPath.pop(); return context.mediaPath.length === 0 ? media.evalTop(context) : media.evalNested(context); } })); var UnicodeDescriptor = function(value) { this.value = value; }; UnicodeDescriptor.prototype = Object.assign(new Node2(), { type: "UnicodeDescriptor" }); var Negative = function(node) { this.value = node; }; Negative.prototype = Object.assign(new Node2(), { type: "Negative", genCSS: function(context, output) { output.add("-"); this.value.genCSS(context, output); }, eval: function(context) { if (context.isMathOn()) { return new Operation("*", [new Dimension(-1), this.value]).eval(context); } return new Negative(this.value.eval(context)); } }); var Extend = function(selector, option, index2, currentFileInfo, visibilityInfo) { this.selector = selector; this.option = option; this.object_id = Extend.next_id++; this.parent_ids = [this.object_id]; this._index = index2; this._fileInfo = currentFileInfo; this.copyVisibilityInfo(visibilityInfo); this.allowRoot = true; switch (option) { case "!all": case "all": this.allowBefore = true; this.allowAfter = true; break; default: this.allowBefore = false; this.allowAfter = false; break; } this.setParent(this.selector, this); }; Extend.prototype = Object.assign(new Node2(), { type: "Extend", accept: function(visitor) { this.selector = visitor.visit(this.selector); }, eval: function(context) { return new Extend(this.selector.eval(context), this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo()); }, // remove when Nodes have JSDoc types // eslint-disable-next-line no-unused-vars clone: function(context) { return new Extend(this.selector, this.option, this.getIndex(), this.fileInfo(), this.visibilityInfo()); }, // it concatenates (joins) all selectors in selector array findSelfSelectors: function(selectors) { var selfElements = [], i, selectorElements; for (i = 0; i < selectors.length; i++) { selectorElements = selectors[i].elements; if (i > 0 && selectorElements.length && selectorElements[0].combinator.value === "") { selectorElements[0].combinator.value = " "; } selfElements = selfElements.concat(selectors[i].elements); } this.selfSelectors = [new Selector(selfElements)]; this.selfSelectors[0].copyVisibilityInfo(this.visibilityInfo()); } }); Extend.next_id = 0; var VariableCall = function(variable, index2, currentFileInfo) { this.variable = variable; this._index = index2; this._fileInfo = currentFileInfo; this.allowRoot = true; }; VariableCall.prototype = Object.assign(new Node2(), { type: "VariableCall", eval: function(context) { var rules; var detachedRuleset = new Variable(this.variable, this.getIndex(), this.fileInfo()).eval(context); var error = new LessError({ message: "Could not evaluate variable call ".concat(this.variable) }); if (!detachedRuleset.ruleset) { if (detachedRuleset.rules) { rules = detachedRuleset; } else if (Array.isArray(detachedRuleset)) { rules = new Ruleset("", detachedRuleset); } else if (Array.isArray(detachedRuleset.value)) { rules = new Ruleset("", detachedRuleset.value); } else { throw error; } detachedRuleset = new DetachedRuleset(rules); } if (detachedRuleset.ruleset) { return detachedRuleset.callEval(context); } throw error; } }); var NamespaceValue = function(ruleCall, lookups, index2, fileInfo) { this.value = ruleCall; this.lookups = lookups; this._index = index2; this._fileInfo = fileInfo; }; NamespaceValue.prototype = Object.assign(new Node2(), { type: "NamespaceValue", eval: function(context) { var i, name, rules = this.value.eval(context); for (i = 0; i < this.lookups.length; i++) { name = this.lookups[i]; if (Array.isArray(rules)) { rules = new Ruleset([new Selector()], rules); } if (name === "") { rules = rules.lastDeclaration(); } else if (name.charAt(0) === "@") { if (name.charAt(1) === "@") { name = "@".concat(new Variable(name.substr(1)).eval(context).value); } if (rules.variables) { rules = rules.variable(name); } if (!rules) { throw { type: "Name", message: "variable ".concat(name, " not found"), filename: this.fileInfo().filename, index: this.getIndex() }; } } else { if (name.substring(0, 2) === "$@") { name = "$".concat(new Variable(name.substr(1)).eval(context).value); } else { name = name.charAt(0) === "$" ? name : "$".concat(name); } if (rules.properties) { rules = rules.property(name); } if (!rules) { throw { type: "Name", message: 'property "'.concat(name.substr(1), '" not found'), filename: this.fileInfo().filename, index: this.getIndex() }; } rules = rules[rules.length - 1]; } if (rules.value) { rules = rules.eval(context).value; } if (rules.ruleset) { rules = rules.ruleset.eval(context); } } return rules; } }); var Definition = function(name, params, rules, condition, variadic, frames, visibilityInfo) { this.name = name || "anonymous mixin"; this.selectors = [new Selector([new Element2(null, name, false, this._index, this._fileInfo)])]; this.params = params; this.condition = condition; this.variadic = variadic; this.arity = params.length; this.rules = rules; this._lookups = {}; var optionalParameters = []; this.required = params.reduce(function(count3, p2) { if (!p2.name || p2.name && !p2.value) { return count3 + 1; } else { optionalParameters.push(p2.name); return count3; } }, 0); this.optionalParameters = optionalParameters; this.frames = frames; this.copyVisibilityInfo(visibilityInfo); this.allowRoot = true; }; Definition.prototype = Object.assign(new Ruleset(), { type: "MixinDefinition", evalFirst: true, accept: function(visitor) { if (this.params && this.params.length) { this.params = visitor.visitArray(this.params); } this.rules = visitor.visitArray(this.rules); if (this.condition) { this.condition = visitor.visit(this.condition); } }, evalParams: function(context, mixinEnv, args, evaldArguments) { var frame = new Ruleset(null, null); var varargs; var arg; var params = copyArray(this.params); var i; var j2; var val; var name; var isNamedFound; var argIndex; var argsLength = 0; if (mixinEnv.frames && mixinEnv.frames[0] && mixinEnv.frames[0].functionRegistry) { frame.functionRegistry = mixinEnv.frames[0].functionRegistry.inherit(); } mixinEnv = new contexts.Eval(mixinEnv, [frame].concat(mixinEnv.frames)); if (args) { args = copyArray(args); argsLength = args.length; for (i = 0; i < argsLength; i++) { arg = args[i]; if (name = arg && arg.name) { isNamedFound = false; for (j2 = 0; j2 < params.length; j2++) { if (!evaldArguments[j2] && name === params[j2].name) { evaldArguments[j2] = arg.value.eval(context); frame.prependRule(new Declaration(name, arg.value.eval(context))); isNamedFound = true; break; } } if (isNamedFound) { args.splice(i, 1); i--; continue; } else { throw { type: "Runtime", message: "Named argument for ".concat(this.name, " ").concat(args[i].name, " not found") }; } } } } argIndex = 0; for (i = 0; i < params.length; i++) { if (evaldArguments[i]) { continue; } arg = args && args[argIndex]; if (name = params[i].name) { if (params[i].variadic) { varargs = []; for (j2 = argIndex; j2 < argsLength; j2++) { varargs.push(args[j2].value.eval(context)); } frame.prependRule(new Declaration(name, new Expression(varargs).eval(context))); } else { val = arg && arg.value; if (val) { if (Array.isArray(val)) { val = new DetachedRuleset(new Ruleset("", val)); } else { val = val.eval(context); } } else if (params[i].value) { val = params[i].value.eval(mixinEnv); frame.resetCache(); } else { throw { type: "Runtime", message: "wrong number of arguments for ".concat(this.name, " (").concat(argsLength, " for ").concat(this.arity, ")") }; } frame.prependRule(new Declaration(name, val)); evaldArguments[i] = val; } } if (params[i].variadic && args) { for (j2 = argIndex; j2 < argsLength; j2++) { evaldArguments[j2] = args[j2].value.eval(context); } } argIndex++; } return frame; }, makeImportant: function() { var rules = !this.rules ? this.rules : this.rules.map(function(r) { if (r.makeImportant) { return r.makeImportant(true); } else { return r; } }); var result = new Definition(this.name, this.params, rules, this.condition, this.variadic, this.frames); return result; }, eval: function(context) { return new Definition(this.name, this.params, this.rules, this.condition, this.variadic, this.frames || copyArray(context.frames)); }, evalCall: function(context, args, important) { var _arguments = []; var mixinFrames = this.frames ? this.frames.concat(context.frames) : context.frames; var frame = this.evalParams(context, new contexts.Eval(context, mixinFrames), args, _arguments); var rules; var ruleset; frame.prependRule(new Declaration("@arguments", new Expression(_arguments).eval(context))); rules = copyArray(this.rules); ruleset = new Ruleset(null, rules); ruleset.originalRuleset = this; ruleset = ruleset.eval(new contexts.Eval(context, [this, frame].concat(mixinFrames))); if (important) { ruleset = ruleset.makeImportant(); } return ruleset; }, matchCondition: function(args, context) { if (this.condition && !this.condition.eval(new contexts.Eval(context, [this.evalParams( context, /* the parameter variables */ new contexts.Eval(context, this.frames ? this.frames.concat(context.frames) : context.frames), args, [] )].concat(this.frames || []).concat(context.frames)))) { return false; } return true; }, matchArgs: function(args, context) { var allArgsCnt = args && args.length || 0; var len; var optionalParameters = this.optionalParameters; var requiredArgsCnt = !args ? 0 : args.reduce(function(count3, p2) { if (optionalParameters.indexOf(p2.name) < 0) { return count3 + 1; } else { return count3; } }, 0); if (!this.variadic) { if (requiredArgsCnt < this.required) { return false; } if (allArgsCnt > this.params.length) { return false; } } else { if (requiredArgsCnt < this.required - 1) { return false; } } len = Math.min(requiredArgsCnt, this.arity); for (var i_1 = 0; i_1 < len; i_1++) { if (!this.params[i_1].name && !this.params[i_1].variadic) { if (args[i_1].value.eval(context).toCSS() != this.params[i_1].value.eval(context).toCSS()) { return false; } } } return true; } }); var MixinCall = function(elements, args, index2, currentFileInfo, important) { this.selector = new Selector(elements); this.arguments = args || []; this._index = index2; this._fileInfo = currentFileInfo; this.important = important; this.allowRoot = true; this.setParent(this.selector, this); }; MixinCall.prototype = Object.assign(new Node2(), { type: "MixinCall", accept: function(visitor) { if (this.selector) { this.selector = visitor.visit(this.selector); } if (this.arguments.length) { this.arguments = visitor.visitArray(this.arguments); } }, eval: function(context) { var mixins; var mixin; var mixinPath; var args = []; var arg; var argValue; var rules = []; var match = false; var i; var m; var f2; var isRecursive; var isOneFound; var candidates = []; var candidate; var conditionResult = []; var defaultResult; var defFalseEitherCase = -1; var defNone = 0; var defTrue = 1; var defFalse = 2; var count3; var originalRuleset; var noArgumentsFilter; this.selector = this.selector.eval(context); function calcDefGroup(mixin2, mixinPath2) { var f3, p2, namespace; for (f3 = 0; f3 < 2; f3++) { conditionResult[f3] = true; defaultFunc.value(f3); for (p2 = 0; p2 < mixinPath2.length && conditionResult[f3]; p2++) { namespace = mixinPath2[p2]; if (namespace.matchCondition) { conditionResult[f3] = conditionResult[f3] && namespace.matchCondition(null, context); } } if (mixin2.matchCondition) { conditionResult[f3] = conditionResult[f3] && mixin2.matchCondition(args, context); } } if (conditionResult[0] || conditionResult[1]) { if (conditionResult[0] != conditionResult[1]) { return conditionResult[1] ? defTrue : defFalse; } return defNone; } return defFalseEitherCase; } for (i = 0; i < this.arguments.length; i++) { arg = this.arguments[i]; argValue = arg.value.eval(context); if (arg.expand && Array.isArray(argValue.value)) { argValue = argValue.value; for (m = 0; m < argValue.length; m++) { args.push({ value: argValue[m] }); } } else { args.push({ name: arg.name, value: argValue }); } } noArgumentsFilter = function(rule) { return rule.matchArgs(null, context); }; for (i = 0; i < context.frames.length; i++) { if ((mixins = context.frames[i].find(this.selector, null, noArgumentsFilter)).length > 0) { isOneFound = true; for (m = 0; m < mixins.length; m++) { mixin = mixins[m].rule; mixinPath = mixins[m].path; isRecursive = false; for (f2 = 0; f2 < context.frames.length; f2++) { if (!(mixin instanceof Definition) && mixin === (context.frames[f2].originalRuleset || context.frames[f2])) { isRecursive = true; break; } } if (isRecursive) { continue; } if (mixin.matchArgs(args, context)) { candidate = { mixin, group: calcDefGroup(mixin, mixinPath) }; if (candidate.group !== defFalseEitherCase) { candidates.push(candidate); } match = true; } } defaultFunc.reset(); count3 = [0, 0, 0]; for (m = 0; m < candidates.length; m++) { count3[candidates[m].group]++; } if (count3[defNone] > 0) { defaultResult = defFalse; } else { defaultResult = defTrue; if (count3[defTrue] + count3[defFalse] > 1) { throw { type: "Runtime", message: "Ambiguous use of `default()` found when matching for `".concat(this.format(args), "`"), index: this.getIndex(), filename: this.fileInfo().filename }; } } for (m = 0; m < candidates.length; m++) { candidate = candidates[m].group; if (candidate === defNone || candidate === defaultResult) { try { mixin = candidates[m].mixin; if (!(mixin instanceof Definition)) { originalRuleset = mixin.originalRuleset || mixin; mixin = new Definition("", [], mixin.rules, null, false, null, originalRuleset.visibilityInfo()); mixin.originalRuleset = originalRuleset; } var newRules = mixin.evalCall(context, args, this.important).rules; this._setVisibilityToReplacement(newRules); Array.prototype.push.apply(rules, newRules); } catch (e2) { throw { message: e2.message, index: this.getIndex(), filename: this.fileInfo().filename, stack: e2.stack }; } } } if (match) { return rules; } } } if (isOneFound) { throw { type: "Runtime", message: "No matching definition was found for `".concat(this.format(args), "`"), index: this.getIndex(), filename: this.fileInfo().filename }; } else { throw { type: "Name", message: "".concat(this.selector.toCSS().trim(), " is undefined"), index: this.getIndex(), filename: this.fileInfo().filename }; } }, _setVisibilityToReplacement: function(replacement) { var i, rule; if (this.blocksVisibility()) { for (i = 0; i < replacement.length; i++) { rule = replacement[i]; rule.addVisibilityBlock(); } } }, format: function(args) { return "".concat(this.selector.toCSS().trim(), "(").concat(args ? args.map(function(a) { var argValue = ""; if (a.name) { argValue += "".concat(a.name, ":"); } if (a.value.toCSS) { argValue += a.value.toCSS(); } else { argValue += "???"; } return argValue; }).join(", ") : "", ")"); } }); var tree = { Node: Node2, Color, AtRule, DetachedRuleset, Operation, Dimension, Unit, Keyword, Variable, Property, Ruleset, Element: Element2, Attribute, Combinator, Selector, Quoted, Expression, Declaration, Call, URL: URL2, Import, Comment: Comment2, Anonymous, Value: Value2, JavaScript, Assignment, Condition, Paren, Media, Container, QueryInParens, UnicodeDescriptor, Negative, Extend, VariableCall, NamespaceValue, mixin: { Call: MixinCall, Definition } }; var AbstractFileManager = ( /** @class */ (function() { function AbstractFileManager2() { } AbstractFileManager2.prototype.getPath = function(filename) { var j2 = filename.lastIndexOf("?"); if (j2 > 0) { filename = filename.slice(0, j2); } j2 = filename.lastIndexOf("/"); if (j2 < 0) { j2 = filename.lastIndexOf("\\"); } if (j2 < 0) { return ""; } return filename.slice(0, j2 + 1); }; AbstractFileManager2.prototype.tryAppendExtension = function(path, ext) { return /(\.[a-z]*$)|([?;].*)$/.test(path) ? path : path + ext; }; AbstractFileManager2.prototype.tryAppendLessExtension = function(path) { return this.tryAppendExtension(path, ".less"); }; AbstractFileManager2.prototype.supportsSync = function() { return false; }; AbstractFileManager2.prototype.alwaysMakePathsAbsolute = function() { return false; }; AbstractFileManager2.prototype.isPathAbsolute = function(filename) { return /^(?:[a-z-]+:|\/|\\|#)/i.test(filename); }; AbstractFileManager2.prototype.join = function(basePath, laterPath) { if (!basePath) { return laterPath; } return basePath + laterPath; }; AbstractFileManager2.prototype.pathDiff = function(url, baseUrl) { var urlParts = this.extractUrlParts(url); var baseUrlParts = this.extractUrlParts(baseUrl); var i; var max2; var urlDirectories; var baseUrlDirectories; var diff = ""; if (urlParts.hostPart !== baseUrlParts.hostPart) { return ""; } max2 = Math.max(baseUrlParts.directories.length, urlParts.directories.length); for (i = 0; i < max2; i++) { if (baseUrlParts.directories[i] !== urlParts.directories[i]) { break; } } baseUrlDirectories = baseUrlParts.directories.slice(i); urlDirectories = urlParts.directories.slice(i); for (i = 0; i < baseUrlDirectories.length - 1; i++) { diff += "../"; } for (i = 0; i < urlDirectories.length - 1; i++) { diff += "".concat(urlDirectories[i], "/"); } return diff; }; AbstractFileManager2.prototype.extractUrlParts = function(url, baseUrl) { var urlPartsRegex = /^((?:[a-z-]+:)?\/{2}(?:[^/?#]*\/)|([/\\]))?((?:[^/\\?#]*[/\\])*)([^/\\?#]*)([#?].*)?$/i; var urlParts = url.match(urlPartsRegex); var returner = {}; var rawDirectories = []; var directories = []; var i; var baseUrlParts; if (!urlParts) { throw new Error("Could not parse sheet href - '".concat(url, "'")); } if (baseUrl && (!urlParts[1] || urlParts[2])) { baseUrlParts = baseUrl.match(urlPartsRegex); if (!baseUrlParts) { throw new Error("Could not parse page url - '".concat(baseUrl, "'")); } urlParts[1] = urlParts[1] || baseUrlParts[1] || ""; if (!urlParts[2]) { urlParts[3] = baseUrlParts[3] + urlParts[3]; } } if (urlParts[3]) { rawDirectories = urlParts[3].replace(/\\/g, "/").split("/"); for (i = 0; i < rawDirectories.length; i++) { if (rawDirectories[i] === "..") { directories.pop(); } else if (rawDirectories[i] !== ".") { directories.push(rawDirectories[i]); } } } returner.hostPart = urlParts[1]; returner.directories = directories; returner.rawPath = (urlParts[1] || "") + rawDirectories.join("/"); returner.path = (urlParts[1] || "") + directories.join("/"); returner.filename = urlParts[4]; returner.fileUrl = returner.path + (urlParts[4] || ""); returner.url = returner.fileUrl + (urlParts[5] || ""); return returner; }; return AbstractFileManager2; })() ); var AbstractPluginLoader = ( /** @class */ (function() { function AbstractPluginLoader2() { this.require = function() { return null; }; } AbstractPluginLoader2.prototype.evalPlugin = function(contents, context, imports, pluginOptions, fileInfo) { var loader, registry, pluginObj, localModule, pluginManager, filename, result; pluginManager = context.pluginManager; if (fileInfo) { if (typeof fileInfo === "string") { filename = fileInfo; } else { filename = fileInfo.filename; } } var shortname = new this.less.FileManager().extractUrlParts(filename).filename; if (filename) { pluginObj = pluginManager.get(filename); if (pluginObj) { result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions); if (result) { return result; } try { if (pluginObj.use) { pluginObj.use.call(this.context, pluginObj); } } catch (e2) { e2.message = e2.message || "Error during @plugin call"; return new LessError(e2, imports, filename); } return pluginObj; } } localModule = { exports: {}, pluginManager, fileInfo }; registry = functionRegistry.create(); var registerPlugin = function(obj) { pluginObj = obj; }; try { loader = new Function("module", "require", "registerPlugin", "functions", "tree", "less", "fileInfo", contents); loader(localModule, this.require(filename), registerPlugin, registry, this.less.tree, this.less, fileInfo); } catch (e2) { return new LessError(e2, imports, filename); } if (!pluginObj) { pluginObj = localModule.exports; } pluginObj = this.validatePlugin(pluginObj, filename, shortname); if (pluginObj instanceof LessError) { return pluginObj; } if (pluginObj) { pluginObj.imports = imports; pluginObj.filename = filename; if (!pluginObj.minVersion || this.compareVersion("3.0.0", pluginObj.minVersion) < 0) { result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions); if (result) { return result; } } pluginManager.addPlugin(pluginObj, fileInfo.filename, registry); pluginObj.functions = registry.getLocalFunctions(); result = this.trySetOptions(pluginObj, filename, shortname, pluginOptions); if (result) { return result; } try { if (pluginObj.use) { pluginObj.use.call(this.context, pluginObj); } } catch (e2) { e2.message = e2.message || "Error during @plugin call"; return new LessError(e2, imports, filename); } } else { return new LessError({ message: "Not a valid plugin" }, imports, filename); } return pluginObj; }; AbstractPluginLoader2.prototype.trySetOptions = function(plugin, filename, name, options3) { if (options3 && !plugin.setOptions) { return new LessError({ message: "Options have been provided but the plugin ".concat(name, " does not support any options.") }); } try { plugin.setOptions && plugin.setOptions(options3); } catch (e2) { return new LessError(e2); } }; AbstractPluginLoader2.prototype.validatePlugin = function(plugin, filename, name) { if (plugin) { if (typeof plugin === "function") { plugin = new plugin(); } if (plugin.minVersion) { if (this.compareVersion(plugin.minVersion, this.less.version) < 0) { return new LessError({ message: "Plugin ".concat(name, " requires version ").concat(this.versionToString(plugin.minVersion)) }); } } return plugin; } return null; }; AbstractPluginLoader2.prototype.compareVersion = function(aVersion, bVersion) { if (typeof aVersion === "string") { aVersion = aVersion.match(/^(\d+)\.?(\d+)?\.?(\d+)?/); aVersion.shift(); } for (var i_1 = 0; i_1 < aVersion.length; i_1++) { if (aVersion[i_1] !== bVersion[i_1]) { return parseInt(aVersion[i_1]) > parseInt(bVersion[i_1]) ? -1 : 1; } } return 0; }; AbstractPluginLoader2.prototype.versionToString = function(version2) { var versionString = ""; for (var i_2 = 0; i_2 < version2.length; i_2++) { versionString += (versionString ? "." : "") + version2[i_2]; } return versionString; }; AbstractPluginLoader2.prototype.printUsage = function(plugins2) { for (var i_3 = 0; i_3 < plugins2.length; i_3++) { var plugin = plugins2[i_3]; if (plugin.printUsage) { plugin.printUsage(); } } }; return AbstractPluginLoader2; })() ); function boolean(condition) { return condition ? Keyword.True : Keyword.False; } function If(context, condition, trueValue, falseValue) { return condition.eval(context) ? trueValue.eval(context) : falseValue ? falseValue.eval(context) : new Anonymous(); } If.evalArgs = false; function isdefined(context, variable) { try { variable.eval(context); return Keyword.True; } catch (e2) { return Keyword.False; } } isdefined.evalArgs = false; var boolean$1 = { isdefined, boolean, "if": If }; var colorFunctions; function clamp3(val) { return Math.min(1, Math.max(0, val)); } function hsla(origColor, hsl) { var color2 = colorFunctions.hsla(hsl.h, hsl.s, hsl.l, hsl.a); if (color2) { if (origColor.value && /^(rgb|hsl)/.test(origColor.value)) { color2.value = origColor.value; } else { color2.value = "rgb"; } return color2; } } function toHSL(color2) { if (color2.toHSL) { return color2.toHSL(); } else { throw new Error("Argument cannot be evaluated to a color"); } } function toHSV(color2) { if (color2.toHSV) { return color2.toHSV(); } else { throw new Error("Argument cannot be evaluated to a color"); } } function number$1(n) { if (n instanceof Dimension) { return parseFloat(n.unit.is("%") ? n.value / 100 : n.value); } else if (typeof n === "number") { return n; } else { throw { type: "Argument", message: "color functions take numbers as parameters" }; } } function scaled(n, size4) { if (n instanceof Dimension && n.unit.is("%")) { return parseFloat(n.value * size4 / 100); } else { return number$1(n); } } colorFunctions = { rgb: function(r, g2, b2) { var a = 1; if (r instanceof Expression) { var val = r.value; r = val[0]; g2 = val[1]; b2 = val[2]; if (b2 instanceof Operation) { var op = b2; b2 = op.operands[0]; a = op.operands[1]; } } var color2 = colorFunctions.rgba(r, g2, b2, a); if (color2) { color2.value = "rgb"; return color2; } }, rgba: function(r, g2, b2, a) { try { if (r instanceof Color) { if (g2) { a = number$1(g2); } else { a = r.alpha; } return new Color(r.rgb, a, "rgba"); } var rgb = [r, g2, b2].map(function(c2) { return scaled(c2, 255); }); a = number$1(a); return new Color(rgb, a, "rgba"); } catch (e2) { } }, hsl: function(h, s, l) { var a = 1; if (h instanceof Expression) { var val = h.value; h = val[0]; s = val[1]; l = val[2]; if (l instanceof Operation) { var op = l; l = op.operands[0]; a = op.operands[1]; } } var color2 = colorFunctions.hsla(h, s, l, a); if (color2) { color2.value = "hsl"; return color2; } }, hsla: function(h, s, l, a) { var m1; var m2; function hue(h2) { h2 = h2 < 0 ? h2 + 1 : h2 > 1 ? h2 - 1 : h2; if (h2 * 6 < 1) { return m1 + (m2 - m1) * h2 * 6; } else if (h2 * 2 < 1) { return m2; } else if (h2 * 3 < 2) { return m1 + (m2 - m1) * (2 / 3 - h2) * 6; } else { return m1; } } try { if (h instanceof Color) { if (s) { a = number$1(s); } else { a = h.alpha; } return new Color(h.rgb, a, "hsla"); } h = number$1(h) % 360 / 360; s = clamp3(number$1(s)); l = clamp3(number$1(l)); a = clamp3(number$1(a)); m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s; m1 = l * 2 - m2; var rgb = [ hue(h + 1 / 3) * 255, hue(h) * 255, hue(h - 1 / 3) * 255 ]; a = number$1(a); return new Color(rgb, a, "hsla"); } catch (e2) { } }, hsv: function(h, s, v2) { return colorFunctions.hsva(h, s, v2, 1); }, hsva: function(h, s, v2, a) { h = number$1(h) % 360 / 360 * 360; s = number$1(s); v2 = number$1(v2); a = number$1(a); var i; var f2; i = Math.floor(h / 60 % 6); f2 = h / 60 - i; var vs = [ v2, v2 * (1 - s), v2 * (1 - f2 * s), v2 * (1 - (1 - f2) * s) ]; var perm = [ [0, 3, 1], [2, 0, 1], [1, 0, 3], [1, 2, 0], [3, 1, 0], [0, 1, 2] ]; return colorFunctions.rgba(vs[perm[i][0]] * 255, vs[perm[i][1]] * 255, vs[perm[i][2]] * 255, a); }, hue: function(color2) { return new Dimension(toHSL(color2).h); }, saturation: function(color2) { return new Dimension(toHSL(color2).s * 100, "%"); }, lightness: function(color2) { return new Dimension(toHSL(color2).l * 100, "%"); }, hsvhue: function(color2) { return new Dimension(toHSV(color2).h); }, hsvsaturation: function(color2) { return new Dimension(toHSV(color2).s * 100, "%"); }, hsvvalue: function(color2) { return new Dimension(toHSV(color2).v * 100, "%"); }, red: function(color2) { return new Dimension(color2.rgb[0]); }, green: function(color2) { return new Dimension(color2.rgb[1]); }, blue: function(color2) { return new Dimension(color2.rgb[2]); }, alpha: function(color2) { return new Dimension(toHSL(color2).a); }, luma: function(color2) { return new Dimension(color2.luma() * color2.alpha * 100, "%"); }, luminance: function(color2) { var luminance = 0.2126 * color2.rgb[0] / 255 + 0.7152 * color2.rgb[1] / 255 + 0.0722 * color2.rgb[2] / 255; return new Dimension(luminance * color2.alpha * 100, "%"); }, saturate: function(color2, amount, method) { if (!color2.rgb) { return null; } var hsl = toHSL(color2); if (typeof method !== "undefined" && method.value === "relative") { hsl.s += hsl.s * amount.value / 100; } else { hsl.s += amount.value / 100; } hsl.s = clamp3(hsl.s); return hsla(color2, hsl); }, desaturate: function(color2, amount, method) { var hsl = toHSL(color2); if (typeof method !== "undefined" && method.value === "relative") { hsl.s -= hsl.s * amount.value / 100; } else { hsl.s -= amount.value / 100; } hsl.s = clamp3(hsl.s); return hsla(color2, hsl); }, lighten: function(color2, amount, method) { var hsl = toHSL(color2); if (typeof method !== "undefined" && method.value === "relative") { hsl.l += hsl.l * amount.value / 100; } else { hsl.l += amount.value / 100; } hsl.l = clamp3(hsl.l); return hsla(color2, hsl); }, darken: function(color2, amount, method) { var hsl = toHSL(color2); if (typeof method !== "undefined" && method.value === "relative") { hsl.l -= hsl.l * amount.value / 100; } else { hsl.l -= amount.value / 100; } hsl.l = clamp3(hsl.l); return hsla(color2, hsl); }, fadein: function(color2, amount, method) { var hsl = toHSL(color2); if (typeof method !== "undefined" && method.value === "relative") { hsl.a += hsl.a * amount.value / 100; } else { hsl.a += amount.value / 100; } hsl.a = clamp3(hsl.a); return hsla(color2, hsl); }, fadeout: function(color2, amount, method) { var hsl = toHSL(color2); if (typeof method !== "undefined" && method.value === "relative") { hsl.a -= hsl.a * amount.value / 100; } else { hsl.a -= amount.value / 100; } hsl.a = clamp3(hsl.a); return hsla(color2, hsl); }, fade: function(color2, amount) { var hsl = toHSL(color2); hsl.a = amount.value / 100; hsl.a = clamp3(hsl.a); return hsla(color2, hsl); }, spin: function(color2, amount) { var hsl = toHSL(color2); var hue = (hsl.h + amount.value) % 360; hsl.h = hue < 0 ? 360 + hue : hue; return hsla(color2, hsl); }, // // Copyright (c) 2006-2009 Hampton Catlin, Natalie Weizenbaum, and Chris Eppstein // http://sass-lang.com // mix: function(color1, color2, weight) { if (!weight) { weight = new Dimension(50); } var p2 = weight.value / 100; var w2 = p2 * 2 - 1; var a = toHSL(color1).a - toHSL(color2).a; var w1 = ((w2 * a == -1 ? w2 : (w2 + a) / (1 + w2 * a)) + 1) / 2; var w22 = 1 - w1; var rgb = [ color1.rgb[0] * w1 + color2.rgb[0] * w22, color1.rgb[1] * w1 + color2.rgb[1] * w22, color1.rgb[2] * w1 + color2.rgb[2] * w22 ]; var alpha = color1.alpha * p2 + color2.alpha * (1 - p2); return new Color(rgb, alpha); }, greyscale: function(color2) { return colorFunctions.desaturate(color2, new Dimension(100)); }, contrast: function(color2, dark, light, threshold) { if (!color2.rgb) { return null; } if (typeof light === "undefined") { light = colorFunctions.rgba(255, 255, 255, 1); } if (typeof dark === "undefined") { dark = colorFunctions.rgba(0, 0, 0, 1); } if (dark.luma() > light.luma()) { var t = light; light = dark; dark = t; } if (typeof threshold === "undefined") { threshold = 0.43; } else { threshold = number$1(threshold); } if (color2.luma() < threshold) { return light; } else { return dark; } }, // Changes made in 2.7.0 - Reverted in 3.0.0 // contrast: function (color, color1, color2, threshold) { // // Return which of `color1` and `color2` has the greatest contrast with `color` // // according to the standard WCAG contrast ratio calculation. // // http://www.w3.org/TR/WCAG20/#contrast-ratiodef // // The threshold param is no longer used, in line with SASS. // // filter: contrast(3.2); // // should be kept as is, so check for color // if (!color.rgb) { // return null; // } // if (typeof color1 === 'undefined') { // color1 = colorFunctions.rgba(0, 0, 0, 1.0); // } // if (typeof color2 === 'undefined') { // color2 = colorFunctions.rgba(255, 255, 255, 1.0); // } // var contrast1, contrast2; // var luma = color.luma(); // var luma1 = color1.luma(); // var luma2 = color2.luma(); // // Calculate contrast ratios for each color // if (luma > luma1) { // contrast1 = (luma + 0.05) / (luma1 + 0.05); // } else { // contrast1 = (luma1 + 0.05) / (luma + 0.05); // } // if (luma > luma2) { // contrast2 = (luma + 0.05) / (luma2 + 0.05); // } else { // contrast2 = (luma2 + 0.05) / (luma + 0.05); // } // if (contrast1 > contrast2) { // return color1; // } else { // return color2; // } // }, argb: function(color2) { return new Anonymous(color2.toARGB()); }, color: function(c2) { if (c2 instanceof Quoted && /^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3,4})$/i.test(c2.value)) { var val = c2.value.slice(1); return new Color(val, void 0, "#".concat(val)); } if (c2 instanceof Color || (c2 = Color.fromKeyword(c2.value))) { c2.value = void 0; return c2; } throw { type: "Argument", message: "argument must be a color keyword or 3|4|6|8 digit hex e.g. #FFF" }; }, tint: function(color2, amount) { return colorFunctions.mix(colorFunctions.rgb(255, 255, 255), color2, amount); }, shade: function(color2, amount) { return colorFunctions.mix(colorFunctions.rgb(0, 0, 0), color2, amount); } }; var color = colorFunctions; function colorBlend(mode2, color1, color2) { var ab = color1.alpha; var cb; var as = color2.alpha; var cs; var ar; var cr; var r = []; ar = as + ab * (1 - as); for (var i_1 = 0; i_1 < 3; i_1++) { cb = color1.rgb[i_1] / 255; cs = color2.rgb[i_1] / 255; cr = mode2(cb, cs); if (ar) { cr = (as * cs + ab * (cb - as * (cb + cs - cr))) / ar; } r[i_1] = cr * 255; } return new Color(r, ar); } var colorBlendModeFunctions = { multiply: function(cb, cs) { return cb * cs; }, screen: function(cb, cs) { return cb + cs - cb * cs; }, overlay: function(cb, cs) { cb *= 2; return cb <= 1 ? colorBlendModeFunctions.multiply(cb, cs) : colorBlendModeFunctions.screen(cb - 1, cs); }, softlight: function(cb, cs) { var d = 1; var e2 = cb; if (cs > 0.5) { e2 = 1; d = cb > 0.25 ? Math.sqrt(cb) : ((16 * cb - 12) * cb + 4) * cb; } return cb - (1 - 2 * cs) * e2 * (d - cb); }, hardlight: function(cb, cs) { return colorBlendModeFunctions.overlay(cs, cb); }, difference: function(cb, cs) { return Math.abs(cb - cs); }, exclusion: function(cb, cs) { return cb + cs - 2 * cb * cs; }, // non-w3c functions: average: function(cb, cs) { return (cb + cs) / 2; }, negation: function(cb, cs) { return 1 - Math.abs(cb + cs - 1); } }; for (var f$1 in colorBlendModeFunctions) { if (colorBlendModeFunctions.hasOwnProperty(f$1)) { colorBlend[f$1] = colorBlend.bind(null, colorBlendModeFunctions[f$1]); } } var dataUri = (function(environment) { var fallback = function(functionThis, node) { return new URL2(node, functionThis.index, functionThis.currentFileInfo).eval(functionThis.context); }; return { "data-uri": function(mimetypeNode, filePathNode) { if (!filePathNode) { filePathNode = mimetypeNode; mimetypeNode = null; } var mimetype = mimetypeNode && mimetypeNode.value; var filePath = filePathNode.value; var currentFileInfo = this.currentFileInfo; var currentDirectory = currentFileInfo.rewriteUrls ? currentFileInfo.currentDirectory : currentFileInfo.entryPath; var fragmentStart = filePath.indexOf("#"); var fragment = ""; if (fragmentStart !== -1) { fragment = filePath.slice(fragmentStart); filePath = filePath.slice(0, fragmentStart); } var context = clone(this.context); context.rawBuffer = true; var fileManager = environment.getFileManager(filePath, currentDirectory, context, environment, true); if (!fileManager) { return fallback(this, filePathNode); } var useBase64 = false; if (!mimetypeNode) { mimetype = environment.mimeLookup(filePath); if (mimetype === "image/svg+xml") { useBase64 = false; } else { var charset = environment.charsetLookup(mimetype); useBase64 = ["US-ASCII", "UTF-8"].indexOf(charset) < 0; } if (useBase64) { mimetype += ";base64"; } } else { useBase64 = /;base64$/.test(mimetype); } var fileSync = fileManager.loadFileSync(filePath, currentDirectory, context, environment); if (!fileSync.contents) { logger$1.warn("Skipped data-uri embedding of ".concat(filePath, " because file not found")); return fallback(this, filePathNode || mimetypeNode); } var buf = fileSync.contents; if (useBase64 && !environment.encodeBase64) { return fallback(this, filePathNode); } buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf); var uri = "data:".concat(mimetype, ",").concat(buf).concat(fragment); return new URL2(new Quoted('"'.concat(uri, '"'), uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo); } }; }); var getItemsFromNode = function(node) { var items = Array.isArray(node.value) ? node.value : Array(node); return items; }; var list2 = { _SELF: function(n) { return n; }, "~": function() { var expr = []; for (var _i = 0; _i < arguments.length; _i++) { expr[_i] = arguments[_i]; } if (expr.length === 1) { return expr[0]; } return new Value2(expr); }, extract: function(values, index2) { index2 = index2.value - 1; return getItemsFromNode(values)[index2]; }, length: function(values) { return new Dimension(getItemsFromNode(values).length); }, /** * Creates a Less list of incremental values. * Modeled after Lodash's range function, also exists natively in PHP * * @param {Dimension} [start=1] * @param {Dimension} end - e.g. 10 or 10px - unit is added to output * @param {Dimension} [step=1] */ range: function(start, end, step) { var from; var to; var stepValue = 1; var list3 = []; if (end) { to = end; from = start.value; if (step) { stepValue = step.value; } } else { from = 1; to = start; } for (var i_1 = from; i_1 <= to.value; i_1 += stepValue) { list3.push(new Dimension(i_1, to.unit)); } return new Expression(list3); }, each: function(list3, rs) { var _this = this; var rules = []; var newRules; var iterator; var tryEval = function(val) { if (val instanceof Node2) { return val.eval(_this.context); } return val; }; if (list3.value && !(list3 instanceof Quoted)) { if (Array.isArray(list3.value)) { iterator = list3.value.map(tryEval); } else { iterator = [tryEval(list3.value)]; } } else if (list3.ruleset) { iterator = tryEval(list3.ruleset).rules; } else if (list3.rules) { iterator = list3.rules.map(tryEval); } else if (Array.isArray(list3)) { iterator = list3.map(tryEval); } else { iterator = [tryEval(list3)]; } var valueName = "@value"; var keyName = "@key"; var indexName = "@index"; if (rs.params) { valueName = rs.params[0] && rs.params[0].name; keyName = rs.params[1] && rs.params[1].name; indexName = rs.params[2] && rs.params[2].name; rs = rs.rules; } else { rs = rs.ruleset; } for (var i_2 = 0; i_2 < iterator.length; i_2++) { var key2 = void 0; var value = void 0; var item = iterator[i_2]; if (item instanceof Declaration) { key2 = typeof item.name === "string" ? item.name : item.name[0].value; value = item.value; } else { key2 = new Dimension(i_2 + 1); value = item; } if (item instanceof Comment2) { continue; } newRules = rs.rules.slice(0); if (valueName) { newRules.push(new Declaration(valueName, value, false, false, this.index, this.currentFileInfo)); } if (indexName) { newRules.push(new Declaration(indexName, new Dimension(i_2 + 1), false, false, this.index, this.currentFileInfo)); } if (keyName) { newRules.push(new Declaration(keyName, key2, false, false, this.index, this.currentFileInfo)); } rules.push(new Ruleset([new Selector([new Element2("", "&")])], newRules, rs.strictImports, rs.visibilityInfo())); } return new Ruleset([new Selector([new Element2("", "&")])], rules, rs.strictImports, rs.visibilityInfo()).eval(this.context); } }; var MathHelper = function(fn, unit, n) { if (!(n instanceof Dimension)) { throw { type: "Argument", message: "argument must be a number" }; } if (unit === null) { unit = n.unit; } else { n = n.unify(); } return new Dimension(fn(parseFloat(n.value)), unit); }; var mathFunctions = { // name, unit ceil: null, floor: null, sqrt: null, abs: null, tan: "", sin: "", cos: "", atan: "rad", asin: "rad", acos: "rad" }; for (var f in mathFunctions) { if (mathFunctions.hasOwnProperty(f)) { mathFunctions[f] = MathHelper.bind(null, Math[f], mathFunctions[f]); } } mathFunctions.round = function(n, f2) { var fraction = typeof f2 === "undefined" ? 0 : f2.value; return MathHelper(function(num) { return num.toFixed(fraction); }, null, n); }; var minMax = function(isMin, args) { var _this = this; args = Array.prototype.slice.call(args); switch (args.length) { case 0: throw { type: "Argument", message: "one or more arguments required" }; } var i; var j2; var current2; var currentUnified; var referenceUnified; var unit; var unitStatic; var unitClone; var order = []; var values = {}; for (i = 0; i < args.length; i++) { current2 = args[i]; if (!(current2 instanceof Dimension)) { if (Array.isArray(args[i].value)) { Array.prototype.push.apply(args, Array.prototype.slice.call(args[i].value)); continue; } else { throw { type: "Argument", message: "incompatible types" }; } } currentUnified = current2.unit.toString() === "" && unitClone !== void 0 ? new Dimension(current2.value, unitClone).unify() : current2.unify(); unit = currentUnified.unit.toString() === "" && unitStatic !== void 0 ? unitStatic : currentUnified.unit.toString(); unitStatic = unit !== "" && unitStatic === void 0 || unit !== "" && order[0].unify().unit.toString() === "" ? unit : unitStatic; unitClone = unit !== "" && unitClone === void 0 ? current2.unit.toString() : unitClone; j2 = values[""] !== void 0 && unit !== "" && unit === unitStatic ? values[""] : values[unit]; if (j2 === void 0) { if (unitStatic !== void 0 && unit !== unitStatic) { throw { type: "Argument", message: "incompatible types" }; } values[unit] = order.length; order.push(current2); continue; } referenceUnified = order[j2].unit.toString() === "" && unitClone !== void 0 ? new Dimension(order[j2].value, unitClone).unify() : order[j2].unify(); if (isMin && currentUnified.value < referenceUnified.value || !isMin && currentUnified.value > referenceUnified.value) { order[j2] = current2; } } if (order.length == 1) { return order[0]; } args = order.map(function(a) { return a.toCSS(_this.context); }).join(this.context.compress ? "," : ", "); return new Anonymous("".concat(isMin ? "min" : "max", "(").concat(args, ")")); }; var number = { min: function() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } try { return minMax.call(this, true, args); } catch (e2) { } }, max: function() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } try { return minMax.call(this, false, args); } catch (e2) { } }, convert: function(val, unit) { return val.convertTo(unit.value); }, pi: function() { return new Dimension(Math.PI); }, mod: function(a, b2) { return new Dimension(a.value % b2.value, a.unit); }, pow: function(x2, y2) { if (typeof x2 === "number" && typeof y2 === "number") { x2 = new Dimension(x2); y2 = new Dimension(y2); } else if (!(x2 instanceof Dimension) || !(y2 instanceof Dimension)) { throw { type: "Argument", message: "arguments must be numbers" }; } return new Dimension(Math.pow(x2.value, y2.value), x2.unit); }, percentage: function(n) { var result = MathHelper(function(num) { return num * 100; }, "%", n); return result; } }; var string = { e: function(str) { return new Quoted('"', str instanceof JavaScript ? str.evaluated : str.value, true); }, escape: function(str) { return new Anonymous(encodeURI(str.value).replace(/=/g, "%3D").replace(/:/g, "%3A").replace(/#/g, "%23").replace(/;/g, "%3B").replace(/\(/g, "%28").replace(/\)/g, "%29")); }, replace: function(string2, pattern, replacement, flags) { var result = string2.value; replacement = replacement.type === "Quoted" ? replacement.value : replacement.toCSS(); result = result.replace(new RegExp(pattern.value, flags ? flags.value : ""), replacement); return new Quoted(string2.quote || "", result, string2.escaped); }, "%": function(string2) { var args = Array.prototype.slice.call(arguments, 1); var result = string2.value; var _loop_1 = function(i_12) { result = result.replace(/%[sda]/i, function(token) { var value = args[i_12].type === "Quoted" && token.match(/s/i) ? args[i_12].value : args[i_12].toCSS(); return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value; }); }; for (var i_1 = 0; i_1 < args.length; i_1++) { _loop_1(i_1); } result = result.replace(/%%/g, "%"); return new Quoted(string2.quote || "", result, string2.escaped); } }; var svg = (function() { return { "svg-gradient": function(direction) { var stops; var gradientDirectionSvg; var gradientType = "linear"; var rectangleDimension = 'x="0" y="0" width="1" height="1"'; var renderEnv = { compress: false }; var returner; var directionValue = direction.toCSS(renderEnv); var i; var color2; var position; var positionValue; var alpha; function throwArgumentDescriptor() { throw { type: "Argument", message: "svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position] or direction, color list" }; } if (arguments.length == 2) { if (arguments[1].value.length < 2) { throwArgumentDescriptor(); } stops = arguments[1].value; } else if (arguments.length < 3) { throwArgumentDescriptor(); } else { stops = Array.prototype.slice.call(arguments, 1); } switch (directionValue) { case "to bottom": gradientDirectionSvg = 'x1="0%" y1="0%" x2="0%" y2="100%"'; break; case "to right": gradientDirectionSvg = 'x1="0%" y1="0%" x2="100%" y2="0%"'; break; case "to bottom right": gradientDirectionSvg = 'x1="0%" y1="0%" x2="100%" y2="100%"'; break; case "to top right": gradientDirectionSvg = 'x1="0%" y1="100%" x2="100%" y2="0%"'; break; case "ellipse": case "ellipse at center": gradientType = "radial"; gradientDirectionSvg = 'cx="50%" cy="50%" r="75%"'; rectangleDimension = 'x="-50" y="-50" width="101" height="101"'; break; default: throw { type: "Argument", message: "svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center'" }; } returner = '<'.concat(gradientType, 'Gradient id="g" ').concat(gradientDirectionSvg, ">"); for (i = 0; i < stops.length; i += 1) { if (stops[i] instanceof Expression) { color2 = stops[i].value[0]; position = stops[i].value[1]; } else { color2 = stops[i]; position = void 0; } if (!(color2 instanceof Color) || !((i === 0 || i + 1 === stops.length) && position === void 0) && !(position instanceof Dimension)) { throwArgumentDescriptor(); } positionValue = position ? position.toCSS(renderEnv) : i === 0 ? "0%" : "100%"; alpha = color2.alpha; returner += '"); } returner += "'); returner = encodeURIComponent(returner); returner = "data:image/svg+xml,".concat(returner); return new URL2(new Quoted("'".concat(returner, "'"), returner, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo); } }; }); var isa = function(n, Type) { return n instanceof Type ? Keyword.True : Keyword.False; }; var isunit = function(n, unit) { if (unit === void 0) { throw { type: "Argument", message: "missing the required second argument to isunit." }; } unit = typeof unit.value === "string" ? unit.value : unit; if (typeof unit !== "string") { throw { type: "Argument", message: "Second argument to isunit should be a unit or a string." }; } return n instanceof Dimension && n.unit.is(unit) ? Keyword.True : Keyword.False; }; var types = { isruleset: function(n) { return isa(n, DetachedRuleset); }, iscolor: function(n) { return isa(n, Color); }, isnumber: function(n) { return isa(n, Dimension); }, isstring: function(n) { return isa(n, Quoted); }, iskeyword: function(n) { return isa(n, Keyword); }, isurl: function(n) { return isa(n, URL2); }, ispixel: function(n) { return isunit(n, "px"); }, ispercentage: function(n) { return isunit(n, "%"); }, isem: function(n) { return isunit(n, "em"); }, isunit, unit: function(val, unit) { if (!(val instanceof Dimension)) { throw { type: "Argument", message: "the first argument to unit must be a number".concat(val instanceof Operation ? ". Have you forgotten parenthesis?" : "") }; } if (unit) { if (unit instanceof Keyword) { unit = unit.value; } else { unit = unit.toCSS(); } } else { unit = ""; } return new Dimension(val.value, unit); }, "get-unit": function(n) { return new Anonymous(n.unit); } }; var styleExpression = function(args) { var _this = this; args = Array.prototype.slice.call(args); switch (args.length) { case 0: throw { type: "Argument", message: "one or more arguments required" }; } var entityList = [new Variable(args[0].value, this.index, this.currentFileInfo).eval(this.context)]; args = entityList.map(function(a) { return a.toCSS(_this.context); }).join(this.context.compress ? "," : ", "); return new Variable("style(".concat(args, ")")); }; var style$1 = { style: function() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } try { return styleExpression.call(this, args); } catch (e2) { } } }; var functions = (function(environment) { var functions2 = { functionRegistry, functionCaller }; functionRegistry.addMultiple(boolean$1); functionRegistry.add("default", defaultFunc.eval.bind(defaultFunc)); functionRegistry.addMultiple(color); functionRegistry.addMultiple(colorBlend); functionRegistry.addMultiple(dataUri(environment)); functionRegistry.addMultiple(list2); functionRegistry.addMultiple(mathFunctions); functionRegistry.addMultiple(number); functionRegistry.addMultiple(string); functionRegistry.addMultiple(svg()); functionRegistry.addMultiple(types); functionRegistry.addMultiple(style$1); return functions2; }); function transformTree(root2, options3) { options3 = options3 || {}; var evaldRoot; var variables = options3.variables; var evalEnv = new contexts.Eval(options3); if (typeof variables === "object" && !Array.isArray(variables)) { variables = Object.keys(variables).map(function(k2) { var value = variables[k2]; if (!(value instanceof tree.Value)) { if (!(value instanceof tree.Expression)) { value = new tree.Expression([value]); } value = new tree.Value([value]); } return new tree.Declaration("@".concat(k2), value, false, null, 0); }); evalEnv.frames = [new tree.Ruleset(null, variables)]; } var visitors$1 = [ new visitors.JoinSelectorVisitor(), new visitors.MarkVisibleSelectorsVisitor(true), new visitors.ExtendVisitor(), new visitors.ToCSSVisitor({ compress: Boolean(options3.compress) }) ]; var preEvalVisitors = []; var v2; var visitorIterator; if (options3.pluginManager) { visitorIterator = options3.pluginManager.visitor(); for (var i_1 = 0; i_1 < 2; i_1++) { visitorIterator.first(); while (v2 = visitorIterator.get()) { if (v2.isPreEvalVisitor) { if (i_1 === 0 || preEvalVisitors.indexOf(v2) === -1) { preEvalVisitors.push(v2); v2.run(root2); } } else { if (i_1 === 0 || visitors$1.indexOf(v2) === -1) { if (v2.isPreVisitor) { visitors$1.unshift(v2); } else { visitors$1.push(v2); } } } } } } evaldRoot = root2.eval(evalEnv); for (var i_2 = 0; i_2 < visitors$1.length; i_2++) { visitors$1[i_2].run(evaldRoot); } if (options3.pluginManager) { visitorIterator.first(); while (v2 = visitorIterator.get()) { if (visitors$1.indexOf(v2) === -1 && preEvalVisitors.indexOf(v2) === -1) { v2.run(evaldRoot); } } } return evaldRoot; } var PluginManager = ( /** @class */ (function() { function PluginManager2(less2) { this.less = less2; this.visitors = []; this.preProcessors = []; this.postProcessors = []; this.installedPlugins = []; this.fileManagers = []; this.iterator = -1; this.pluginCache = {}; this.Loader = new less2.PluginLoader(less2); } PluginManager2.prototype.addPlugins = function(plugins2) { if (plugins2) { for (var i_1 = 0; i_1 < plugins2.length; i_1++) { this.addPlugin(plugins2[i_1]); } } }; PluginManager2.prototype.addPlugin = function(plugin, filename, functionRegistry2) { this.installedPlugins.push(plugin); if (filename) { this.pluginCache[filename] = plugin; } if (plugin.install) { plugin.install(this.less, this, functionRegistry2 || this.less.functions.functionRegistry); } }; PluginManager2.prototype.get = function(filename) { return this.pluginCache[filename]; }; PluginManager2.prototype.addVisitor = function(visitor) { this.visitors.push(visitor); }; PluginManager2.prototype.addPreProcessor = function(preProcessor, priority) { var indexToInsertAt; for (indexToInsertAt = 0; indexToInsertAt < this.preProcessors.length; indexToInsertAt++) { if (this.preProcessors[indexToInsertAt].priority >= priority) { break; } } this.preProcessors.splice(indexToInsertAt, 0, { preProcessor, priority }); }; PluginManager2.prototype.addPostProcessor = function(postProcessor, priority) { var indexToInsertAt; for (indexToInsertAt = 0; indexToInsertAt < this.postProcessors.length; indexToInsertAt++) { if (this.postProcessors[indexToInsertAt].priority >= priority) { break; } } this.postProcessors.splice(indexToInsertAt, 0, { postProcessor, priority }); }; PluginManager2.prototype.addFileManager = function(manager) { this.fileManagers.push(manager); }; PluginManager2.prototype.getPreProcessors = function() { var preProcessors = []; for (var i_2 = 0; i_2 < this.preProcessors.length; i_2++) { preProcessors.push(this.preProcessors[i_2].preProcessor); } return preProcessors; }; PluginManager2.prototype.getPostProcessors = function() { var postProcessors = []; for (var i_3 = 0; i_3 < this.postProcessors.length; i_3++) { postProcessors.push(this.postProcessors[i_3].postProcessor); } return postProcessors; }; PluginManager2.prototype.getVisitors = function() { return this.visitors; }; PluginManager2.prototype.visitor = function() { var self2 = this; return { first: function() { self2.iterator = -1; return self2.visitors[self2.iterator]; }, get: function() { self2.iterator += 1; return self2.visitors[self2.iterator]; } }; }; PluginManager2.prototype.getFileManagers = function() { return this.fileManagers; }; return PluginManager2; })() ); var pm; var PluginManagerFactory = function(less2, newFactory) { if (newFactory || !pm) { pm = new PluginManager(less2); } return pm; }; function SourceMapOutput(environment) { var SourceMapOutput2 = ( /** @class */ (function() { function SourceMapOutput3(options3) { this._css = []; this._rootNode = options3.rootNode; this._contentsMap = options3.contentsMap; this._contentsIgnoredCharsMap = options3.contentsIgnoredCharsMap; if (options3.sourceMapFilename) { this._sourceMapFilename = options3.sourceMapFilename.replace(/\\/g, "/"); } this._outputFilename = options3.outputFilename ? options3.outputFilename.replace(/\\/g, "/") : options3.outputFilename; this.sourceMapURL = options3.sourceMapURL; if (options3.sourceMapBasepath) { this._sourceMapBasepath = options3.sourceMapBasepath.replace(/\\/g, "/"); } if (options3.sourceMapRootpath) { this._sourceMapRootpath = options3.sourceMapRootpath.replace(/\\/g, "/"); if (this._sourceMapRootpath.charAt(this._sourceMapRootpath.length - 1) !== "/") { this._sourceMapRootpath += "/"; } } else { this._sourceMapRootpath = ""; } this._outputSourceFiles = options3.outputSourceFiles; this._sourceMapGeneratorConstructor = environment.getSourceMapGenerator(); this._lineNumber = 0; this._column = 0; } SourceMapOutput3.prototype.removeBasepath = function(path) { if (this._sourceMapBasepath && path.indexOf(this._sourceMapBasepath) === 0) { path = path.substring(this._sourceMapBasepath.length); if (path.charAt(0) === "\\" || path.charAt(0) === "/") { path = path.substring(1); } } return path; }; SourceMapOutput3.prototype.normalizeFilename = function(filename) { filename = filename.replace(/\\/g, "/"); filename = this.removeBasepath(filename); return (this._sourceMapRootpath || "") + filename; }; SourceMapOutput3.prototype.add = function(chunk, fileInfo, index2, mapLines) { if (!chunk) { return; } var lines, sourceLines, columns, sourceColumns, i; if (fileInfo && fileInfo.filename) { var inputSource = this._contentsMap[fileInfo.filename]; if (this._contentsIgnoredCharsMap[fileInfo.filename]) { index2 -= this._contentsIgnoredCharsMap[fileInfo.filename]; if (index2 < 0) { index2 = 0; } inputSource = inputSource.slice(this._contentsIgnoredCharsMap[fileInfo.filename]); } if (inputSource === void 0) { this._css.push(chunk); return; } inputSource = inputSource.substring(0, index2); sourceLines = inputSource.split("\n"); sourceColumns = sourceLines[sourceLines.length - 1]; } lines = chunk.split("\n"); columns = lines[lines.length - 1]; if (fileInfo && fileInfo.filename) { if (!mapLines) { this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + 1, column: this._column }, original: { line: sourceLines.length, column: sourceColumns.length }, source: this.normalizeFilename(fileInfo.filename) }); } else { for (i = 0; i < lines.length; i++) { this._sourceMapGenerator.addMapping({ generated: { line: this._lineNumber + i + 1, column: i === 0 ? this._column : 0 }, original: { line: sourceLines.length + i, column: i === 0 ? sourceColumns.length : 0 }, source: this.normalizeFilename(fileInfo.filename) }); } } } if (lines.length === 1) { this._column += columns.length; } else { this._lineNumber += lines.length - 1; this._column = columns.length; } this._css.push(chunk); }; SourceMapOutput3.prototype.isEmpty = function() { return this._css.length === 0; }; SourceMapOutput3.prototype.toCSS = function(context) { this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ file: this._outputFilename, sourceRoot: null }); if (this._outputSourceFiles) { for (var filename in this._contentsMap) { if (this._contentsMap.hasOwnProperty(filename)) { var source = this._contentsMap[filename]; if (this._contentsIgnoredCharsMap[filename]) { source = source.slice(this._contentsIgnoredCharsMap[filename]); } this._sourceMapGenerator.setSourceContent(this.normalizeFilename(filename), source); } } } this._rootNode.genCSS(context, this); if (this._css.length > 0) { var sourceMapURL = void 0; var sourceMapContent = JSON.stringify(this._sourceMapGenerator.toJSON()); if (this.sourceMapURL) { sourceMapURL = this.sourceMapURL; } else if (this._sourceMapFilename) { sourceMapURL = this._sourceMapFilename; } this.sourceMapURL = sourceMapURL; this.sourceMap = sourceMapContent; } return this._css.join(""); }; return SourceMapOutput3; })() ); return SourceMapOutput2; } function SourceMapBuilder(SourceMapOutput2, environment) { var SourceMapBuilder2 = ( /** @class */ (function() { function SourceMapBuilder3(options3) { this.options = options3; } SourceMapBuilder3.prototype.toCSS = function(rootNode, options3, imports) { var sourceMapOutput = new SourceMapOutput2({ contentsIgnoredCharsMap: imports.contentsIgnoredChars, rootNode, contentsMap: imports.contents, sourceMapFilename: this.options.sourceMapFilename, sourceMapURL: this.options.sourceMapURL, outputFilename: this.options.sourceMapOutputFilename, sourceMapBasepath: this.options.sourceMapBasepath, sourceMapRootpath: this.options.sourceMapRootpath, outputSourceFiles: this.options.outputSourceFiles, sourceMapGenerator: this.options.sourceMapGenerator, sourceMapFileInline: this.options.sourceMapFileInline, disableSourcemapAnnotation: this.options.disableSourcemapAnnotation }); var css3 = sourceMapOutput.toCSS(options3); this.sourceMap = sourceMapOutput.sourceMap; this.sourceMapURL = sourceMapOutput.sourceMapURL; if (this.options.sourceMapInputFilename) { this.sourceMapInputFilename = sourceMapOutput.normalizeFilename(this.options.sourceMapInputFilename); } if (this.options.sourceMapBasepath !== void 0 && this.sourceMapURL !== void 0) { this.sourceMapURL = sourceMapOutput.removeBasepath(this.sourceMapURL); } return css3 + this.getCSSAppendage(); }; SourceMapBuilder3.prototype.getCSSAppendage = function() { var sourceMapURL = this.sourceMapURL; if (this.options.sourceMapFileInline) { if (this.sourceMap === void 0) { return ""; } sourceMapURL = "data:application/json;base64,".concat(environment.encodeBase64(this.sourceMap)); } if (this.options.disableSourcemapAnnotation) { return ""; } if (sourceMapURL) { return "/*# sourceMappingURL=".concat(sourceMapURL, " */"); } return ""; }; SourceMapBuilder3.prototype.getExternalSourceMap = function() { return this.sourceMap; }; SourceMapBuilder3.prototype.setExternalSourceMap = function(sourceMap) { this.sourceMap = sourceMap; }; SourceMapBuilder3.prototype.isInline = function() { return this.options.sourceMapFileInline; }; SourceMapBuilder3.prototype.getSourceMapURL = function() { return this.sourceMapURL; }; SourceMapBuilder3.prototype.getOutputFilename = function() { return this.options.sourceMapOutputFilename; }; SourceMapBuilder3.prototype.getInputFilename = function() { return this.sourceMapInputFilename; }; return SourceMapBuilder3; })() ); return SourceMapBuilder2; } function ParseTree(SourceMapBuilder2) { var ParseTree2 = ( /** @class */ (function() { function ParseTree3(root2, imports) { this.root = root2; this.imports = imports; } ParseTree3.prototype.toCSS = function(options3) { var evaldRoot; var result = {}; var sourceMapBuilder; try { evaldRoot = transformTree(this.root, options3); } catch (e2) { throw new LessError(e2, this.imports); } try { var compress = Boolean(options3.compress); if (compress) { logger$1.warn("The compress option has been deprecated. We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css."); } var toCSSOptions = { compress, // @deprecated The dumpLineNumbers option is deprecated. Use sourcemaps instead. All modes will be removed in a future version. dumpLineNumbers: options3.dumpLineNumbers, strictUnits: Boolean(options3.strictUnits), numPrecision: 8 }; if (options3.sourceMap) { if (options3.sourceMap === true) { options3.sourceMap = {}; } var sourceMapOpts = options3.sourceMap; if (!sourceMapOpts.sourceMapInputFilename && options3.filename) { sourceMapOpts.sourceMapInputFilename = options3.filename; } if (sourceMapOpts.sourceMapBasepath === void 0 && options3.filename) { var lastSlash = Math.max(options3.filename.lastIndexOf("/"), options3.filename.lastIndexOf("\\")); if (lastSlash >= 0) { sourceMapOpts.sourceMapBasepath = options3.filename.substring(0, lastSlash); } else { sourceMapOpts.sourceMapBasepath = "."; } } if (sourceMapOpts.sourceMapFullFilename && !sourceMapOpts.sourceMapFileInline) { if (!sourceMapOpts.sourceMapFilename && !sourceMapOpts.sourceMapURL) { var mapBase = sourceMapOpts.sourceMapFullFilename.split(/[/\\]/).pop(); sourceMapOpts.sourceMapFilename = mapBase; } } else if (!sourceMapOpts.sourceMapFilename && !sourceMapOpts.sourceMapURL) { if (sourceMapOpts.sourceMapOutputFilename) { sourceMapOpts.sourceMapFilename = sourceMapOpts.sourceMapOutputFilename + ".map"; } else if (options3.filename) { var inputBase = options3.filename.replace(/\.[^/.]+$/, ""); sourceMapOpts.sourceMapFilename = inputBase + ".css.map"; } } if (!sourceMapOpts.sourceMapOutputFilename) { if (options3.filename) { var inputBase = options3.filename.replace(/\.[^/.]+$/, ""); sourceMapOpts.sourceMapOutputFilename = inputBase + ".css"; } else { sourceMapOpts.sourceMapOutputFilename = "output.css"; } } sourceMapBuilder = new SourceMapBuilder2(sourceMapOpts); result.css = sourceMapBuilder.toCSS(evaldRoot, toCSSOptions, this.imports); } else { result.css = evaldRoot.toCSS(toCSSOptions); } } catch (e2) { throw new LessError(e2, this.imports); } if (options3.pluginManager) { var postProcessors = options3.pluginManager.getPostProcessors(); for (var i_1 = 0; i_1 < postProcessors.length; i_1++) { result.css = postProcessors[i_1].process(result.css, { sourceMap: sourceMapBuilder, options: options3, imports: this.imports }); } } if (options3.sourceMap) { result.map = sourceMapBuilder.getExternalSourceMap(); } result.imports = []; for (var file_1 in this.imports.files) { if (Object.prototype.hasOwnProperty.call(this.imports.files, file_1) && file_1 !== this.imports.rootFilename) { result.imports.push(file_1); } } return result; }; return ParseTree3; })() ); return ParseTree2; } function ImportManager(environment) { var ImportManager2 = ( /** @class */ (function() { function ImportManager3(less2, context, rootFileInfo) { this.less = less2; this.rootFilename = rootFileInfo.filename; this.paths = context.paths || []; this.contents = {}; this.contentsIgnoredChars = {}; this.mime = context.mime; this.error = null; this.context = context; this.queue = []; this.files = {}; } ImportManager3.prototype.push = function(path, tryAppendExtension, currentFileInfo, importOptions, callback) { var importManager = this, pluginLoader = this.context.pluginManager.Loader; this.queue.push(path); var fileParsedFunc = function(e2, root2, fullPath) { importManager.queue.splice(importManager.queue.indexOf(path), 1); var importedEqualsRoot = fullPath === importManager.rootFilename; if (importOptions.optional && e2) { callback(null, { rules: [] }, false, null); logger$1.info("The file ".concat(fullPath, " was skipped because it was not found and the import was marked optional.")); } else { if (!importManager.files[fullPath] && !importOptions.inline) { importManager.files[fullPath] = { root: root2, options: importOptions }; } if (e2 && !importManager.error) { importManager.error = e2; } callback(e2, root2, importedEqualsRoot, fullPath); } }; var newFileInfo = { rewriteUrls: this.context.rewriteUrls, entryPath: currentFileInfo.entryPath, rootpath: currentFileInfo.rootpath, rootFilename: currentFileInfo.rootFilename }; var fileManager = environment.getFileManager(path, currentFileInfo.currentDirectory, this.context, environment); if (!fileManager) { fileParsedFunc({ message: "Could not find a file-manager for ".concat(path) }); return; } var loadFileCallback = function(loadedFile2) { var plugin; var resolvedFilename = loadedFile2.filename; var contents = loadedFile2.contents.replace(/^\uFEFF/, ""); newFileInfo.currentDirectory = fileManager.getPath(resolvedFilename); if (newFileInfo.rewriteUrls) { newFileInfo.rootpath = fileManager.join(importManager.context.rootpath || "", fileManager.pathDiff(newFileInfo.currentDirectory, newFileInfo.entryPath)); if (!fileManager.isPathAbsolute(newFileInfo.rootpath) && fileManager.alwaysMakePathsAbsolute()) { newFileInfo.rootpath = fileManager.join(newFileInfo.entryPath, newFileInfo.rootpath); } } newFileInfo.filename = resolvedFilename; var newEnv = new contexts.Parse(importManager.context); newEnv.processImports = false; importManager.contents[resolvedFilename] = contents; if (currentFileInfo.reference || importOptions.reference) { newFileInfo.reference = true; } if (importOptions.isPlugin) { plugin = pluginLoader.evalPlugin(contents, newEnv, importManager, importOptions.pluginArgs, newFileInfo); if (plugin instanceof LessError) { fileParsedFunc(plugin, null, resolvedFilename); } else { fileParsedFunc(null, plugin, resolvedFilename); } } else if (importOptions.inline) { fileParsedFunc(null, contents, resolvedFilename); } else { if (importManager.files[resolvedFilename] && !importManager.files[resolvedFilename].options.multiple && !importOptions.multiple) { fileParsedFunc(null, importManager.files[resolvedFilename].root, resolvedFilename); } else { new Parser(newEnv, importManager, newFileInfo).parse(contents, function(e2, root2) { fileParsedFunc(e2, root2, resolvedFilename); }); } } }; var loadedFile; var promise; var context = clone(this.context); if (tryAppendExtension) { context.ext = importOptions.isPlugin ? ".js" : ".less"; } if (importOptions.isPlugin) { context.mime = "application/javascript"; if (context.syncImport) { loadedFile = pluginLoader.loadPluginSync(path, currentFileInfo.currentDirectory, context, environment, fileManager); } else { promise = pluginLoader.loadPlugin(path, currentFileInfo.currentDirectory, context, environment, fileManager); } } else { if (context.syncImport) { loadedFile = fileManager.loadFileSync(path, currentFileInfo.currentDirectory, context, environment); } else { promise = fileManager.loadFile(path, currentFileInfo.currentDirectory, context, environment, function(err, loadedFile2) { if (err) { fileParsedFunc(err); } else { loadFileCallback(loadedFile2); } }); } } if (loadedFile) { if (!loadedFile.filename) { fileParsedFunc(loadedFile); } else { loadFileCallback(loadedFile); } } else if (promise) { promise.then(loadFileCallback, fileParsedFunc); } }; return ImportManager3; })() ); return ImportManager2; } function Parse(environment, ParseTree2, ImportManager2) { var parse3 = function(input, options3, callback) { if (typeof options3 === "function") { callback = options3; options3 = copyOptions(this.options, {}); } else { options3 = copyOptions(this.options, options3 || {}); } if (!callback) { var self_1 = this; return new Promise(function(resolve, reject) { parse3.call(self_1, input, options3, function(err, output) { if (err) { reject(err); } else { resolve(output); } }); }); } else { var context_1; var rootFileInfo = void 0; var pluginManager_1 = new PluginManagerFactory(this, !options3.reUsePluginManager); options3.pluginManager = pluginManager_1; context_1 = new contexts.Parse(options3); if (options3.rootFileInfo) { rootFileInfo = options3.rootFileInfo; } else { var filename = options3.filename || "input"; var entryPath = filename.replace(/[^/\\]*$/, ""); rootFileInfo = { filename, rewriteUrls: context_1.rewriteUrls, rootpath: context_1.rootpath || "", currentDirectory: entryPath, entryPath, rootFilename: filename }; if (rootFileInfo.rootpath && rootFileInfo.rootpath.slice(-1) !== "/") { rootFileInfo.rootpath += "/"; } } var imports_1 = new ImportManager2(this, context_1, rootFileInfo); this.importManager = imports_1; if (options3.plugins) { options3.plugins.forEach(function(plugin) { var evalResult, contents; if (plugin.fileContent) { contents = plugin.fileContent.replace(/^\uFEFF/, ""); evalResult = pluginManager_1.Loader.evalPlugin(contents, context_1, imports_1, plugin.options, plugin.filename); if (evalResult instanceof LessError) { return callback(evalResult); } } else { pluginManager_1.addPlugin(plugin); } }); } new Parser(context_1, imports_1, rootFileInfo).parse(input, function(e2, root2) { if (e2) { return callback(e2); } callback(null, root2, imports_1, options3); }, options3); } }; return parse3; } function Render(environment, ParseTree2) { var render = function(input, options3, callback) { if (typeof options3 === "function") { callback = options3; options3 = copyOptions(this.options, {}); } else { options3 = copyOptions(this.options, options3 || {}); } if (!callback) { var self_1 = this; return new Promise(function(resolve, reject) { render.call(self_1, input, options3, function(err, output) { if (err) { reject(err); } else { resolve(output); } }); }); } else { this.parse(input, options3, function(err, root2, imports, options4) { if (err) { return callback(err); } var result; try { var parseTree = new ParseTree2(root2, imports); result = parseTree.toCSS(options4); } catch (err2) { return callback(err2); } callback(null, result); }); } }; return render; } var version = "4.5.1"; function parseNodeVersion(version2) { var match = version2.match(/^v(\d{1,2})\.(\d{1,2})\.(\d{1,2})(?:-([0-9A-Za-z-.]+))?(?:\+([0-9A-Za-z-.]+))?$/); if (!match) { throw new Error("Unable to parse: " + version2); } var res = { major: parseInt(match[1], 10), minor: parseInt(match[2], 10), patch: parseInt(match[3], 10), pre: match[4] || "", build: match[5] || "" }; return res; } var parseNodeVersion_1 = parseNodeVersion; function lessRoot(environment, fileManagers) { var sourceMapOutput, sourceMapBuilder, parseTree, importManager; environment = new Environment(environment, fileManagers); sourceMapOutput = SourceMapOutput(environment); sourceMapBuilder = SourceMapBuilder(sourceMapOutput, environment); parseTree = ParseTree(sourceMapBuilder); importManager = ImportManager(environment); var render = Render(environment, parseTree); var parse3 = Parse(environment, parseTree, importManager); var v2 = parseNodeVersion_1("v".concat(version)); var initial = { version: [v2.major, v2.minor, v2.patch], data, tree, Environment, AbstractFileManager, AbstractPluginLoader, environment, visitors, Parser, functions: functions(environment), contexts, SourceMapOutput: sourceMapOutput, SourceMapBuilder: sourceMapBuilder, ParseTree: parseTree, ImportManager: importManager, render, parse: parse3, LessError, transformTree, utils, PluginManager: PluginManagerFactory, logger: logger$1 }; var ctor = function(t2) { return function() { var obj = Object.create(t2.prototype); t2.apply(obj, Array.prototype.slice.call(arguments, 0)); return obj; }; }; var t; var api = Object.create(initial); for (var n in initial.tree) { t = initial.tree[n]; if (typeof t === "function") { api[n.toLowerCase()] = ctor(t); } else { api[n] = /* @__PURE__ */ Object.create(null); for (var o in t) { api[n][o.toLowerCase()] = ctor(t[o]); } } } initial.parse = initial.parse.bind(api); initial.render = initial.render.bind(api); return api; } var options$1; var logger; var fileCache = {}; var FileManager = function() { }; FileManager.prototype = Object.assign(new AbstractFileManager(), { alwaysMakePathsAbsolute: function() { return true; }, join: function(basePath, laterPath) { if (!basePath) { return laterPath; } return this.extractUrlParts(laterPath, basePath).path; }, doXHR: function(url, type, callback, errback) { var xhr = new XMLHttpRequest(); var async = options$1.isFileProtocol ? options$1.fileAsync : true; if (typeof xhr.overrideMimeType === "function") { xhr.overrideMimeType("text/css"); } logger.debug("XHR: Getting '".concat(url, "'")); xhr.open("GET", url, async); xhr.setRequestHeader("Accept", type || "text/x-less, text/css; q=0.9, */*; q=0.5"); xhr.send(null); function handleResponse(xhr2, callback2, errback2) { if (xhr2.status >= 200 && xhr2.status < 300) { callback2(xhr2.responseText, xhr2.getResponseHeader("Last-Modified")); } else if (typeof errback2 === "function") { errback2(xhr2.status, url); } } if (options$1.isFileProtocol && !options$1.fileAsync) { if (xhr.status === 0 || xhr.status >= 200 && xhr.status < 300) { callback(xhr.responseText); } else { errback(xhr.status, url); } } else if (async) { xhr.onreadystatechange = function() { if (xhr.readyState == 4) { handleResponse(xhr, callback, errback); } }; } else { handleResponse(xhr, callback, errback); } }, supports: function() { return true; }, clearFileCache: function() { fileCache = {}; }, loadFile: function(filename, currentDirectory, options3) { if (currentDirectory && !this.isPathAbsolute(filename)) { filename = currentDirectory + filename; } filename = options3.ext ? this.tryAppendExtension(filename, options3.ext) : filename; options3 = options3 || {}; var hrefParts = this.extractUrlParts(filename, window.location.href); var href = hrefParts.url; var self2 = this; return new Promise(function(resolve, reject) { if (options3.useFileCache && fileCache[href]) { try { var lessText_1 = fileCache[href]; return resolve({ contents: lessText_1, filename: href, webInfo: { lastModified: /* @__PURE__ */ new Date() } }); } catch (e2) { return reject({ filename: href, message: "Error loading file ".concat(href, " error was ").concat(e2.message) }); } } self2.doXHR(href, options3.mime, function doXHRCallback(data2, lastModified) { fileCache[href] = data2; resolve({ contents: data2, filename: href, webInfo: { lastModified } }); }, function doXHRError(status, url) { reject({ type: "File", message: "'".concat(url, "' wasn't found (").concat(status, ")"), href }); }); }); } }); var FM = (function(opts, log) { options$1 = opts; logger = log; return FileManager; }); var PluginLoader = function(less2) { this.less = less2; }; PluginLoader.prototype = Object.assign(new AbstractPluginLoader(), { loadPlugin: function(filename, basePath, context, environment, fileManager) { return new Promise(function(fulfill, reject) { fileManager.loadFile(filename, basePath, context, environment).then(fulfill).catch(reject); }); } }); var LogListener = (function(less2, options3) { var logLevel_debug = 4; var logLevel_info = 3; var logLevel_warn = 2; var logLevel_error = 1; options3.logLevel = typeof options3.logLevel !== "undefined" ? options3.logLevel : options3.env === "development" ? logLevel_info : logLevel_error; if (!options3.loggers) { options3.loggers = [{ debug: function(msg) { if (options3.logLevel >= logLevel_debug) { console.log(msg); } }, info: function(msg) { if (options3.logLevel >= logLevel_info) { console.log(msg); } }, warn: function(msg) { if (options3.logLevel >= logLevel_warn) { console.warn(msg); } }, error: function(msg) { if (options3.logLevel >= logLevel_error) { console.error(msg); } } }]; } for (var i_1 = 0; i_1 < options3.loggers.length; i_1++) { less2.logger.addListener(options3.loggers[i_1]); } }); var ErrorReporting = (function(window2, less2, options3) { function errorHTML(e2, rootHref) { var id = "less-error-message:".concat(extractId(rootHref || "")); var template = '
  • {content}
  • '; var elem = window2.document.createElement("div"); var timer; var content; var errors2 = []; var filename = e2.filename || rootHref; var filenameNoPath = filename.match(/([^/]+(\?.*)?)$/)[1]; elem.id = id; elem.className = "less-error-message"; content = "

    ".concat(e2.type || "Syntax", "Error: ").concat(e2.message || "There is an error in your .less file") + '

    in ').concat(filenameNoPath, " "); var errorline = function(e3, i, classname) { if (e3.extract[i] !== void 0) { errors2.push(template.replace(/\{line\}/, (parseInt(e3.line, 10) || 0) + (i - 1)).replace(/\{class\}/, classname).replace(/\{content\}/, e3.extract[i])); } }; if (e2.line) { errorline(e2, 0, ""); errorline(e2, 1, "line"); errorline(e2, 2, ""); content += "on line ".concat(e2.line, ", column ").concat(e2.column + 1, ":

      ").concat(errors2.join(""), "
    "); } if (e2.stack && (e2.extract || options3.logLevel >= 4)) { content += "
    Stack Trace
    ".concat(e2.stack.split("\n").slice(1).join("
    ")); } elem.innerHTML = content; browser.createCSS(window2.document, [ ".less-error-message ul, .less-error-message li {", "list-style-type: none;", "margin-right: 15px;", "padding: 4px 0;", "margin: 0;", "}", ".less-error-message label {", "font-size: 12px;", "margin-right: 15px;", "padding: 4px 0;", "color: #cc7777;", "}", ".less-error-message pre {", "color: #dd6666;", "padding: 4px 0;", "margin: 0;", "display: inline-block;", "}", ".less-error-message pre.line {", "color: #ff0000;", "}", ".less-error-message h3 {", "font-size: 20px;", "font-weight: bold;", "padding: 15px 0 5px 0;", "margin: 0;", "}", ".less-error-message a {", "color: #10a", "}", ".less-error-message .error {", "color: red;", "font-weight: bold;", "padding-bottom: 2px;", "border-bottom: 1px dashed red;", "}" ].join("\n"), { title: "error-message" }); elem.style.cssText = [ "font-family: Arial, sans-serif", "border: 1px solid #e00", "background-color: #eee", "border-radius: 5px", "-webkit-border-radius: 5px", "-moz-border-radius: 5px", "color: #e00", "padding: 15px", "margin-bottom: 15px" ].join(";"); if (options3.env === "development") { timer = setInterval(function() { var document2 = window2.document; var body = document2.body; if (body) { if (document2.getElementById(id)) { body.replaceChild(elem, document2.getElementById(id)); } else { body.insertBefore(elem, body.firstChild); } clearInterval(timer); } }, 10); } } function removeErrorHTML(path) { var node = window2.document.getElementById("less-error-message:".concat(extractId(path))); if (node) { node.parentNode.removeChild(node); } } function removeError(path) { if (!options3.errorReporting || options3.errorReporting === "html") { removeErrorHTML(path); } else if (options3.errorReporting === "console") ; else if (typeof options3.errorReporting === "function") { options3.errorReporting("remove", path); } } function errorConsole(e2, rootHref) { var template = "{line} {content}"; var filename = e2.filename || rootHref; var errors2 = []; var content = "".concat(e2.type || "Syntax", "Error: ").concat(e2.message || "There is an error in your .less file", " in ").concat(filename); var errorline = function(e3, i, classname) { if (e3.extract[i] !== void 0) { errors2.push(template.replace(/\{line\}/, (parseInt(e3.line, 10) || 0) + (i - 1)).replace(/\{class\}/, classname).replace(/\{content\}/, e3.extract[i])); } }; if (e2.line) { errorline(e2, 0, ""); errorline(e2, 1, "line"); errorline(e2, 2, ""); content += " on line ".concat(e2.line, ", column ").concat(e2.column + 1, ":\n").concat(errors2.join("\n")); } if (e2.stack && (e2.extract || options3.logLevel >= 4)) { content += "\nStack Trace\n".concat(e2.stack); } less2.logger.error(content); } function error(e2, rootHref) { if (!options3.errorReporting || options3.errorReporting === "html") { errorHTML(e2, rootHref); } else if (options3.errorReporting === "console") { errorConsole(e2, rootHref); } else if (typeof options3.errorReporting === "function") { options3.errorReporting("add", e2, rootHref); } } return { add: error, remove: removeError }; }); var Cache = (function(window2, options3, logger2) { var cache2 = null; if (options3.env !== "development") { try { cache2 = typeof window2.localStorage === "undefined" ? null : window2.localStorage; } catch (_2) { } } return { setCSS: function(path, lastModified, modifyVars, styles) { if (cache2) { logger2.info("saving ".concat(path, " to cache.")); try { cache2.setItem(path, styles); cache2.setItem("".concat(path, ":timestamp"), lastModified); if (modifyVars) { cache2.setItem("".concat(path, ":vars"), JSON.stringify(modifyVars)); } } catch (e2) { logger2.error('failed to save "'.concat(path, '" to local storage for caching.')); } } }, getCSS: function(path, webInfo, modifyVars) { var css3 = cache2 && cache2.getItem(path); var timestamp = cache2 && cache2.getItem("".concat(path, ":timestamp")); var vars = cache2 && cache2.getItem("".concat(path, ":vars")); modifyVars = modifyVars || {}; vars = vars || "{}"; if (timestamp && webInfo.lastModified && new Date(webInfo.lastModified).valueOf() === new Date(timestamp).valueOf() && JSON.stringify(modifyVars) === vars) { return css3; } } }; }); var ImageSize = (function() { function imageSize() { throw { type: "Runtime", message: "Image size functions are not supported in browser version of less" }; } var imageFunctions = { "image-size": function(filePathNode) { imageSize(); return -1; }, "image-width": function(filePathNode) { imageSize(); return -1; }, "image-height": function(filePathNode) { imageSize(); return -1; } }; functionRegistry.addMultiple(imageFunctions); }); var root = (function(window2, options3) { var document2 = window2.document; var less2 = lessRoot(); less2.options = options3; var environment = less2.environment; var FileManager2 = FM(options3, less2.logger); var fileManager = new FileManager2(); environment.addFileManager(fileManager); less2.FileManager = FileManager2; less2.PluginLoader = PluginLoader; LogListener(less2, options3); var errors2 = ErrorReporting(window2, less2, options3); var cache2 = less2.cache = options3.cache || Cache(window2, options3, less2.logger); ImageSize(less2.environment); if (options3.functions) { less2.functions.functionRegistry.addMultiple(options3.functions); } var typePattern = /^text\/(x-)?less$/; function clone2(obj) { var cloned = {}; for (var prop in obj) { if (Object.prototype.hasOwnProperty.call(obj, prop)) { cloned[prop] = obj[prop]; } } return cloned; } function bind(func, thisArg) { var curryArgs = Array.prototype.slice.call(arguments, 2); return function() { var args = curryArgs.concat(Array.prototype.slice.call(arguments, 0)); return func.apply(thisArg, args); }; } function loadStyles(modifyVars) { var styles = document2.getElementsByTagName("style"); var style2; for (var i_1 = 0; i_1 < styles.length; i_1++) { style2 = styles[i_1]; if (style2.type.match(typePattern)) { var instanceOptions = clone2(options3); instanceOptions.modifyVars = modifyVars; var lessText_1 = style2.innerHTML || ""; instanceOptions.filename = document2.location.href.replace(/#.*$/, ""); less2.render(lessText_1, instanceOptions, bind(function(style3, e2, result) { if (e2) { errors2.add(e2, "inline"); } else { style3.type = "text/css"; if (style3.styleSheet) { style3.styleSheet.cssText = result.css; } else { style3.innerHTML = result.css; } } }, null, style2)); } } } function loadStyleSheet(sheet, callback, reload, remaining, modifyVars) { var instanceOptions = clone2(options3); addDataAttr(instanceOptions, sheet); instanceOptions.mime = sheet.type; if (modifyVars) { instanceOptions.modifyVars = modifyVars; } function loadInitialFileCallback(loadedFile) { var data2 = loadedFile.contents; var path = loadedFile.filename; var webInfo = loadedFile.webInfo; var newFileInfo = { currentDirectory: fileManager.getPath(path), filename: path, rootFilename: path, rewriteUrls: instanceOptions.rewriteUrls }; newFileInfo.entryPath = newFileInfo.currentDirectory; newFileInfo.rootpath = instanceOptions.rootpath || newFileInfo.currentDirectory; if (webInfo) { webInfo.remaining = remaining; var css3 = cache2.getCSS(path, webInfo, instanceOptions.modifyVars); if (!reload && css3) { webInfo.local = true; callback(null, css3, data2, sheet, webInfo, path); return; } } errors2.remove(path); instanceOptions.rootFileInfo = newFileInfo; less2.render(data2, instanceOptions, function(e2, result) { if (e2) { e2.href = path; callback(e2); } else { cache2.setCSS(sheet.href, webInfo.lastModified, instanceOptions.modifyVars, result.css); callback(null, result.css, data2, sheet, webInfo, path); } }); } fileManager.loadFile(sheet.href, null, instanceOptions, environment).then(function(loadedFile) { loadInitialFileCallback(loadedFile); }).catch(function(err) { console.log(err); callback(err); }); } function loadStyleSheets(callback, reload, modifyVars) { for (var i_2 = 0; i_2 < less2.sheets.length; i_2++) { loadStyleSheet(less2.sheets[i_2], callback, reload, less2.sheets.length - (i_2 + 1), modifyVars); } } function initRunningMode() { if (less2.env === "development") { less2.watchTimer = setInterval(function() { if (less2.watchMode) { fileManager.clearFileCache(); loadStyleSheets(function(e2, css3, _2, sheet, webInfo) { if (e2) { errors2.add(e2, e2.href || sheet.href); } else if (css3) { browser.createCSS(window2.document, css3, sheet); } }); } }, options3.poll); } } less2.watch = function() { if (!less2.watchMode) { less2.env = "development"; initRunningMode(); } this.watchMode = true; return true; }; less2.unwatch = function() { clearInterval(less2.watchTimer); this.watchMode = false; return false; }; less2.registerStylesheetsImmediately = function() { var links = document2.getElementsByTagName("link"); less2.sheets = []; for (var i_3 = 0; i_3 < links.length; i_3++) { if (links[i_3].rel === "stylesheet/less" || links[i_3].rel.match(/stylesheet/) && links[i_3].type.match(typePattern)) { less2.sheets.push(links[i_3]); } } }; less2.registerStylesheets = function() { return new Promise(function(resolve) { less2.registerStylesheetsImmediately(); resolve(); }); }; less2.modifyVars = function(record) { return less2.refresh(true, record, false); }; less2.refresh = function(reload, modifyVars, clearFileCache) { if ((reload || clearFileCache) && clearFileCache !== false) { fileManager.clearFileCache(); } return new Promise(function(resolve, reject) { var startTime; var endTime; var totalMilliseconds; var remainingSheets; startTime = endTime = /* @__PURE__ */ new Date(); remainingSheets = less2.sheets.length; if (remainingSheets === 0) { endTime = /* @__PURE__ */ new Date(); totalMilliseconds = endTime - startTime; less2.logger.info("Less has finished and no sheets were loaded."); resolve({ startTime, endTime, totalMilliseconds, sheets: less2.sheets.length }); } else { loadStyleSheets(function(e2, css3, _2, sheet, webInfo) { if (e2) { errors2.add(e2, e2.href || sheet.href); reject(e2); return; } if (webInfo.local) { less2.logger.info("Loading ".concat(sheet.href, " from cache.")); } else { less2.logger.info("Rendered ".concat(sheet.href, " successfully.")); } browser.createCSS(window2.document, css3, sheet); less2.logger.info("CSS for ".concat(sheet.href, " generated in ").concat(/* @__PURE__ */ new Date() - endTime, "ms")); remainingSheets--; if (remainingSheets === 0) { totalMilliseconds = /* @__PURE__ */ new Date() - startTime; less2.logger.info("Less has finished. CSS generated in ".concat(totalMilliseconds, "ms")); resolve({ startTime, endTime, totalMilliseconds, sheets: less2.sheets.length }); } endTime = /* @__PURE__ */ new Date(); }, reload, modifyVars); } loadStyles(modifyVars); }); }; less2.refreshStyles = loadStyles; return less2; }); var options2 = defaultOptions2(); if (window.less) { for (var key in window.less) { if (Object.prototype.hasOwnProperty.call(window.less, key)) { options2[key] = window.less[key]; } } } addDefaultOptions(window, options2); options2.plugins = options2.plugins || []; if (window.LESS_PLUGINS) { options2.plugins = options2.plugins.concat(window.LESS_PLUGINS); } var less = root(window, options2); window.less = less; var css2; var head; var style; function resolveOrReject(data2) { if (data2.filename) { console.warn(data2); } if (!options2.async) { head.removeChild(style); } } if (options2.onReady) { if (/!watch/.test(window.location.hash)) { less.watch(); } if (!options2.async) { css2 = "body { display: none !important }"; head = document.head || document.getElementsByTagName("head")[0]; style = document.createElement("style"); style.type = "text/css"; if (style.styleSheet) { style.styleSheet.cssText = css2; } else { style.appendChild(document.createTextNode(css2)); } head.appendChild(style); } less.registerStylesheetsImmediately(); less.pageLoadFinished = less.refresh(less.env === "development").then(resolveOrReject, resolveOrReject); } return less; })); } }); // src/wasm/wasm_exec.js var require_wasm_exec = __commonJS({ "src/wasm/wasm_exec.js"() { "use strict"; (() => { const enosys = () => { const err = new Error("not implemented"); err.code = "ENOSYS"; return err; }; if (!globalThis.fs) { let outputBuf = ""; globalThis.fs = { constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused writeSync(fd, buf) { outputBuf += decoder.decode(buf); const nl = outputBuf.lastIndexOf("\n"); if (nl != -1) { console.log(outputBuf.substring(0, nl)); outputBuf = outputBuf.substring(nl + 1); } return buf.length; }, write(fd, buf, offset4, length, position, callback) { if (offset4 !== 0 || length !== buf.length || position !== null) { callback(enosys()); return; } const n = this.writeSync(fd, buf); callback(null, n); }, chmod(path, mode2, callback) { callback(enosys()); }, chown(path, uid, gid, callback) { callback(enosys()); }, close(fd, callback) { callback(enosys()); }, fchmod(fd, mode2, callback) { callback(enosys()); }, fchown(fd, uid, gid, callback) { callback(enosys()); }, fstat(fd, callback) { callback(enosys()); }, fsync(fd, callback) { callback(null); }, ftruncate(fd, length, callback) { callback(enosys()); }, lchown(path, uid, gid, callback) { callback(enosys()); }, link(path, link2, callback) { callback(enosys()); }, lstat(path, callback) { callback(enosys()); }, mkdir(path, perm, callback) { callback(enosys()); }, open(path, flags, mode2, callback) { callback(enosys()); }, read(fd, buffer, offset4, length, position, callback) { callback(enosys()); }, readdir(path, callback) { callback(enosys()); }, readlink(path, callback) { callback(enosys()); }, rename(from, to, callback) { callback(enosys()); }, rmdir(path, callback) { callback(enosys()); }, stat(path, callback) { callback(enosys()); }, symlink(path, link2, callback) { callback(enosys()); }, truncate(path, length, callback) { callback(enosys()); }, unlink(path, callback) { callback(enosys()); }, utimes(path, atime, mtime, callback) { callback(enosys()); } }; } if (!globalThis.process) { globalThis.process = { getuid() { return -1; }, getgid() { return -1; }, geteuid() { return -1; }, getegid() { return -1; }, getgroups() { throw enosys(); }, pid: -1, ppid: -1, umask() { throw enosys(); }, cwd() { throw enosys(); }, chdir() { throw enosys(); } }; } if (!globalThis.crypto) { throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)"); } if (!globalThis.performance) { throw new Error("globalThis.performance is not available, polyfill required (performance.now only)"); } if (!globalThis.TextEncoder) { throw new Error("globalThis.TextEncoder is not available, polyfill required"); } if (!globalThis.TextDecoder) { throw new Error("globalThis.TextDecoder is not available, polyfill required"); } const encoder = new TextEncoder("utf-8"); const decoder = new TextDecoder("utf-8"); globalThis.Go = class { constructor() { this.argv = ["js"]; this.env = {}; this.exit = (code) => { if (code !== 0) { console.warn("exit code:", code); } }; this._exitPromise = new Promise((resolve) => { this._resolveExitPromise = resolve; }); this._pendingEvent = null; this._scheduledTimeouts = /* @__PURE__ */ new Map(); this._nextCallbackTimeoutID = 1; const setInt64 = (addr, v2) => { this.mem.setUint32(addr + 0, v2, true); this.mem.setUint32(addr + 4, Math.floor(v2 / 4294967296), true); }; const setInt32 = (addr, v2) => { this.mem.setUint32(addr + 0, v2, true); }; const getInt64 = (addr) => { const low = this.mem.getUint32(addr + 0, true); const high = this.mem.getInt32(addr + 4, true); return low + high * 4294967296; }; const loadValue = (addr) => { const f = this.mem.getFloat64(addr, true); if (f === 0) { return void 0; } if (!isNaN(f)) { return f; } const id = this.mem.getUint32(addr, true); return this._values[id]; }; const storeValue = (addr, v2) => { const nanHead = 2146959360; if (typeof v2 === "number" && v2 !== 0) { if (isNaN(v2)) { this.mem.setUint32(addr + 4, nanHead, true); this.mem.setUint32(addr, 0, true); return; } this.mem.setFloat64(addr, v2, true); return; } if (v2 === void 0) { this.mem.setFloat64(addr, 0, true); return; } let id = this._ids.get(v2); if (id === void 0) { id = this._idPool.pop(); if (id === void 0) { id = this._values.length; } this._values[id] = v2; this._goRefCounts[id] = 0; this._ids.set(v2, id); } this._goRefCounts[id]++; let typeFlag = 0; switch (typeof v2) { case "object": if (v2 !== null) { typeFlag = 1; } break; case "string": typeFlag = 2; break; case "symbol": typeFlag = 3; break; case "function": typeFlag = 4; break; } this.mem.setUint32(addr + 4, nanHead | typeFlag, true); this.mem.setUint32(addr, id, true); }; const loadSlice = (addr) => { const array = getInt64(addr + 0); const len = getInt64(addr + 8); return new Uint8Array(this._inst.exports.mem.buffer, array, len); }; const loadSliceOfValues = (addr) => { const array = getInt64(addr + 0); const len = getInt64(addr + 8); const a = new Array(len); for (let i = 0; i < len; i++) { a[i] = loadValue(array + i * 8); } return a; }; const loadString = (addr) => { const saddr = getInt64(addr + 0); const len = getInt64(addr + 8); return decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len)); }; const timeOrigin = Date.now() - performance.now(); this.importObject = { _gotest: { add: (a, b2) => a + b2 }, gojs: { // Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters) // may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported // function. A goroutine can switch to a new stack if the current stack is too small (see morestack function). // This changes the SP, thus we have to update the SP used by the imported function. // func wasmExit(code int32) "runtime.wasmExit": (sp) => { sp >>>= 0; const code = this.mem.getInt32(sp + 8, true); this.exited = true; delete this._inst; delete this._values; delete this._goRefCounts; delete this._ids; delete this._idPool; this.exit(code); }, // func wasmWrite(fd uintptr, p unsafe.Pointer, n int32) "runtime.wasmWrite": (sp) => { sp >>>= 0; const fd = getInt64(sp + 8); const p2 = getInt64(sp + 16); const n = this.mem.getInt32(sp + 24, true); fs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p2, n)); }, // func resetMemoryDataView() "runtime.resetMemoryDataView": (sp) => { sp >>>= 0; this.mem = new DataView(this._inst.exports.mem.buffer); }, // func nanotime1() int64 "runtime.nanotime1": (sp) => { sp >>>= 0; setInt64(sp + 8, (timeOrigin + performance.now()) * 1e6); }, // func walltime() (sec int64, nsec int32) "runtime.walltime": (sp) => { sp >>>= 0; const msec = (/* @__PURE__ */ new Date()).getTime(); setInt64(sp + 8, msec / 1e3); this.mem.setInt32(sp + 16, msec % 1e3 * 1e6, true); }, // func scheduleTimeoutEvent(delay int64) int32 "runtime.scheduleTimeoutEvent": (sp) => { sp >>>= 0; const id = this._nextCallbackTimeoutID; this._nextCallbackTimeoutID++; this._scheduledTimeouts.set(id, setTimeout( () => { this._resume(); while (this._scheduledTimeouts.has(id)) { console.warn("scheduleTimeoutEvent: missed timeout event"); this._resume(); } }, getInt64(sp + 8) )); this.mem.setInt32(sp + 16, id, true); }, // func clearTimeoutEvent(id int32) "runtime.clearTimeoutEvent": (sp) => { sp >>>= 0; const id = this.mem.getInt32(sp + 8, true); clearTimeout(this._scheduledTimeouts.get(id)); this._scheduledTimeouts.delete(id); }, // func getRandomData(r []byte) "runtime.getRandomData": (sp) => { sp >>>= 0; crypto.getRandomValues(loadSlice(sp + 8)); }, // func finalizeRef(v ref) "syscall/js.finalizeRef": (sp) => { sp >>>= 0; const id = this.mem.getUint32(sp + 8, true); this._goRefCounts[id]--; if (this._goRefCounts[id] === 0) { const v2 = this._values[id]; this._values[id] = null; this._ids.delete(v2); this._idPool.push(id); } }, // func stringVal(value string) ref "syscall/js.stringVal": (sp) => { sp >>>= 0; storeValue(sp + 24, loadString(sp + 8)); }, // func valueGet(v ref, p string) ref "syscall/js.valueGet": (sp) => { sp >>>= 0; const result = Reflect.get(loadValue(sp + 8), loadString(sp + 16)); sp = this._inst.exports.getsp() >>> 0; storeValue(sp + 32, result); }, // func valueSet(v ref, p string, x ref) "syscall/js.valueSet": (sp) => { sp >>>= 0; Reflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32)); }, // func valueDelete(v ref, p string) "syscall/js.valueDelete": (sp) => { sp >>>= 0; Reflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16)); }, // func valueIndex(v ref, i int) ref "syscall/js.valueIndex": (sp) => { sp >>>= 0; storeValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16))); }, // valueSetIndex(v ref, i int, x ref) "syscall/js.valueSetIndex": (sp) => { sp >>>= 0; Reflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24)); }, // func valueCall(v ref, m string, args []ref) (ref, bool) "syscall/js.valueCall": (sp) => { sp >>>= 0; try { const v2 = loadValue(sp + 8); const m = Reflect.get(v2, loadString(sp + 16)); const args = loadSliceOfValues(sp + 32); const result = Reflect.apply(m, v2, args); sp = this._inst.exports.getsp() >>> 0; storeValue(sp + 56, result); this.mem.setUint8(sp + 64, 1); } catch (err) { sp = this._inst.exports.getsp() >>> 0; storeValue(sp + 56, err); this.mem.setUint8(sp + 64, 0); } }, // func valueInvoke(v ref, args []ref) (ref, bool) "syscall/js.valueInvoke": (sp) => { sp >>>= 0; try { const v2 = loadValue(sp + 8); const args = loadSliceOfValues(sp + 16); const result = Reflect.apply(v2, void 0, args); sp = this._inst.exports.getsp() >>> 0; storeValue(sp + 40, result); this.mem.setUint8(sp + 48, 1); } catch (err) { sp = this._inst.exports.getsp() >>> 0; storeValue(sp + 40, err); this.mem.setUint8(sp + 48, 0); } }, // func valueNew(v ref, args []ref) (ref, bool) "syscall/js.valueNew": (sp) => { sp >>>= 0; try { const v2 = loadValue(sp + 8); const args = loadSliceOfValues(sp + 16); const result = Reflect.construct(v2, args); sp = this._inst.exports.getsp() >>> 0; storeValue(sp + 40, result); this.mem.setUint8(sp + 48, 1); } catch (err) { sp = this._inst.exports.getsp() >>> 0; storeValue(sp + 40, err); this.mem.setUint8(sp + 48, 0); } }, // func valueLength(v ref) int "syscall/js.valueLength": (sp) => { sp >>>= 0; setInt64(sp + 16, parseInt(loadValue(sp + 8).length)); }, // valuePrepareString(v ref) (ref, int) "syscall/js.valuePrepareString": (sp) => { sp >>>= 0; const str = encoder.encode(String(loadValue(sp + 8))); storeValue(sp + 16, str); setInt64(sp + 24, str.length); }, // valueLoadString(v ref, b []byte) "syscall/js.valueLoadString": (sp) => { sp >>>= 0; const str = loadValue(sp + 8); loadSlice(sp + 16).set(str); }, // func valueInstanceOf(v ref, t ref) bool "syscall/js.valueInstanceOf": (sp) => { sp >>>= 0; this.mem.setUint8(sp + 24, loadValue(sp + 8) instanceof loadValue(sp + 16) ? 1 : 0); }, // func copyBytesToGo(dst []byte, src ref) (int, bool) "syscall/js.copyBytesToGo": (sp) => { sp >>>= 0; const dst = loadSlice(sp + 8); const src = loadValue(sp + 32); if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) { this.mem.setUint8(sp + 48, 0); return; } const toCopy = src.subarray(0, dst.length); dst.set(toCopy); setInt64(sp + 40, toCopy.length); this.mem.setUint8(sp + 48, 1); }, // func copyBytesToJS(dst ref, src []byte) (int, bool) "syscall/js.copyBytesToJS": (sp) => { sp >>>= 0; const dst = loadValue(sp + 8); const src = loadSlice(sp + 16); if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) { this.mem.setUint8(sp + 48, 0); return; } const toCopy = src.subarray(0, dst.length); dst.set(toCopy); setInt64(sp + 40, toCopy.length); this.mem.setUint8(sp + 48, 1); }, "debug": (value) => { console.log(value); } } }; } async run(instance) { if (!(instance instanceof WebAssembly.Instance)) { throw new Error("Go.run: WebAssembly.Instance expected"); } this._inst = instance; this.mem = new DataView(this._inst.exports.mem.buffer); this._values = [ // JS values that Go currently has references to, indexed by reference id NaN, 0, null, true, false, globalThis, this ]; this._goRefCounts = new Array(this._values.length).fill(Infinity); this._ids = /* @__PURE__ */ new Map([ // mapping from JS values to reference ids [0, 1], [null, 2], [true, 3], [false, 4], [globalThis, 5], [this, 6] ]); this._idPool = []; this.exited = false; let offset4 = 4096; const strPtr = (str) => { const ptr = offset4; const bytes = encoder.encode(str + "\0"); new Uint8Array(this.mem.buffer, offset4, bytes.length).set(bytes); offset4 += bytes.length; if (offset4 % 8 !== 0) { offset4 += 8 - offset4 % 8; } return ptr; }; const argc = this.argv.length; const argvPtrs = []; this.argv.forEach((arg) => { argvPtrs.push(strPtr(arg)); }); argvPtrs.push(0); const keys = Object.keys(this.env).sort(); keys.forEach((key) => { argvPtrs.push(strPtr(`${key}=${this.env[key]}`)); }); argvPtrs.push(0); const argv = offset4; argvPtrs.forEach((ptr) => { this.mem.setUint32(offset4, ptr, true); this.mem.setUint32(offset4 + 4, 0, true); offset4 += 8; }); const wasmMinDataAddr = 4096 + 8192; if (offset4 >= wasmMinDataAddr) { throw new Error("total length of command line and environment variables exceeds limit"); } this._inst.exports.run(argc, argv); if (this.exited) { this._resolveExitPromise(); } await this._exitPromise; } _resume() { if (this.exited) { throw new Error("Go program has already exited"); } this._inst.exports.resume(); if (this.exited) { this._resolveExitPromise(); } } _makeFuncWrapper(id) { const go = this; return function() { const event = { id, this: this, args: arguments }; go._pendingEvent = event; go._resume(); return event.result; }; } }; })(); } }); // node_modules/react/cjs/react.development.js var require_react_development = __commonJS({ "node_modules/react/cjs/react.development.js"(exports, module2) { "use strict"; (function() { function defineDeprecationWarning(methodName, info) { Object.defineProperty(Component3.prototype, methodName, { get: function() { console.warn( "%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1] ); } }); } function getIteratorFn(maybeIterable) { if (null === maybeIterable || "object" !== typeof maybeIterable) return null; maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"]; return "function" === typeof maybeIterable ? maybeIterable : null; } function warnNoop(publicInstance, callerName) { publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass"; var warningKey = publicInstance + "." + callerName; didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error( "Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, publicInstance ), didWarnStateUpdateForUnmountedComponent[warningKey] = true); } function Component3(props, context, updater) { this.props = props; this.context = context; this.refs = emptyObject; this.updater = updater || ReactNoopUpdateQueue; } function ComponentDummy() { } function PureComponent(props, context, updater) { this.props = props; this.context = context; this.refs = emptyObject; this.updater = updater || ReactNoopUpdateQueue; } function noop4() { } function testStringCoercion(value) { return "" + value; } function checkKeyStringCoercion(value) { try { testStringCoercion(value); var JSCompiler_inline_result = false; } catch (e2) { JSCompiler_inline_result = true; } if (JSCompiler_inline_result) { JSCompiler_inline_result = console; var JSCompiler_temp_const = JSCompiler_inline_result.error; var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object"; JSCompiler_temp_const.call( JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0 ); return testStringCoercion(value); } } function getComponentNameFromType(type) { if (null == type) return null; if ("function" === typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null; if ("string" === typeof type) return type; switch (type) { case REACT_FRAGMENT_TYPE: return "Fragment"; case REACT_PROFILER_TYPE: return "Profiler"; case REACT_STRICT_MODE_TYPE: return "StrictMode"; case REACT_SUSPENSE_TYPE: return "Suspense"; case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList"; case REACT_ACTIVITY_TYPE: return "Activity"; } if ("object" === typeof type) switch ("number" === typeof type.tag && console.error( "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." ), type.$$typeof) { case REACT_PORTAL_TYPE: return "Portal"; case REACT_CONTEXT_TYPE: return type.displayName || "Context"; case REACT_CONSUMER_TYPE: return (type._context.displayName || "Context") + ".Consumer"; case REACT_FORWARD_REF_TYPE: var innerType = type.render; type = type.displayName; type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"); return type; case REACT_MEMO_TYPE: return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo"; case REACT_LAZY_TYPE: innerType = type._payload; type = type._init; try { return getComponentNameFromType(type(innerType)); } catch (x2) { } } return null; } function getTaskName(type) { if (type === REACT_FRAGMENT_TYPE) return "<>"; if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE) return "<...>"; try { var name = getComponentNameFromType(type); return name ? "<" + name + ">" : "<...>"; } catch (x2) { return "<...>"; } } function getOwner() { var dispatcher = ReactSharedInternals.A; return null === dispatcher ? null : dispatcher.getOwner(); } function UnknownOwner() { return Error("react-stack-top-frame"); } function hasValidKey(config2) { if (hasOwnProperty.call(config2, "key")) { var getter = Object.getOwnPropertyDescriptor(config2, "key").get; if (getter && getter.isReactWarning) return false; } return void 0 !== config2.key; } function defineKeyPropWarningGetter(props, displayName) { function warnAboutAccessingKey() { specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error( "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", displayName )); } warnAboutAccessingKey.isReactWarning = true; Object.defineProperty(props, "key", { get: warnAboutAccessingKey, configurable: true }); } function elementRefGetterWithDeprecationWarning() { var componentName = getComponentNameFromType(this.type); didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error( "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release." )); componentName = this.props.ref; return void 0 !== componentName ? componentName : null; } function ReactElement(type, key, props, owner, debugStack, debugTask) { var refProp = props.ref; type = { $$typeof: REACT_ELEMENT_TYPE, type, key, props, _owner: owner }; null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", { enumerable: false, get: elementRefGetterWithDeprecationWarning }) : Object.defineProperty(type, "ref", { enumerable: false, value: null }); type._store = {}; Object.defineProperty(type._store, "validated", { configurable: false, enumerable: false, writable: true, value: 0 }); Object.defineProperty(type, "_debugInfo", { configurable: false, enumerable: false, writable: true, value: null }); Object.defineProperty(type, "_debugStack", { configurable: false, enumerable: false, writable: true, value: debugStack }); Object.defineProperty(type, "_debugTask", { configurable: false, enumerable: false, writable: true, value: debugTask }); Object.freeze && (Object.freeze(type.props), Object.freeze(type)); return type; } function cloneAndReplaceKey(oldElement, newKey) { newKey = ReactElement( oldElement.type, newKey, oldElement.props, oldElement._owner, oldElement._debugStack, oldElement._debugTask ); oldElement._store && (newKey._store.validated = oldElement._store.validated); return newKey; } function validateChildKeys(node) { isValidElement2(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement2(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1)); } function isValidElement2(object) { return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE; } function escape2(key) { var escaperLookup = { "=": "=0", ":": "=2" }; return "$" + key.replace(/[=:]/g, function(match) { return escaperLookup[match]; }); } function getElementKey(element, index2) { return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape2("" + element.key)) : index2.toString(36); } function resolveThenable(thenable) { switch (thenable.status) { case "fulfilled": return thenable.value; case "rejected": throw thenable.reason; default: switch ("string" === typeof thenable.status ? thenable.then(noop4, noop4) : (thenable.status = "pending", thenable.then( function(fulfilledValue) { "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue); }, function(error) { "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error); } )), thenable.status) { case "fulfilled": return thenable.value; case "rejected": throw thenable.reason; } } throw thenable; } function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { var type = typeof children; if ("undefined" === type || "boolean" === type) children = null; var invokeCallback = false; if (null === children) invokeCallback = true; else switch (type) { case "bigint": case "string": case "number": invokeCallback = true; break; case "object": switch (children.$$typeof) { case REACT_ELEMENT_TYPE: case REACT_PORTAL_TYPE: invokeCallback = true; break; case REACT_LAZY_TYPE: return invokeCallback = children._init, mapIntoArray( invokeCallback(children._payload), array, escapedPrefix, nameSoFar, callback ); } } if (invokeCallback) { invokeCallback = children; callback = callback(invokeCallback); var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar; isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c2) { return c2; })) : null != callback && (isValidElement2(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey( callback, escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace( userProvidedKeyEscapeRegex, "$&/" ) + "/") + childKey ), "" !== nameSoFar && null != invokeCallback && isValidElement2(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback)); return 1; } invokeCallback = 0; childKey = "" === nameSoFar ? "." : nameSoFar + ":"; if (isArrayImpl(children)) for (var i = 0; i < children.length; i++) nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray( nameSoFar, array, escapedPrefix, type, callback ); else if (i = getIteratorFn(children), "function" === typeof i) for (i === children.entries && (didWarnAboutMaps || console.warn( "Using Maps as children is not supported. Use an array of keyed ReactElements instead." ), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; ) nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray( nameSoFar, array, escapedPrefix, type, callback ); else if ("object" === type) { if ("function" === typeof children.then) return mapIntoArray( resolveThenable(children), array, escapedPrefix, nameSoFar, callback ); array = String(children); throw Error( "Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead." ); } return invokeCallback; } function mapChildren(children, func, context) { if (null == children) return children; var result = [], count3 = 0; mapIntoArray(children, result, "", "", function(child) { return func.call(context, child, count3++); }); return result; } function lazyInitializer(payload) { if (-1 === payload._status) { var ioInfo = payload._ioInfo; null != ioInfo && (ioInfo.start = ioInfo.end = performance.now()); ioInfo = payload._result; var thenable = ioInfo(); thenable.then( function(moduleObject) { if (0 === payload._status || -1 === payload._status) { payload._status = 1; payload._result = moduleObject; var _ioInfo = payload._ioInfo; null != _ioInfo && (_ioInfo.end = performance.now()); void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject); } }, function(error) { if (0 === payload._status || -1 === payload._status) { payload._status = 2; payload._result = error; var _ioInfo2 = payload._ioInfo; null != _ioInfo2 && (_ioInfo2.end = performance.now()); void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error); } } ); ioInfo = payload._ioInfo; if (null != ioInfo) { ioInfo.value = thenable; var displayName = thenable.displayName; "string" === typeof displayName && (ioInfo.name = displayName); } -1 === payload._status && (payload._status = 0, payload._result = thenable); } if (1 === payload._status) return ioInfo = payload._result, void 0 === ioInfo && console.error( "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", ioInfo ), "default" in ioInfo || console.error( "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", ioInfo ), ioInfo.default; throw payload._result; } function resolveDispatcher() { var dispatcher = ReactSharedInternals.H; null === dispatcher && console.error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." ); return dispatcher; } function releaseAsyncTransition() { ReactSharedInternals.asyncTransitions--; } function enqueueTask(task) { if (null === enqueueTaskImpl) try { var requireString = ("require" + Math.random()).slice(0, 7); enqueueTaskImpl = (module2 && module2[requireString]).call( module2, "timers" ).setImmediate; } catch (_err) { enqueueTaskImpl = function(callback) { false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.error( "This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning." )); var channel = new MessageChannel(); channel.port1.onmessage = callback; channel.port2.postMessage(void 0); }; } return enqueueTaskImpl(task); } function aggregateErrors(errors2) { return 1 < errors2.length && "function" === typeof AggregateError ? new AggregateError(errors2) : errors2[0]; } function popActScope(prevActQueue, prevActScopeDepth) { prevActScopeDepth !== actScopeDepth - 1 && console.error( "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. " ); actScopeDepth = prevActScopeDepth; } function recursivelyFlushAsyncActWork(returnValue, resolve, reject) { var queue = ReactSharedInternals.actQueue; if (null !== queue) if (0 !== queue.length) try { flushActQueue(queue); enqueueTask(function() { return recursivelyFlushAsyncActWork(returnValue, resolve, reject); }); return; } catch (error) { ReactSharedInternals.thrownErrors.push(error); } else ReactSharedInternals.actQueue = null; 0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue); } function flushActQueue(queue) { if (!isFlushing) { isFlushing = true; var i = 0; try { for (; i < queue.length; i++) { var callback = queue[i]; do { ReactSharedInternals.didUsePromise = false; var continuation = callback(false); if (null !== continuation) { if (ReactSharedInternals.didUsePromise) { queue[i] = callback; queue.splice(0, i); return; } callback = continuation; } else break; } while (1); } queue.length = 0; } catch (error) { queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error); } finally { isFlushing = false; } } } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = { isMounted: function() { return false; }, enqueueForceUpdate: function(publicInstance) { warnNoop(publicInstance, "forceUpdate"); }, enqueueReplaceState: function(publicInstance) { warnNoop(publicInstance, "replaceState"); }, enqueueSetState: function(publicInstance) { warnNoop(publicInstance, "setState"); } }, assign = Object.assign, emptyObject = {}; Object.freeze(emptyObject); Component3.prototype.isReactComponent = {}; Component3.prototype.setState = function(partialState, callback) { if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState) throw Error( "takes an object of state variables to update or a function which returns an object of state variables." ); this.updater.enqueueSetState(this, partialState, callback, "setState"); }; Component3.prototype.forceUpdate = function(callback) { this.updater.enqueueForceUpdate(this, callback, "forceUpdate"); }; var deprecatedAPIs = { isMounted: [ "isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks." ], replaceState: [ "replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)." ] }; for (fnName in deprecatedAPIs) deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); ComponentDummy.prototype = Component3.prototype; deprecatedAPIs = PureComponent.prototype = new ComponentDummy(); deprecatedAPIs.constructor = PureComponent; assign(deprecatedAPIs, Component3.prototype); deprecatedAPIs.isPureReactComponent = true; var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = { H: null, A: null, T: null, S: null, actQueue: null, asyncTransitions: 0, isBatchingLegacy: false, didScheduleLegacyUpdate: false, didUsePromise: false, thrownErrors: [], getCurrentStack: null, recentlyCreatedOwnerStacks: 0 }, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() { return null; }; deprecatedAPIs = { react_stack_bottom_frame: function(callStackForError) { return callStackForError(); } }; var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime; var didWarnAboutElementRef = {}; var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind( deprecatedAPIs, UnknownOwner )(); var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner)); var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) { if ("object" === typeof window && "function" === typeof window.ErrorEvent) { var event = new window.ErrorEvent("error", { bubbles: true, cancelable: true, message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error), error }); if (!window.dispatchEvent(event)) return; } else if ("object" === typeof process && "function" === typeof process.emit) { process.emit("uncaughtException", error); return; } console.error(error); }, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) { queueMicrotask(function() { return queueMicrotask(callback); }); } : enqueueTask; deprecatedAPIs = Object.freeze({ __proto__: null, c: function(size4) { return resolveDispatcher().useMemoCache(size4); } }); var fnName = { map: mapChildren, forEach: function(children, forEachFunc, forEachContext) { mapChildren( children, function() { forEachFunc.apply(this, arguments); }, forEachContext ); }, count: function(children) { var n = 0; mapChildren(children, function() { n++; }); return n; }, toArray: function(children) { return mapChildren(children, function(child) { return child; }) || []; }, only: function(children) { if (!isValidElement2(children)) throw Error( "React.Children.only expected to receive a single React element child." ); return children; } }; exports.Activity = REACT_ACTIVITY_TYPE; exports.Children = fnName; exports.Component = Component3; exports.Fragment = REACT_FRAGMENT_TYPE; exports.Profiler = REACT_PROFILER_TYPE; exports.PureComponent = PureComponent; exports.StrictMode = REACT_STRICT_MODE_TYPE; exports.Suspense = REACT_SUSPENSE_TYPE; exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals; exports.__COMPILER_RUNTIME = deprecatedAPIs; exports.act = function(callback) { var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth; actScopeDepth++; var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false; try { var result = callback(); } catch (error) { ReactSharedInternals.thrownErrors.push(error); } if (0 < ReactSharedInternals.thrownErrors.length) throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback; if (null !== result && "object" === typeof result && "function" === typeof result.then) { var thenable = result; queueSeveralMicrotasks(function() { didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error( "You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);" )); }); return { then: function(resolve, reject) { didAwaitActCall = true; thenable.then( function(returnValue) { popActScope(prevActQueue, prevActScopeDepth); if (0 === prevActScopeDepth) { try { flushActQueue(queue), enqueueTask(function() { return recursivelyFlushAsyncActWork( returnValue, resolve, reject ); }); } catch (error$0) { ReactSharedInternals.thrownErrors.push(error$0); } if (0 < ReactSharedInternals.thrownErrors.length) { var _thrownError = aggregateErrors( ReactSharedInternals.thrownErrors ); ReactSharedInternals.thrownErrors.length = 0; reject(_thrownError); } } else resolve(returnValue); }, function(error) { popActScope(prevActQueue, prevActScopeDepth); 0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors( ReactSharedInternals.thrownErrors ), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error); } ); } }; } var returnValue$jscomp$0 = result; popActScope(prevActQueue, prevActScopeDepth); 0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() { didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error( "A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)" )); }), ReactSharedInternals.actQueue = null); if (0 < ReactSharedInternals.thrownErrors.length) throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback; return { then: function(resolve, reject) { didAwaitActCall = true; 0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() { return recursivelyFlushAsyncActWork( returnValue$jscomp$0, resolve, reject ); })) : resolve(returnValue$jscomp$0); } }; }; exports.cache = function(fn) { return function() { return fn.apply(null, arguments); }; }; exports.cacheSignal = function() { return null; }; exports.captureOwnerStack = function() { var getCurrentStack = ReactSharedInternals.getCurrentStack; return null === getCurrentStack ? null : getCurrentStack(); }; exports.cloneElement = function(element, config2, children) { if (null === element || void 0 === element) throw Error( "The argument must be a React element, but you passed " + element + "." ); var props = assign({}, element.props), key = element.key, owner = element._owner; if (null != config2) { var JSCompiler_inline_result; a: { if (hasOwnProperty.call(config2, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor( config2, "ref" ).get) && JSCompiler_inline_result.isReactWarning) { JSCompiler_inline_result = false; break a; } JSCompiler_inline_result = void 0 !== config2.ref; } JSCompiler_inline_result && (owner = getOwner()); hasValidKey(config2) && (checkKeyStringCoercion(config2.key), key = "" + config2.key); for (propName in config2) !hasOwnProperty.call(config2, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config2.ref || (props[propName] = config2[propName]); } var propName = arguments.length - 2; if (1 === propName) props.children = children; else if (1 < propName) { JSCompiler_inline_result = Array(propName); for (var i = 0; i < propName; i++) JSCompiler_inline_result[i] = arguments[i + 2]; props.children = JSCompiler_inline_result; } props = ReactElement( element.type, key, props, owner, element._debugStack, element._debugTask ); for (key = 2; key < arguments.length; key++) validateChildKeys(arguments[key]); return props; }; exports.createContext = function(defaultValue2) { defaultValue2 = { $$typeof: REACT_CONTEXT_TYPE, _currentValue: defaultValue2, _currentValue2: defaultValue2, _threadCount: 0, Provider: null, Consumer: null }; defaultValue2.Provider = defaultValue2; defaultValue2.Consumer = { $$typeof: REACT_CONSUMER_TYPE, _context: defaultValue2 }; defaultValue2._currentRenderer = null; defaultValue2._currentRenderer2 = null; return defaultValue2; }; exports.createElement = function(type, config2, children) { for (var i = 2; i < arguments.length; i++) validateChildKeys(arguments[i]); i = {}; var key = null; if (null != config2) for (propName in didWarnAboutOldJSXRuntime || !("__self" in config2) || "key" in config2 || (didWarnAboutOldJSXRuntime = true, console.warn( "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform" )), hasValidKey(config2) && (checkKeyStringCoercion(config2.key), key = "" + config2.key), config2) hasOwnProperty.call(config2, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config2[propName]); var childrenLength = arguments.length - 2; if (1 === childrenLength) i.children = children; else if (1 < childrenLength) { for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++) childArray[_i] = arguments[_i + 2]; Object.freeze && Object.freeze(childArray); i.children = childArray; } if (type && type.defaultProps) for (propName in childrenLength = type.defaultProps, childrenLength) void 0 === i[propName] && (i[propName] = childrenLength[propName]); key && defineKeyPropWarningGetter( i, "function" === typeof type ? type.displayName || type.name || "Unknown" : type ); var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++; return ReactElement( type, key, i, getOwner(), propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack, propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask ); }; exports.createRef = function() { var refObject = { current: null }; Object.seal(refObject); return refObject; }; exports.forwardRef = function(render) { null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error( "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))." ) : "function" !== typeof render ? console.error( "forwardRef requires a render function but was given %s.", null === render ? "null" : typeof render ) : 0 !== render.length && 2 !== render.length && console.error( "forwardRef render functions accept exactly two parameters: props and ref. %s", 1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined." ); null != render && null != render.defaultProps && console.error( "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?" ); var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName; Object.defineProperty(elementType, "displayName", { enumerable: false, configurable: true, get: function() { return ownName; }, set: function(name) { ownName = name; render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name); } }); return elementType; }; exports.isValidElement = isValidElement2; exports.lazy = function(ctor) { ctor = { _status: -1, _result: ctor }; var lazyType = { $$typeof: REACT_LAZY_TYPE, _payload: ctor, _init: lazyInitializer }, ioInfo = { name: "lazy", start: -1, end: -1, value: null, owner: null, debugStack: Error("react-stack-top-frame"), debugTask: console.createTask ? console.createTask("lazy()") : null }; ctor._ioInfo = ioInfo; lazyType._debugInfo = [{ awaited: ioInfo }]; return lazyType; }; exports.memo = function(type, compare) { null == type && console.error( "memo: The first argument must be a component. Instead received: %s", null === type ? "null" : typeof type ); compare = { $$typeof: REACT_MEMO_TYPE, type, compare: void 0 === compare ? null : compare }; var ownName; Object.defineProperty(compare, "displayName", { enumerable: false, configurable: true, get: function() { return ownName; }, set: function(name) { ownName = name; type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name); } }); return compare; }; exports.startTransition = function(scope) { var prevTransition = ReactSharedInternals.T, currentTransition = {}; currentTransition._updatedFibers = /* @__PURE__ */ new Set(); ReactSharedInternals.T = currentTransition; try { var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S; null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue); "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop4, reportGlobalError)); } catch (error) { reportGlobalError(error); } finally { null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn( "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." )), null !== prevTransition && null !== currentTransition.types && (null !== prevTransition.types && prevTransition.types !== currentTransition.types && console.error( "We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React." ), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition; } }; exports.unstable_useCacheRefresh = function() { return resolveDispatcher().useCacheRefresh(); }; exports.use = function(usable) { return resolveDispatcher().use(usable); }; exports.useActionState = function(action, initialState, permalink) { return resolveDispatcher().useActionState( action, initialState, permalink ); }; exports.useCallback = function(callback, deps) { return resolveDispatcher().useCallback(callback, deps); }; exports.useContext = function(Context2) { var dispatcher = resolveDispatcher(); Context2.$$typeof === REACT_CONSUMER_TYPE && console.error( "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?" ); return dispatcher.useContext(Context2); }; exports.useDebugValue = function(value, formatterFn) { return resolveDispatcher().useDebugValue(value, formatterFn); }; exports.useDeferredValue = function(value, initialValue) { return resolveDispatcher().useDeferredValue(value, initialValue); }; exports.useEffect = function(create2, deps) { null == create2 && console.warn( "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?" ); return resolveDispatcher().useEffect(create2, deps); }; exports.useEffectEvent = function(callback) { return resolveDispatcher().useEffectEvent(callback); }; exports.useId = function() { return resolveDispatcher().useId(); }; exports.useImperativeHandle = function(ref, create2, deps) { return resolveDispatcher().useImperativeHandle(ref, create2, deps); }; exports.useInsertionEffect = function(create2, deps) { null == create2 && console.warn( "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?" ); return resolveDispatcher().useInsertionEffect(create2, deps); }; exports.useLayoutEffect = function(create2, deps) { null == create2 && console.warn( "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?" ); return resolveDispatcher().useLayoutEffect(create2, deps); }; exports.useMemo = function(create2, deps) { return resolveDispatcher().useMemo(create2, deps); }; exports.useOptimistic = function(passthrough, reducer2) { return resolveDispatcher().useOptimistic(passthrough, reducer2); }; exports.useReducer = function(reducer2, initialArg, init) { return resolveDispatcher().useReducer(reducer2, initialArg, init); }; exports.useRef = function(initialValue) { return resolveDispatcher().useRef(initialValue); }; exports.useState = function(initialState) { return resolveDispatcher().useState(initialState); }; exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) { return resolveDispatcher().useSyncExternalStore( subscribe, getSnapshot, getServerSnapshot ); }; exports.useTransition = function() { return resolveDispatcher().useTransition(); }; exports.version = "19.2.0"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); })(); } }); // node_modules/react/index.js var require_react = __commonJS({ "node_modules/react/index.js"(exports, module2) { "use strict"; if (false) { module2.exports = null; } else { module2.exports = require_react_development(); } } }); // node_modules/react/cjs/react-jsx-runtime.development.js var require_react_jsx_runtime_development = __commonJS({ "node_modules/react/cjs/react-jsx-runtime.development.js"(exports) { "use strict"; (function() { function getComponentNameFromType(type) { if (null == type) return null; if ("function" === typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null; if ("string" === typeof type) return type; switch (type) { case REACT_FRAGMENT_TYPE: return "Fragment"; case REACT_PROFILER_TYPE: return "Profiler"; case REACT_STRICT_MODE_TYPE: return "StrictMode"; case REACT_SUSPENSE_TYPE: return "Suspense"; case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList"; case REACT_ACTIVITY_TYPE: return "Activity"; } if ("object" === typeof type) switch ("number" === typeof type.tag && console.error( "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." ), type.$$typeof) { case REACT_PORTAL_TYPE: return "Portal"; case REACT_CONTEXT_TYPE: return type.displayName || "Context"; case REACT_CONSUMER_TYPE: return (type._context.displayName || "Context") + ".Consumer"; case REACT_FORWARD_REF_TYPE: var innerType = type.render; type = type.displayName; type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"); return type; case REACT_MEMO_TYPE: return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo"; case REACT_LAZY_TYPE: innerType = type._payload; type = type._init; try { return getComponentNameFromType(type(innerType)); } catch (x2) { } } return null; } function testStringCoercion(value) { return "" + value; } function checkKeyStringCoercion(value) { try { testStringCoercion(value); var JSCompiler_inline_result = false; } catch (e2) { JSCompiler_inline_result = true; } if (JSCompiler_inline_result) { JSCompiler_inline_result = console; var JSCompiler_temp_const = JSCompiler_inline_result.error; var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object"; JSCompiler_temp_const.call( JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0 ); return testStringCoercion(value); } } function getTaskName(type) { if (type === REACT_FRAGMENT_TYPE) return "<>"; if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE) return "<...>"; try { var name = getComponentNameFromType(type); return name ? "<" + name + ">" : "<...>"; } catch (x2) { return "<...>"; } } function getOwner() { var dispatcher = ReactSharedInternals.A; return null === dispatcher ? null : dispatcher.getOwner(); } function UnknownOwner() { return Error("react-stack-top-frame"); } function hasValidKey(config2) { if (hasOwnProperty.call(config2, "key")) { var getter = Object.getOwnPropertyDescriptor(config2, "key").get; if (getter && getter.isReactWarning) return false; } return void 0 !== config2.key; } function defineKeyPropWarningGetter(props, displayName) { function warnAboutAccessingKey() { specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error( "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", displayName )); } warnAboutAccessingKey.isReactWarning = true; Object.defineProperty(props, "key", { get: warnAboutAccessingKey, configurable: true }); } function elementRefGetterWithDeprecationWarning() { var componentName = getComponentNameFromType(this.type); didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error( "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release." )); componentName = this.props.ref; return void 0 !== componentName ? componentName : null; } function ReactElement(type, key, props, owner, debugStack, debugTask) { var refProp = props.ref; type = { $$typeof: REACT_ELEMENT_TYPE, type, key, props, _owner: owner }; null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", { enumerable: false, get: elementRefGetterWithDeprecationWarning }) : Object.defineProperty(type, "ref", { enumerable: false, value: null }); type._store = {}; Object.defineProperty(type._store, "validated", { configurable: false, enumerable: false, writable: true, value: 0 }); Object.defineProperty(type, "_debugInfo", { configurable: false, enumerable: false, writable: true, value: null }); Object.defineProperty(type, "_debugStack", { configurable: false, enumerable: false, writable: true, value: debugStack }); Object.defineProperty(type, "_debugTask", { configurable: false, enumerable: false, writable: true, value: debugTask }); Object.freeze && (Object.freeze(type.props), Object.freeze(type)); return type; } function jsxDEVImpl(type, config2, maybeKey, isStaticChildren, debugStack, debugTask) { var children = config2.children; if (void 0 !== children) if (isStaticChildren) if (isArrayImpl(children)) { for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++) validateChildKeys(children[isStaticChildren]); Object.freeze && Object.freeze(children); } else console.error( "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." ); else validateChildKeys(children); if (hasOwnProperty.call(config2, "key")) { children = getComponentNameFromType(type); var keys = Object.keys(config2).filter(function(k2) { return "key" !== k2; }); isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}"; didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error( 'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', isStaticChildren, children, keys, children ), didWarnAboutKeySpread[children + isStaticChildren] = true); } children = null; void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey); hasValidKey(config2) && (checkKeyStringCoercion(config2.key), children = "" + config2.key); if ("key" in config2) { maybeKey = {}; for (var propName in config2) "key" !== propName && (maybeKey[propName] = config2[propName]); } else maybeKey = config2; children && defineKeyPropWarningGetter( maybeKey, "function" === typeof type ? type.displayName || type.name || "Unknown" : type ); return ReactElement( type, children, maybeKey, getOwner(), debugStack, debugTask ); } function validateChildKeys(node) { isValidElement2(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement2(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1)); } function isValidElement2(object) { return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE; } var React53 = require_react(), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React53.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() { return null; }; React53 = { react_stack_bottom_frame: function(callStackForError) { return callStackForError(); } }; var specialPropKeyWarningShown; var didWarnAboutElementRef = {}; var unknownOwnerDebugStack = React53.react_stack_bottom_frame.bind( React53, UnknownOwner )(); var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner)); var didWarnAboutKeySpread = {}; exports.Fragment = REACT_FRAGMENT_TYPE; exports.jsx = function(type, config2, maybeKey) { var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++; return jsxDEVImpl( type, config2, maybeKey, false, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask ); }; exports.jsxs = function(type, config2, maybeKey) { var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++; return jsxDEVImpl( type, config2, maybeKey, true, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask ); }; })(); } }); // node_modules/react/jsx-runtime.js var require_jsx_runtime = __commonJS({ "node_modules/react/jsx-runtime.js"(exports, module2) { "use strict"; if (false) { module2.exports = null; } else { module2.exports = require_react_jsx_runtime_development(); } } }); // node_modules/react-dom/cjs/react-dom.development.js var require_react_dom_development = __commonJS({ "node_modules/react-dom/cjs/react-dom.development.js"(exports) { "use strict"; (function() { function noop4() { } function testStringCoercion(value) { return "" + value; } function createPortal$1(children, containerInfo, implementation) { var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null; try { testStringCoercion(key); var JSCompiler_inline_result = false; } catch (e2) { JSCompiler_inline_result = true; } JSCompiler_inline_result && (console.error( "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", "function" === typeof Symbol && Symbol.toStringTag && key[Symbol.toStringTag] || key.constructor.name || "Object" ), testStringCoercion(key)); return { $$typeof: REACT_PORTAL_TYPE, key: null == key ? null : "" + key, children, containerInfo, implementation }; } function getCrossOriginStringAs(as, input) { if ("font" === as) return ""; if ("string" === typeof input) return "use-credentials" === input ? input : ""; } function getValueDescriptorExpectingObjectForWarning(thing) { return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : 'something with type "' + typeof thing + '"'; } function getValueDescriptorExpectingEnumForWarning(thing) { return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : "string" === typeof thing ? JSON.stringify(thing) : "number" === typeof thing ? "`" + thing + "`" : 'something with type "' + typeof thing + '"'; } function resolveDispatcher() { var dispatcher = ReactSharedInternals.H; null === dispatcher && console.error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." ); return dispatcher; } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var React53 = require_react(), Internals = { d: { f: noop4, r: function() { throw Error( "Invalid form element. requestFormReset must be passed a form that was rendered by React." ); }, D: noop4, C: noop4, L: noop4, m: noop4, X: noop4, S: noop4, M: noop4 }, p: 0, findDOMNode: null }, REACT_PORTAL_TYPE = Symbol.for("react.portal"), ReactSharedInternals = React53.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; "function" === typeof Map && null != Map.prototype && "function" === typeof Map.prototype.forEach && "function" === typeof Set && null != Set.prototype && "function" === typeof Set.prototype.clear && "function" === typeof Set.prototype.forEach || console.error( "React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills" ); exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals; exports.createPortal = function(children, container) { var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null; if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType) throw Error("Target container is not a DOM element."); return createPortal$1(children, container, null, key); }; exports.flushSync = function(fn) { var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p; try { if (ReactSharedInternals.T = null, Internals.p = 2, fn) return fn(); } finally { ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f() && console.error( "flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task." ); } }; exports.preconnect = function(href, options2) { "string" === typeof href && href ? null != options2 && "object" !== typeof options2 ? console.error( "ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.", getValueDescriptorExpectingEnumForWarning(options2) ) : null != options2 && "string" !== typeof options2.crossOrigin && console.error( "ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.", getValueDescriptorExpectingObjectForWarning(options2.crossOrigin) ) : console.error( "ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.", getValueDescriptorExpectingObjectForWarning(href) ); "string" === typeof href && (options2 ? (options2 = options2.crossOrigin, options2 = "string" === typeof options2 ? "use-credentials" === options2 ? options2 : "" : void 0) : options2 = null, Internals.d.C(href, options2)); }; exports.prefetchDNS = function(href) { if ("string" !== typeof href || !href) console.error( "ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.", getValueDescriptorExpectingObjectForWarning(href) ); else if (1 < arguments.length) { var options2 = arguments[1]; "object" === typeof options2 && options2.hasOwnProperty("crossOrigin") ? console.error( "ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.", getValueDescriptorExpectingEnumForWarning(options2) ) : console.error( "ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.", getValueDescriptorExpectingEnumForWarning(options2) ); } "string" === typeof href && Internals.d.D(href); }; exports.preinit = function(href, options2) { "string" === typeof href && href ? null == options2 || "object" !== typeof options2 ? console.error( "ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.", getValueDescriptorExpectingEnumForWarning(options2) ) : "style" !== options2.as && "script" !== options2.as && console.error( 'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".', getValueDescriptorExpectingEnumForWarning(options2.as) ) : console.error( "ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.", getValueDescriptorExpectingObjectForWarning(href) ); if ("string" === typeof href && options2 && "string" === typeof options2.as) { var as = options2.as, crossOrigin = getCrossOriginStringAs(as, options2.crossOrigin), integrity = "string" === typeof options2.integrity ? options2.integrity : void 0, fetchPriority = "string" === typeof options2.fetchPriority ? options2.fetchPriority : void 0; "style" === as ? Internals.d.S( href, "string" === typeof options2.precedence ? options2.precedence : void 0, { crossOrigin, integrity, fetchPriority } ) : "script" === as && Internals.d.X(href, { crossOrigin, integrity, fetchPriority, nonce: "string" === typeof options2.nonce ? options2.nonce : void 0 }); } }; exports.preinitModule = function(href, options2) { var encountered = ""; "string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + "."); void 0 !== options2 && "object" !== typeof options2 ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options2) + "." : options2 && "as" in options2 && "script" !== options2.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingEnumForWarning(options2.as) + "."); if (encountered) console.error( "ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s", encountered ); else switch (encountered = options2 && "string" === typeof options2.as ? options2.as : "script", encountered) { case "script": break; default: encountered = getValueDescriptorExpectingEnumForWarning(encountered), console.error( 'ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)', encountered, href ); } if ("string" === typeof href) if ("object" === typeof options2 && null !== options2) { if (null == options2.as || "script" === options2.as) encountered = getCrossOriginStringAs( options2.as, options2.crossOrigin ), Internals.d.M(href, { crossOrigin: encountered, integrity: "string" === typeof options2.integrity ? options2.integrity : void 0, nonce: "string" === typeof options2.nonce ? options2.nonce : void 0 }); } else null == options2 && Internals.d.M(href); }; exports.preload = function(href, options2) { var encountered = ""; "string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + "."); null == options2 || "object" !== typeof options2 ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options2) + "." : "string" === typeof options2.as && options2.as || (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options2.as) + "."); encountered && console.error( 'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `` tag.%s', encountered ); if ("string" === typeof href && "object" === typeof options2 && null !== options2 && "string" === typeof options2.as) { encountered = options2.as; var crossOrigin = getCrossOriginStringAs( encountered, options2.crossOrigin ); Internals.d.L(href, encountered, { crossOrigin, integrity: "string" === typeof options2.integrity ? options2.integrity : void 0, nonce: "string" === typeof options2.nonce ? options2.nonce : void 0, type: "string" === typeof options2.type ? options2.type : void 0, fetchPriority: "string" === typeof options2.fetchPriority ? options2.fetchPriority : void 0, referrerPolicy: "string" === typeof options2.referrerPolicy ? options2.referrerPolicy : void 0, imageSrcSet: "string" === typeof options2.imageSrcSet ? options2.imageSrcSet : void 0, imageSizes: "string" === typeof options2.imageSizes ? options2.imageSizes : void 0, media: "string" === typeof options2.media ? options2.media : void 0 }); } }; exports.preloadModule = function(href, options2) { var encountered = ""; "string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + "."); void 0 !== options2 && "object" !== typeof options2 ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options2) + "." : options2 && "as" in options2 && "string" !== typeof options2.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options2.as) + "."); encountered && console.error( 'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `` tag.%s', encountered ); "string" === typeof href && (options2 ? (encountered = getCrossOriginStringAs( options2.as, options2.crossOrigin ), Internals.d.m(href, { as: "string" === typeof options2.as && "script" !== options2.as ? options2.as : void 0, crossOrigin: encountered, integrity: "string" === typeof options2.integrity ? options2.integrity : void 0 })) : Internals.d.m(href)); }; exports.requestFormReset = function(form) { Internals.d.r(form); }; exports.unstable_batchedUpdates = function(fn, a) { return fn(a); }; exports.useFormState = function(action, initialState, permalink) { return resolveDispatcher().useFormState(action, initialState, permalink); }; exports.useFormStatus = function() { return resolveDispatcher().useHostTransitionStatus(); }; exports.version = "19.2.0"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); })(); } }); // node_modules/react-dom/index.js var require_react_dom = __commonJS({ "node_modules/react-dom/index.js"(exports, module2) { "use strict"; if (false) { checkDCE(); module2.exports = null; } else { module2.exports = require_react_dom_development(); } } }); // node_modules/scheduler/cjs/scheduler.development.js var require_scheduler_development = __commonJS({ "node_modules/scheduler/cjs/scheduler.development.js"(exports) { "use strict"; (function() { function performWorkUntilDeadline() { needsPaint = false; if (isMessageLoopRunning) { var currentTime = exports.unstable_now(); startTime = currentTime; var hasMoreWork = true; try { a: { isHostCallbackScheduled = false; isHostTimeoutScheduled && (isHostTimeoutScheduled = false, localClearTimeout(taskTimeoutID), taskTimeoutID = -1); isPerformingWork = true; var previousPriorityLevel = currentPriorityLevel; try { b: { advanceTimers(currentTime); for (currentTask = peek2(taskQueue); null !== currentTask && !(currentTask.expirationTime > currentTime && shouldYieldToHost()); ) { var callback = currentTask.callback; if ("function" === typeof callback) { currentTask.callback = null; currentPriorityLevel = currentTask.priorityLevel; var continuationCallback = callback( currentTask.expirationTime <= currentTime ); currentTime = exports.unstable_now(); if ("function" === typeof continuationCallback) { currentTask.callback = continuationCallback; advanceTimers(currentTime); hasMoreWork = true; break b; } currentTask === peek2(taskQueue) && pop(taskQueue); advanceTimers(currentTime); } else pop(taskQueue); currentTask = peek2(taskQueue); } if (null !== currentTask) hasMoreWork = true; else { var firstTimer = peek2(timerQueue); null !== firstTimer && requestHostTimeout( handleTimeout, firstTimer.startTime - currentTime ); hasMoreWork = false; } } break a; } finally { currentTask = null, currentPriorityLevel = previousPriorityLevel, isPerformingWork = false; } hasMoreWork = void 0; } } finally { hasMoreWork ? schedulePerformWorkUntilDeadline() : isMessageLoopRunning = false; } } } function push(heap, node) { var index2 = heap.length; heap.push(node); a: for (; 0 < index2; ) { var parentIndex = index2 - 1 >>> 1, parent = heap[parentIndex]; if (0 < compare(parent, node)) heap[parentIndex] = node, heap[index2] = parent, index2 = parentIndex; else break a; } } function peek2(heap) { return 0 === heap.length ? null : heap[0]; } function pop(heap) { if (0 === heap.length) return null; var first = heap[0], last = heap.pop(); if (last !== first) { heap[0] = last; a: for (var index2 = 0, length = heap.length, halfLength = length >>> 1; index2 < halfLength; ) { var leftIndex = 2 * (index2 + 1) - 1, left = heap[leftIndex], rightIndex = leftIndex + 1, right = heap[rightIndex]; if (0 > compare(left, last)) rightIndex < length && 0 > compare(right, left) ? (heap[index2] = right, heap[rightIndex] = last, index2 = rightIndex) : (heap[index2] = left, heap[leftIndex] = last, index2 = leftIndex); else if (rightIndex < length && 0 > compare(right, last)) heap[index2] = right, heap[rightIndex] = last, index2 = rightIndex; else break a; } } return first; } function compare(a, b2) { var diff = a.sortIndex - b2.sortIndex; return 0 !== diff ? diff : a.id - b2.id; } function advanceTimers(currentTime) { for (var timer = peek2(timerQueue); null !== timer; ) { if (null === timer.callback) pop(timerQueue); else if (timer.startTime <= currentTime) pop(timerQueue), timer.sortIndex = timer.expirationTime, push(taskQueue, timer); else break; timer = peek2(timerQueue); } } function handleTimeout(currentTime) { isHostTimeoutScheduled = false; advanceTimers(currentTime); if (!isHostCallbackScheduled) if (null !== peek2(taskQueue)) isHostCallbackScheduled = true, isMessageLoopRunning || (isMessageLoopRunning = true, schedulePerformWorkUntilDeadline()); else { var firstTimer = peek2(timerQueue); null !== firstTimer && requestHostTimeout( handleTimeout, firstTimer.startTime - currentTime ); } } function shouldYieldToHost() { return needsPaint ? true : exports.unstable_now() - startTime < frameInterval ? false : true; } function requestHostTimeout(callback, ms) { taskTimeoutID = localSetTimeout(function() { callback(exports.unstable_now()); }, ms); } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); exports.unstable_now = void 0; if ("object" === typeof performance && "function" === typeof performance.now) { var localPerformance = performance; exports.unstable_now = function() { return localPerformance.now(); }; } else { var localDate = Date, initialTime = localDate.now(); exports.unstable_now = function() { return localDate.now() - initialTime; }; } var taskQueue = [], timerQueue = [], taskIdCounter = 1, currentTask = null, currentPriorityLevel = 3, isPerformingWork = false, isHostCallbackScheduled = false, isHostTimeoutScheduled = false, needsPaint = false, localSetTimeout = "function" === typeof setTimeout ? setTimeout : null, localClearTimeout = "function" === typeof clearTimeout ? clearTimeout : null, localSetImmediate = "undefined" !== typeof setImmediate ? setImmediate : null, isMessageLoopRunning = false, taskTimeoutID = -1, frameInterval = 5, startTime = -1; if ("function" === typeof localSetImmediate) var schedulePerformWorkUntilDeadline = function() { localSetImmediate(performWorkUntilDeadline); }; else if ("undefined" !== typeof MessageChannel) { var channel = new MessageChannel(), port = channel.port2; channel.port1.onmessage = performWorkUntilDeadline; schedulePerformWorkUntilDeadline = function() { port.postMessage(null); }; } else schedulePerformWorkUntilDeadline = function() { localSetTimeout(performWorkUntilDeadline, 0); }; exports.unstable_IdlePriority = 5; exports.unstable_ImmediatePriority = 1; exports.unstable_LowPriority = 4; exports.unstable_NormalPriority = 3; exports.unstable_Profiling = null; exports.unstable_UserBlockingPriority = 2; exports.unstable_cancelCallback = function(task) { task.callback = null; }; exports.unstable_forceFrameRate = function(fps) { 0 > fps || 125 < fps ? console.error( "forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported" ) : frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5; }; exports.unstable_getCurrentPriorityLevel = function() { return currentPriorityLevel; }; exports.unstable_next = function(eventHandler) { switch (currentPriorityLevel) { case 1: case 2: case 3: var priorityLevel = 3; break; default: priorityLevel = currentPriorityLevel; } var previousPriorityLevel = currentPriorityLevel; currentPriorityLevel = priorityLevel; try { return eventHandler(); } finally { currentPriorityLevel = previousPriorityLevel; } }; exports.unstable_requestPaint = function() { needsPaint = true; }; exports.unstable_runWithPriority = function(priorityLevel, eventHandler) { switch (priorityLevel) { case 1: case 2: case 3: case 4: case 5: break; default: priorityLevel = 3; } var previousPriorityLevel = currentPriorityLevel; currentPriorityLevel = priorityLevel; try { return eventHandler(); } finally { currentPriorityLevel = previousPriorityLevel; } }; exports.unstable_scheduleCallback = function(priorityLevel, callback, options2) { var currentTime = exports.unstable_now(); "object" === typeof options2 && null !== options2 ? (options2 = options2.delay, options2 = "number" === typeof options2 && 0 < options2 ? currentTime + options2 : currentTime) : options2 = currentTime; switch (priorityLevel) { case 1: var timeout = -1; break; case 2: timeout = 250; break; case 5: timeout = 1073741823; break; case 4: timeout = 1e4; break; default: timeout = 5e3; } timeout = options2 + timeout; priorityLevel = { id: taskIdCounter++, callback, priorityLevel, startTime: options2, expirationTime: timeout, sortIndex: -1 }; options2 > currentTime ? (priorityLevel.sortIndex = options2, push(timerQueue, priorityLevel), null === peek2(taskQueue) && priorityLevel === peek2(timerQueue) && (isHostTimeoutScheduled ? (localClearTimeout(taskTimeoutID), taskTimeoutID = -1) : isHostTimeoutScheduled = true, requestHostTimeout(handleTimeout, options2 - currentTime))) : (priorityLevel.sortIndex = timeout, push(taskQueue, priorityLevel), isHostCallbackScheduled || isPerformingWork || (isHostCallbackScheduled = true, isMessageLoopRunning || (isMessageLoopRunning = true, schedulePerformWorkUntilDeadline()))); return priorityLevel; }; exports.unstable_shouldYield = shouldYieldToHost; exports.unstable_wrapCallback = function(callback) { var parentPriorityLevel = currentPriorityLevel; return function() { var previousPriorityLevel = currentPriorityLevel; currentPriorityLevel = parentPriorityLevel; try { return callback.apply(this, arguments); } finally { currentPriorityLevel = previousPriorityLevel; } }; }; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); })(); } }); // node_modules/scheduler/index.js var require_scheduler = __commonJS({ "node_modules/scheduler/index.js"(exports, module2) { "use strict"; if (false) { module2.exports = null; } else { module2.exports = require_scheduler_development(); } } }); // node_modules/react-dom/cjs/react-dom-client.development.js var require_react_dom_client_development = __commonJS({ "node_modules/react-dom/cjs/react-dom-client.development.js"(exports) { "use strict"; (function() { function findHook(fiber, id) { for (fiber = fiber.memoizedState; null !== fiber && 0 < id; ) fiber = fiber.next, id--; return fiber; } function copyWithSetImpl(obj, path, index2, value) { if (index2 >= path.length) return value; var key = path[index2], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj); updated[key] = copyWithSetImpl(obj[key], path, index2 + 1, value); return updated; } function copyWithRename(obj, oldPath, newPath) { if (oldPath.length !== newPath.length) console.warn("copyWithRename() expects paths of the same length"); else { for (var i = 0; i < newPath.length - 1; i++) if (oldPath[i] !== newPath[i]) { console.warn( "copyWithRename() expects paths to be the same except for the deepest key" ); return; } return copyWithRenameImpl(obj, oldPath, newPath, 0); } } function copyWithRenameImpl(obj, oldPath, newPath, index2) { var oldKey = oldPath[index2], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj); index2 + 1 === oldPath.length ? (updated[newPath[index2]] = updated[oldKey], isArrayImpl(updated) ? updated.splice(oldKey, 1) : delete updated[oldKey]) : updated[oldKey] = copyWithRenameImpl( obj[oldKey], oldPath, newPath, index2 + 1 ); return updated; } function copyWithDeleteImpl(obj, path, index2) { var key = path[index2], updated = isArrayImpl(obj) ? obj.slice() : assign({}, obj); if (index2 + 1 === path.length) return isArrayImpl(updated) ? updated.splice(key, 1) : delete updated[key], updated; updated[key] = copyWithDeleteImpl(obj[key], path, index2 + 1); return updated; } function shouldSuspendImpl() { return false; } function shouldErrorImpl() { return null; } function warnInvalidHookAccess() { console.error( "Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks" ); } function warnInvalidContextAccess() { console.error( "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ); } function noop4() { } function warnForMissingKey() { } function setToSortedString(set2) { var array = []; set2.forEach(function(value) { array.push(value); }); return array.sort().join(", "); } function createFiber(tag2, pendingProps, key, mode2) { return new FiberNode(tag2, pendingProps, key, mode2); } function scheduleRoot(root2, element) { root2.context === emptyContextObject && (updateContainerImpl(root2.current, 2, element, root2, null, null), flushSyncWork$1()); } function scheduleRefresh(root2, update) { if (null !== resolveFamily) { var staleFamilies = update.staleFamilies; update = update.updatedFamilies; flushPendingEffects(); scheduleFibersWithFamiliesRecursively( root2.current, update, staleFamilies ); flushSyncWork$1(); } } function setRefreshHandler(handler) { resolveFamily = handler; } function isValidContainer(node) { return !(!node || 1 !== node.nodeType && 9 !== node.nodeType && 11 !== node.nodeType); } function getNearestMountedFiber(fiber) { var node = fiber, nearestMounted = fiber; if (fiber.alternate) for (; node.return; ) node = node.return; else { fiber = node; do node = fiber, 0 !== (node.flags & 4098) && (nearestMounted = node.return), fiber = node.return; while (fiber); } return 3 === node.tag ? nearestMounted : null; } function getSuspenseInstanceFromFiber(fiber) { if (13 === fiber.tag) { var suspenseState = fiber.memoizedState; null === suspenseState && (fiber = fiber.alternate, null !== fiber && (suspenseState = fiber.memoizedState)); if (null !== suspenseState) return suspenseState.dehydrated; } return null; } function getActivityInstanceFromFiber(fiber) { if (31 === fiber.tag) { var activityState = fiber.memoizedState; null === activityState && (fiber = fiber.alternate, null !== fiber && (activityState = fiber.memoizedState)); if (null !== activityState) return activityState.dehydrated; } return null; } function assertIsMounted(fiber) { if (getNearestMountedFiber(fiber) !== fiber) throw Error("Unable to find node on an unmounted component."); } function findCurrentFiberUsingSlowPath(fiber) { var alternate = fiber.alternate; if (!alternate) { alternate = getNearestMountedFiber(fiber); if (null === alternate) throw Error("Unable to find node on an unmounted component."); return alternate !== fiber ? null : fiber; } for (var a = fiber, b2 = alternate; ; ) { var parentA = a.return; if (null === parentA) break; var parentB = parentA.alternate; if (null === parentB) { b2 = parentA.return; if (null !== b2) { a = b2; continue; } break; } if (parentA.child === parentB.child) { for (parentB = parentA.child; parentB; ) { if (parentB === a) return assertIsMounted(parentA), fiber; if (parentB === b2) return assertIsMounted(parentA), alternate; parentB = parentB.sibling; } throw Error("Unable to find node on an unmounted component."); } if (a.return !== b2.return) a = parentA, b2 = parentB; else { for (var didFindChild = false, _child = parentA.child; _child; ) { if (_child === a) { didFindChild = true; a = parentA; b2 = parentB; break; } if (_child === b2) { didFindChild = true; b2 = parentA; a = parentB; break; } _child = _child.sibling; } if (!didFindChild) { for (_child = parentB.child; _child; ) { if (_child === a) { didFindChild = true; a = parentB; b2 = parentA; break; } if (_child === b2) { didFindChild = true; b2 = parentB; a = parentA; break; } _child = _child.sibling; } if (!didFindChild) throw Error( "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue." ); } } if (a.alternate !== b2) throw Error( "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue." ); } if (3 !== a.tag) throw Error("Unable to find node on an unmounted component."); return a.stateNode.current === a ? fiber : alternate; } function findCurrentHostFiberImpl(node) { var tag2 = node.tag; if (5 === tag2 || 26 === tag2 || 27 === tag2 || 6 === tag2) return node; for (node = node.child; null !== node; ) { tag2 = findCurrentHostFiberImpl(node); if (null !== tag2) return tag2; node = node.sibling; } return null; } function getIteratorFn(maybeIterable) { if (null === maybeIterable || "object" !== typeof maybeIterable) return null; maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"]; return "function" === typeof maybeIterable ? maybeIterable : null; } function getComponentNameFromType(type) { if (null == type) return null; if ("function" === typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null; if ("string" === typeof type) return type; switch (type) { case REACT_FRAGMENT_TYPE: return "Fragment"; case REACT_PROFILER_TYPE: return "Profiler"; case REACT_STRICT_MODE_TYPE: return "StrictMode"; case REACT_SUSPENSE_TYPE: return "Suspense"; case REACT_SUSPENSE_LIST_TYPE: return "SuspenseList"; case REACT_ACTIVITY_TYPE: return "Activity"; } if ("object" === typeof type) switch ("number" === typeof type.tag && console.error( "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." ), type.$$typeof) { case REACT_PORTAL_TYPE: return "Portal"; case REACT_CONTEXT_TYPE: return type.displayName || "Context"; case REACT_CONSUMER_TYPE: return (type._context.displayName || "Context") + ".Consumer"; case REACT_FORWARD_REF_TYPE: var innerType = type.render; type = type.displayName; type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"); return type; case REACT_MEMO_TYPE: return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo"; case REACT_LAZY_TYPE: innerType = type._payload; type = type._init; try { return getComponentNameFromType(type(innerType)); } catch (x2) { } } return null; } function getComponentNameFromOwner(owner) { return "number" === typeof owner.tag ? getComponentNameFromFiber(owner) : "string" === typeof owner.name ? owner.name : null; } function getComponentNameFromFiber(fiber) { var type = fiber.type; switch (fiber.tag) { case 31: return "Activity"; case 24: return "Cache"; case 9: return (type._context.displayName || "Context") + ".Consumer"; case 10: return type.displayName || "Context"; case 18: return "DehydratedFragment"; case 11: return fiber = type.render, fiber = fiber.displayName || fiber.name || "", type.displayName || ("" !== fiber ? "ForwardRef(" + fiber + ")" : "ForwardRef"); case 7: return "Fragment"; case 26: case 27: case 5: return type; case 4: return "Portal"; case 3: return "Root"; case 6: return "Text"; case 16: return getComponentNameFromType(type); case 8: return type === REACT_STRICT_MODE_TYPE ? "StrictMode" : "Mode"; case 22: return "Offscreen"; case 12: return "Profiler"; case 21: return "Scope"; case 13: return "Suspense"; case 19: return "SuspenseList"; case 25: return "TracingMarker"; case 1: case 0: case 14: case 15: if ("function" === typeof type) return type.displayName || type.name || null; if ("string" === typeof type) return type; break; case 29: type = fiber._debugInfo; if (null != type) { for (var i = type.length - 1; 0 <= i; i--) if ("string" === typeof type[i].name) return type[i].name; } if (null !== fiber.return) return getComponentNameFromFiber(fiber.return); } return null; } function createCursor(defaultValue2) { return { current: defaultValue2 }; } function pop(cursor, fiber) { 0 > index$jscomp$0 ? console.error("Unexpected pop.") : (fiber !== fiberStack[index$jscomp$0] && console.error("Unexpected Fiber popped."), cursor.current = valueStack[index$jscomp$0], valueStack[index$jscomp$0] = null, fiberStack[index$jscomp$0] = null, index$jscomp$0--); } function push(cursor, value, fiber) { index$jscomp$0++; valueStack[index$jscomp$0] = cursor.current; fiberStack[index$jscomp$0] = fiber; cursor.current = value; } function requiredContext(c2) { null === c2 && console.error( "Expected host context to exist. This error is likely caused by a bug in React. Please file an issue." ); return c2; } function pushHostContainer(fiber, nextRootInstance) { push(rootInstanceStackCursor, nextRootInstance, fiber); push(contextFiberStackCursor, fiber, fiber); push(contextStackCursor, null, fiber); var nextRootContext = nextRootInstance.nodeType; switch (nextRootContext) { case 9: case 11: nextRootContext = 9 === nextRootContext ? "#document" : "#fragment"; nextRootInstance = (nextRootInstance = nextRootInstance.documentElement) ? (nextRootInstance = nextRootInstance.namespaceURI) ? getOwnHostContext(nextRootInstance) : HostContextNamespaceNone : HostContextNamespaceNone; break; default: if (nextRootContext = nextRootInstance.tagName, nextRootInstance = nextRootInstance.namespaceURI) nextRootInstance = getOwnHostContext(nextRootInstance), nextRootInstance = getChildHostContextProd( nextRootInstance, nextRootContext ); else switch (nextRootContext) { case "svg": nextRootInstance = HostContextNamespaceSvg; break; case "math": nextRootInstance = HostContextNamespaceMath; break; default: nextRootInstance = HostContextNamespaceNone; } } nextRootContext = nextRootContext.toLowerCase(); nextRootContext = updatedAncestorInfoDev(null, nextRootContext); nextRootContext = { context: nextRootInstance, ancestorInfo: nextRootContext }; pop(contextStackCursor, fiber); push(contextStackCursor, nextRootContext, fiber); } function popHostContainer(fiber) { pop(contextStackCursor, fiber); pop(contextFiberStackCursor, fiber); pop(rootInstanceStackCursor, fiber); } function getHostContext() { return requiredContext(contextStackCursor.current); } function pushHostContext(fiber) { null !== fiber.memoizedState && push(hostTransitionProviderCursor, fiber, fiber); var context = requiredContext(contextStackCursor.current); var type = fiber.type; var nextContext = getChildHostContextProd(context.context, type); type = updatedAncestorInfoDev(context.ancestorInfo, type); nextContext = { context: nextContext, ancestorInfo: type }; context !== nextContext && (push(contextFiberStackCursor, fiber, fiber), push(contextStackCursor, nextContext, fiber)); } function popHostContext(fiber) { contextFiberStackCursor.current === fiber && (pop(contextStackCursor, fiber), pop(contextFiberStackCursor, fiber)); hostTransitionProviderCursor.current === fiber && (pop(hostTransitionProviderCursor, fiber), HostTransitionContext._currentValue = NotPendingTransition); } function disabledLog() { } function disableLogs() { if (0 === disabledDepth) { prevLog = console.log; prevInfo = console.info; prevWarn = console.warn; prevError = console.error; prevGroup = console.group; prevGroupCollapsed = console.groupCollapsed; prevGroupEnd = console.groupEnd; var props = { configurable: true, enumerable: true, value: disabledLog, writable: true }; Object.defineProperties(console, { info: props, log: props, warn: props, error: props, group: props, groupCollapsed: props, groupEnd: props }); } disabledDepth++; } function reenableLogs() { disabledDepth--; if (0 === disabledDepth) { var props = { configurable: true, enumerable: true, writable: true }; Object.defineProperties(console, { log: assign({}, props, { value: prevLog }), info: assign({}, props, { value: prevInfo }), warn: assign({}, props, { value: prevWarn }), error: assign({}, props, { value: prevError }), group: assign({}, props, { value: prevGroup }), groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), groupEnd: assign({}, props, { value: prevGroupEnd }) }); } 0 > disabledDepth && console.error( "disabledDepth fell below zero. This is a bug in React. Please file an issue." ); } function formatOwnerStack(error) { var prevPrepareStackTrace = Error.prepareStackTrace; Error.prepareStackTrace = void 0; error = error.stack; Error.prepareStackTrace = prevPrepareStackTrace; error.startsWith("Error: react-stack-top-frame\n") && (error = error.slice(29)); prevPrepareStackTrace = error.indexOf("\n"); -1 !== prevPrepareStackTrace && (error = error.slice(prevPrepareStackTrace + 1)); prevPrepareStackTrace = error.indexOf("react_stack_bottom_frame"); -1 !== prevPrepareStackTrace && (prevPrepareStackTrace = error.lastIndexOf( "\n", prevPrepareStackTrace )); if (-1 !== prevPrepareStackTrace) error = error.slice(0, prevPrepareStackTrace); else return ""; return error; } function describeBuiltInComponentFrame(name) { if (void 0 === prefix) try { throw Error(); } catch (x2) { var match = x2.stack.trim().match(/\n( *(at )?)/); prefix = match && match[1] || ""; suffix = -1 < x2.stack.indexOf("\n at") ? " ()" : -1 < x2.stack.indexOf("@") ? "@unknown:0:0" : ""; } return "\n" + prefix + name + suffix; } function describeNativeComponentFrame(fn, construct) { if (!fn || reentry) return ""; var frame = componentFrameCache.get(fn); if (void 0 !== frame) return frame; reentry = true; frame = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var previousDispatcher2 = null; previousDispatcher2 = ReactSharedInternals.H; ReactSharedInternals.H = null; disableLogs(); try { var RunInRootFrame = { DetermineComponentFrameRoot: function() { try { if (construct) { var Fake = function() { throw Error(); }; Object.defineProperty(Fake.prototype, "props", { set: function() { throw Error(); } }); if ("object" === typeof Reflect && Reflect.construct) { try { Reflect.construct(Fake, []); } catch (x2) { var control = x2; } Reflect.construct(fn, [], Fake); } else { try { Fake.call(); } catch (x$0) { control = x$0; } fn.call(Fake.prototype); } } else { try { throw Error(); } catch (x$1) { control = x$1; } (Fake = fn()) && "function" === typeof Fake.catch && Fake.catch(function() { }); } } catch (sample) { if (sample && control && "string" === typeof sample.stack) return [sample.stack, control.stack]; } return [null, null]; } }; RunInRootFrame.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot"; var namePropDescriptor = Object.getOwnPropertyDescriptor( RunInRootFrame.DetermineComponentFrameRoot, "name" ); namePropDescriptor && namePropDescriptor.configurable && Object.defineProperty( RunInRootFrame.DetermineComponentFrameRoot, "name", { value: "DetermineComponentFrameRoot" } ); var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], controlStack = _RunInRootFrame$Deter[1]; if (sampleStack && controlStack) { var sampleLines = sampleStack.split("\n"), controlLines = controlStack.split("\n"); for (_RunInRootFrame$Deter = namePropDescriptor = 0; namePropDescriptor < sampleLines.length && !sampleLines[namePropDescriptor].includes( "DetermineComponentFrameRoot" ); ) namePropDescriptor++; for (; _RunInRootFrame$Deter < controlLines.length && !controlLines[_RunInRootFrame$Deter].includes( "DetermineComponentFrameRoot" ); ) _RunInRootFrame$Deter++; if (namePropDescriptor === sampleLines.length || _RunInRootFrame$Deter === controlLines.length) for (namePropDescriptor = sampleLines.length - 1, _RunInRootFrame$Deter = controlLines.length - 1; 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter && sampleLines[namePropDescriptor] !== controlLines[_RunInRootFrame$Deter]; ) _RunInRootFrame$Deter--; for (; 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; namePropDescriptor--, _RunInRootFrame$Deter--) if (sampleLines[namePropDescriptor] !== controlLines[_RunInRootFrame$Deter]) { if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) { do if (namePropDescriptor--, _RunInRootFrame$Deter--, 0 > _RunInRootFrame$Deter || sampleLines[namePropDescriptor] !== controlLines[_RunInRootFrame$Deter]) { var _frame = "\n" + sampleLines[namePropDescriptor].replace( " at new ", " at " ); fn.displayName && _frame.includes("") && (_frame = _frame.replace("", fn.displayName)); "function" === typeof fn && componentFrameCache.set(fn, _frame); return _frame; } while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter); } break; } } } finally { reentry = false, ReactSharedInternals.H = previousDispatcher2, reenableLogs(), Error.prepareStackTrace = frame; } sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "") ? describeBuiltInComponentFrame(sampleLines) : ""; "function" === typeof fn && componentFrameCache.set(fn, sampleLines); return sampleLines; } function describeFiber(fiber, childFiber) { switch (fiber.tag) { case 26: case 27: case 5: return describeBuiltInComponentFrame(fiber.type); case 16: return describeBuiltInComponentFrame("Lazy"); case 13: return fiber.child !== childFiber && null !== childFiber ? describeBuiltInComponentFrame("Suspense Fallback") : describeBuiltInComponentFrame("Suspense"); case 19: return describeBuiltInComponentFrame("SuspenseList"); case 0: case 15: return describeNativeComponentFrame(fiber.type, false); case 11: return describeNativeComponentFrame(fiber.type.render, false); case 1: return describeNativeComponentFrame(fiber.type, true); case 31: return describeBuiltInComponentFrame("Activity"); default: return ""; } } function getStackByFiberInDevAndProd(workInProgress2) { try { var info = "", previous = null; do { info += describeFiber(workInProgress2, previous); var debugInfo = workInProgress2._debugInfo; if (debugInfo) for (var i = debugInfo.length - 1; 0 <= i; i--) { var entry = debugInfo[i]; if ("string" === typeof entry.name) { var JSCompiler_temp_const = info; a: { var name = entry.name, env = entry.env, location = entry.debugLocation; if (null != location) { var childStack = formatOwnerStack(location), idx = childStack.lastIndexOf("\n"), lastLine = -1 === idx ? childStack : childStack.slice(idx + 1); if (-1 !== lastLine.indexOf(name)) { var JSCompiler_inline_result = "\n" + lastLine; break a; } } JSCompiler_inline_result = describeBuiltInComponentFrame( name + (env ? " [" + env + "]" : "") ); } info = JSCompiler_temp_const + JSCompiler_inline_result; } } previous = workInProgress2; workInProgress2 = workInProgress2.return; } while (workInProgress2); return info; } catch (x2) { return "\nError generating stack: " + x2.message + "\n" + x2.stack; } } function describeFunctionComponentFrameWithoutLineNumber(fn) { return (fn = fn ? fn.displayName || fn.name : "") ? describeBuiltInComponentFrame(fn) : ""; } function getCurrentFiberOwnerNameInDevOrNull() { if (null === current2) return null; var owner = current2._debugOwner; return null != owner ? getComponentNameFromOwner(owner) : null; } function getCurrentFiberStackInDev() { if (null === current2) return ""; var workInProgress2 = current2; try { var info = ""; 6 === workInProgress2.tag && (workInProgress2 = workInProgress2.return); switch (workInProgress2.tag) { case 26: case 27: case 5: info += describeBuiltInComponentFrame(workInProgress2.type); break; case 13: info += describeBuiltInComponentFrame("Suspense"); break; case 19: info += describeBuiltInComponentFrame("SuspenseList"); break; case 31: info += describeBuiltInComponentFrame("Activity"); break; case 30: case 0: case 15: case 1: workInProgress2._debugOwner || "" !== info || (info += describeFunctionComponentFrameWithoutLineNumber( workInProgress2.type )); break; case 11: workInProgress2._debugOwner || "" !== info || (info += describeFunctionComponentFrameWithoutLineNumber( workInProgress2.type.render )); } for (; workInProgress2; ) if ("number" === typeof workInProgress2.tag) { var fiber = workInProgress2; workInProgress2 = fiber._debugOwner; var debugStack = fiber._debugStack; if (workInProgress2 && debugStack) { var formattedStack = formatOwnerStack(debugStack); "" !== formattedStack && (info += "\n" + formattedStack); } } else if (null != workInProgress2.debugStack) { var ownerStack = workInProgress2.debugStack; (workInProgress2 = workInProgress2.owner) && ownerStack && (info += "\n" + formatOwnerStack(ownerStack)); } else break; var JSCompiler_inline_result = info; } catch (x2) { JSCompiler_inline_result = "\nError generating stack: " + x2.message + "\n" + x2.stack; } return JSCompiler_inline_result; } function runWithFiberInDEV(fiber, callback, arg0, arg1, arg2, arg3, arg4) { var previousFiber = current2; setCurrentFiber(fiber); try { return null !== fiber && fiber._debugTask ? fiber._debugTask.run( callback.bind(null, arg0, arg1, arg2, arg3, arg4) ) : callback(arg0, arg1, arg2, arg3, arg4); } finally { setCurrentFiber(previousFiber); } throw Error( "runWithFiberInDEV should never be called in production. This is a bug in React." ); } function setCurrentFiber(fiber) { ReactSharedInternals.getCurrentStack = null === fiber ? null : getCurrentFiberStackInDev; isRendering = false; current2 = fiber; } function typeName(value) { return "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object"; } function willCoercionThrow(value) { try { return testStringCoercion(value), false; } catch (e2) { return true; } } function testStringCoercion(value) { return "" + value; } function checkAttributeStringCoercion(value, attributeName) { if (willCoercionThrow(value)) return console.error( "The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before using it here.", attributeName, typeName(value) ), testStringCoercion(value); } function checkCSSPropertyStringCoercion(value, propName) { if (willCoercionThrow(value)) return console.error( "The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before using it here.", propName, typeName(value) ), testStringCoercion(value); } function checkFormFieldValueStringCoercion(value) { if (willCoercionThrow(value)) return console.error( "Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before using it here.", typeName(value) ), testStringCoercion(value); } function injectInternals(internals) { if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) return false; var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; if (hook.isDisabled) return true; if (!hook.supportsFiber) return console.error( "The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools" ), true; try { rendererID = hook.inject(internals), injectedHook = hook; } catch (err) { console.error("React instrumentation encountered an error: %o.", err); } return hook.checkDCE ? true : false; } function setIsStrictModeForDevtools(newIsStrictMode) { "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode); if (injectedHook && "function" === typeof injectedHook.setStrictMode) try { injectedHook.setStrictMode(rendererID, newIsStrictMode); } catch (err) { hasLoggedError || (hasLoggedError = true, console.error( "React instrumentation encountered an error: %o", err )); } } function clz32Fallback(x2) { x2 >>>= 0; return 0 === x2 ? 32 : 31 - (log(x2) / LN2 | 0) | 0; } function getHighestPriorityLanes(lanes) { var pendingSyncLanes = lanes & 42; if (0 !== pendingSyncLanes) return pendingSyncLanes; switch (lanes & -lanes) { case 1: return 1; case 2: return 2; case 4: return 4; case 8: return 8; case 16: return 16; case 32: return 32; case 64: return 64; case 128: return 128; case 256: case 512: case 1024: case 2048: case 4096: case 8192: case 16384: case 32768: case 65536: case 131072: return lanes & 261888; case 262144: case 524288: case 1048576: case 2097152: return lanes & 3932160; case 4194304: case 8388608: case 16777216: case 33554432: return lanes & 62914560; case 67108864: return 67108864; case 134217728: return 134217728; case 268435456: return 268435456; case 536870912: return 536870912; case 1073741824: return 0; default: return console.error( "Should have found matching lanes. This is a bug in React." ), lanes; } } function getNextLanes(root2, wipLanes, rootHasPendingCommit) { var pendingLanes = root2.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root2.suspendedLanes, pingedLanes = root2.pingedLanes; root2 = root2.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? (pendingLanes = nonIdlePendingLanes & ~suspendedLanes, 0 !== pendingLanes ? nextLanes = getHighestPriorityLanes(pendingLanes) : (pingedLanes &= nonIdlePendingLanes, 0 !== pingedLanes ? nextLanes = getHighestPriorityLanes(pingedLanes) : rootHasPendingCommit || (rootHasPendingCommit = nonIdlePendingLanes & ~root2, 0 !== rootHasPendingCommit && (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : (nonIdlePendingLanes = pendingLanes & ~suspendedLanes, 0 !== nonIdlePendingLanes ? nextLanes = getHighestPriorityLanes(nonIdlePendingLanes) : 0 !== pingedLanes ? nextLanes = getHighestPriorityLanes(pingedLanes) : rootHasPendingCommit || (rootHasPendingCommit = pendingLanes & ~root2, 0 !== rootHasPendingCommit && (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && (suspendedLanes = nextLanes & -nextLanes, rootHasPendingCommit = wipLanes & -wipLanes, suspendedLanes >= rootHasPendingCommit || 32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048)) ? wipLanes : nextLanes; } function checkIfRootIsPrerendering(root2, renderLanes2) { return 0 === (root2.pendingLanes & ~(root2.suspendedLanes & ~root2.pingedLanes) & renderLanes2); } function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: case 2: case 4: case 8: case 64: return currentTime + 250; case 16: case 32: case 128: case 256: case 512: case 1024: case 2048: case 4096: case 8192: case 16384: case 32768: case 65536: case 131072: case 262144: case 524288: case 1048576: case 2097152: return currentTime + 5e3; case 4194304: case 8388608: case 16777216: case 33554432: return -1; case 67108864: case 134217728: case 268435456: case 536870912: case 1073741824: return -1; default: return console.error( "Should have found matching lanes. This is a bug in React." ), -1; } } function claimNextRetryLane() { var lane = nextRetryLane; nextRetryLane <<= 1; 0 === (nextRetryLane & 62914560) && (nextRetryLane = 4194304); return lane; } function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } function markRootUpdated$1(root2, updateLane) { root2.pendingLanes |= updateLane; 268435456 !== updateLane && (root2.suspendedLanes = 0, root2.pingedLanes = 0, root2.warmLanes = 0); } function markRootFinished(root2, finishedLanes, remainingLanes, spawnedLane, updatedLanes, suspendedRetryLanes) { var previouslyPendingLanes = root2.pendingLanes; root2.pendingLanes = remainingLanes; root2.suspendedLanes = 0; root2.pingedLanes = 0; root2.warmLanes = 0; root2.expiredLanes &= remainingLanes; root2.entangledLanes &= remainingLanes; root2.errorRecoveryDisabledLanes &= remainingLanes; root2.shellSuspendCounter = 0; var entanglements = root2.entanglements, expirationTimes = root2.expirationTimes, hiddenUpdates = root2.hiddenUpdates; for (remainingLanes = previouslyPendingLanes & ~remainingLanes; 0 < remainingLanes; ) { var index2 = 31 - clz32(remainingLanes), lane = 1 << index2; entanglements[index2] = 0; expirationTimes[index2] = -1; var hiddenUpdatesForLane = hiddenUpdates[index2]; if (null !== hiddenUpdatesForLane) for (hiddenUpdates[index2] = null, index2 = 0; index2 < hiddenUpdatesForLane.length; index2++) { var update = hiddenUpdatesForLane[index2]; null !== update && (update.lane &= -536870913); } remainingLanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root2, spawnedLane, 0); 0 !== suspendedRetryLanes && 0 === updatedLanes && 0 !== root2.tag && (root2.suspendedLanes |= suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); } function markSpawnedDeferredLane(root2, spawnedLane, entangledLanes) { root2.pendingLanes |= spawnedLane; root2.suspendedLanes &= ~spawnedLane; var spawnedLaneIndex = 31 - clz32(spawnedLane); root2.entangledLanes |= spawnedLane; root2.entanglements[spawnedLaneIndex] = root2.entanglements[spawnedLaneIndex] | 1073741824 | entangledLanes & 261930; } function markRootEntangled(root2, entangledLanes) { var rootEntangledLanes = root2.entangledLanes |= entangledLanes; for (root2 = root2.entanglements; rootEntangledLanes; ) { var index2 = 31 - clz32(rootEntangledLanes), lane = 1 << index2; lane & entangledLanes | root2[index2] & entangledLanes && (root2[index2] |= entangledLanes); rootEntangledLanes &= ~lane; } } function getBumpedLaneForHydration(root2, renderLanes2) { var renderLane = renderLanes2 & -renderLanes2; renderLane = 0 !== (renderLane & 42) ? 1 : getBumpedLaneForHydrationByLane(renderLane); return 0 !== (renderLane & (root2.suspendedLanes | renderLanes2)) ? 0 : renderLane; } function getBumpedLaneForHydrationByLane(lane) { switch (lane) { case 2: lane = 1; break; case 8: lane = 4; break; case 32: lane = 16; break; case 256: case 512: case 1024: case 2048: case 4096: case 8192: case 16384: case 32768: case 65536: case 131072: case 262144: case 524288: case 1048576: case 2097152: case 4194304: case 8388608: case 16777216: case 33554432: lane = 128; break; case 268435456: lane = 134217728; break; default: lane = 0; } return lane; } function addFiberToLanesMap(root2, fiber, lanes) { if (isDevToolsPresent) for (root2 = root2.pendingUpdatersLaneMap; 0 < lanes; ) { var index2 = 31 - clz32(lanes), lane = 1 << index2; root2[index2].add(fiber); lanes &= ~lane; } } function movePendingFibersToMemoized(root2, lanes) { if (isDevToolsPresent) for (var pendingUpdatersLaneMap = root2.pendingUpdatersLaneMap, memoizedUpdaters = root2.memoizedUpdaters; 0 < lanes; ) { var index2 = 31 - clz32(lanes); root2 = 1 << index2; index2 = pendingUpdatersLaneMap[index2]; 0 < index2.size && (index2.forEach(function(fiber) { var alternate = fiber.alternate; null !== alternate && memoizedUpdaters.has(alternate) || memoizedUpdaters.add(fiber); }), index2.clear()); lanes &= ~root2; } } function lanesToEventPriority(lanes) { lanes &= -lanes; return 0 !== DiscreteEventPriority && DiscreteEventPriority < lanes ? 0 !== ContinuousEventPriority && ContinuousEventPriority < lanes ? 0 !== (lanes & 134217727) ? DefaultEventPriority : IdleEventPriority : ContinuousEventPriority : DiscreteEventPriority; } function resolveUpdatePriority() { var updatePriority = ReactDOMSharedInternals.p; if (0 !== updatePriority) return updatePriority; updatePriority = window.event; return void 0 === updatePriority ? DefaultEventPriority : getEventPriority(updatePriority.type); } function runWithPriority(priority, fn) { var previousPriority = ReactDOMSharedInternals.p; try { return ReactDOMSharedInternals.p = priority, fn(); } finally { ReactDOMSharedInternals.p = previousPriority; } } function detachDeletedInstance(node) { delete node[internalInstanceKey]; delete node[internalPropsKey]; delete node[internalEventHandlersKey]; delete node[internalEventHandlerListenersKey]; delete node[internalEventHandlesSetKey]; } function getClosestInstanceFromNode(targetNode) { var targetInst = targetNode[internalInstanceKey]; if (targetInst) return targetInst; for (var parentNode = targetNode.parentNode; parentNode; ) { if (targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey]) { parentNode = targetInst.alternate; if (null !== targetInst.child || null !== parentNode && null !== parentNode.child) for (targetNode = getParentHydrationBoundary(targetNode); null !== targetNode; ) { if (parentNode = targetNode[internalInstanceKey]) return parentNode; targetNode = getParentHydrationBoundary(targetNode); } return targetInst; } targetNode = parentNode; parentNode = targetNode.parentNode; } return null; } function getInstanceFromNode(node) { if (node = node[internalInstanceKey] || node[internalContainerInstanceKey]) { var tag2 = node.tag; if (5 === tag2 || 6 === tag2 || 13 === tag2 || 31 === tag2 || 26 === tag2 || 27 === tag2 || 3 === tag2) return node; } return null; } function getNodeFromInstance(inst) { var tag2 = inst.tag; if (5 === tag2 || 26 === tag2 || 27 === tag2 || 6 === tag2) return inst.stateNode; throw Error("getNodeFromInstance: Invalid argument."); } function getResourcesFromRoot(root2) { var resources = root2[internalRootNodeResourcesKey]; resources || (resources = root2[internalRootNodeResourcesKey] = { hoistableStyles: /* @__PURE__ */ new Map(), hoistableScripts: /* @__PURE__ */ new Map() }); return resources; } function markNodeAsHoistable(node) { node[internalHoistableMarker] = true; } function registerTwoPhaseEvent(registrationName, dependencies) { registerDirectEvent(registrationName, dependencies); registerDirectEvent(registrationName + "Capture", dependencies); } function registerDirectEvent(registrationName, dependencies) { registrationNameDependencies[registrationName] && console.error( "EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", registrationName ); registrationNameDependencies[registrationName] = dependencies; var lowerCasedName = registrationName.toLowerCase(); possibleRegistrationNames[lowerCasedName] = registrationName; "onDoubleClick" === registrationName && (possibleRegistrationNames.ondblclick = registrationName); for (registrationName = 0; registrationName < dependencies.length; registrationName++) allNativeEvents.add(dependencies[registrationName]); } function checkControlledValueProps(tagName, props) { hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || null == props.value || ("select" === tagName ? console.error( "You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set `onChange`." ) : console.error( "You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`." )); props.onChange || props.readOnly || props.disabled || null == props.checked || console.error( "You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`." ); } function isAttributeNameSafe(attributeName) { if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) return true; if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) return false; if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) return validatedAttributeNameCache[attributeName] = true; illegalAttributeNameCache[attributeName] = true; console.error("Invalid attribute name: `%s`", attributeName); return false; } function getValueForAttributeOnCustomComponent(node, name, expected) { if (isAttributeNameSafe(name)) { if (!node.hasAttribute(name)) { switch (typeof expected) { case "symbol": case "object": return expected; case "function": return expected; case "boolean": if (false === expected) return expected; } return void 0 === expected ? void 0 : null; } node = node.getAttribute(name); if ("" === node && true === expected) return true; checkAttributeStringCoercion(expected, name); return node === "" + expected ? expected : node; } } function setValueForAttribute(node, name, value) { if (isAttributeNameSafe(name)) if (null === value) node.removeAttribute(name); else { switch (typeof value) { case "undefined": case "function": case "symbol": node.removeAttribute(name); return; case "boolean": var prefix2 = name.toLowerCase().slice(0, 5); if ("data-" !== prefix2 && "aria-" !== prefix2) { node.removeAttribute(name); return; } } checkAttributeStringCoercion(value, name); node.setAttribute(name, "" + value); } } function setValueForKnownAttribute(node, name, value) { if (null === value) node.removeAttribute(name); else { switch (typeof value) { case "undefined": case "function": case "symbol": case "boolean": node.removeAttribute(name); return; } checkAttributeStringCoercion(value, name); node.setAttribute(name, "" + value); } } function setValueForNamespacedAttribute(node, namespace, name, value) { if (null === value) node.removeAttribute(name); else { switch (typeof value) { case "undefined": case "function": case "symbol": case "boolean": node.removeAttribute(name); return; } checkAttributeStringCoercion(value, name); node.setAttributeNS(namespace, name, "" + value); } } function getToStringValue(value) { switch (typeof value) { case "bigint": case "boolean": case "number": case "string": case "undefined": return value; case "object": return checkFormFieldValueStringCoercion(value), value; default: return ""; } } function isCheckable(elem) { var type = elem.type; return (elem = elem.nodeName) && "input" === elem.toLowerCase() && ("checkbox" === type || "radio" === type); } function trackValueOnNode(node, valueField, currentValue) { var descriptor = Object.getOwnPropertyDescriptor( node.constructor.prototype, valueField ); if (!node.hasOwnProperty(valueField) && "undefined" !== typeof descriptor && "function" === typeof descriptor.get && "function" === typeof descriptor.set) { var get2 = descriptor.get, set2 = descriptor.set; Object.defineProperty(node, valueField, { configurable: true, get: function() { return get2.call(this); }, set: function(value) { checkFormFieldValueStringCoercion(value); currentValue = "" + value; set2.call(this, value); } }); Object.defineProperty(node, valueField, { enumerable: descriptor.enumerable }); return { getValue: function() { return currentValue; }, setValue: function(value) { checkFormFieldValueStringCoercion(value); currentValue = "" + value; }, stopTracking: function() { node._valueTracker = null; delete node[valueField]; } }; } } function track(node) { if (!node._valueTracker) { var valueField = isCheckable(node) ? "checked" : "value"; node._valueTracker = trackValueOnNode( node, valueField, "" + node[valueField] ); } } function updateValueIfChanged(node) { if (!node) return false; var tracker = node._valueTracker; if (!tracker) return true; var lastValue = tracker.getValue(); var value = ""; node && (value = isCheckable(node) ? node.checked ? "true" : "false" : node.value); node = value; return node !== lastValue ? (tracker.setValue(node), true) : false; } function getActiveElement(doc) { doc = doc || ("undefined" !== typeof document ? document : void 0); if ("undefined" === typeof doc) return null; try { return doc.activeElement || doc.body; } catch (e2) { return doc.body; } } function escapeSelectorAttributeValueInsideDoubleQuotes(value) { return value.replace( escapeSelectorAttributeValueInsideDoubleQuotesRegex, function(ch) { return "\\" + ch.charCodeAt(0).toString(16) + " "; } ); } function validateInputProps(element, props) { void 0 === props.checked || void 0 === props.defaultChecked || didWarnCheckedDefaultChecked || (console.error( "%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type ), didWarnCheckedDefaultChecked = true); void 0 === props.value || void 0 === props.defaultValue || didWarnValueDefaultValue$1 || (console.error( "%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components", getCurrentFiberOwnerNameInDevOrNull() || "A component", props.type ), didWarnValueDefaultValue$1 = true); } function updateInput(element, value, defaultValue2, lastDefaultValue, checked, defaultChecked, type, name) { element.name = ""; null != type && "function" !== typeof type && "symbol" !== typeof type && "boolean" !== typeof type ? (checkAttributeStringCoercion(type, "type"), element.type = type) : element.removeAttribute("type"); if (null != value) if ("number" === type) { if (0 === value && "" === element.value || element.value != value) element.value = "" + getToStringValue(value); } else element.value !== "" + getToStringValue(value) && (element.value = "" + getToStringValue(value)); else "submit" !== type && "reset" !== type || element.removeAttribute("value"); null != value ? setDefaultValue(element, type, getToStringValue(value)) : null != defaultValue2 ? setDefaultValue(element, type, getToStringValue(defaultValue2)) : null != lastDefaultValue && element.removeAttribute("value"); null == checked && null != defaultChecked && (element.defaultChecked = !!defaultChecked); null != checked && (element.checked = checked && "function" !== typeof checked && "symbol" !== typeof checked); null != name && "function" !== typeof name && "symbol" !== typeof name && "boolean" !== typeof name ? (checkAttributeStringCoercion(name, "name"), element.name = "" + getToStringValue(name)) : element.removeAttribute("name"); } function initInput(element, value, defaultValue2, checked, defaultChecked, type, name, isHydrating2) { null != type && "function" !== typeof type && "symbol" !== typeof type && "boolean" !== typeof type && (checkAttributeStringCoercion(type, "type"), element.type = type); if (null != value || null != defaultValue2) { if (!("submit" !== type && "reset" !== type || void 0 !== value && null !== value)) { track(element); return; } defaultValue2 = null != defaultValue2 ? "" + getToStringValue(defaultValue2) : ""; value = null != value ? "" + getToStringValue(value) : defaultValue2; isHydrating2 || value === element.value || (element.value = value); element.defaultValue = value; } checked = null != checked ? checked : defaultChecked; checked = "function" !== typeof checked && "symbol" !== typeof checked && !!checked; element.checked = isHydrating2 ? element.checked : !!checked; element.defaultChecked = !!checked; null != name && "function" !== typeof name && "symbol" !== typeof name && "boolean" !== typeof name && (checkAttributeStringCoercion(name, "name"), element.name = name); track(element); } function setDefaultValue(node, type, value) { "number" === type && getActiveElement(node.ownerDocument) === node || node.defaultValue === "" + value || (node.defaultValue = "" + value); } function validateOptionProps(element, props) { null == props.value && ("object" === typeof props.children && null !== props.children ? React53.Children.forEach(props.children, function(child) { null == child || "string" === typeof child || "number" === typeof child || "bigint" === typeof child || didWarnInvalidChild || (didWarnInvalidChild = true, console.error( "Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to