`. It will be replaced by the expression anyway.\n htmlString = htmlString.slice(0, -1 * attributePreMatch[0].length);\n skipTokenChars = attributePostMatch[0].length;\n } else {\n skipTokenChars = 0;\n }\n\n const binding = {\n attributeName,\n attributeValuePre,\n attributeValuePost,\n expressionIndex: i\n };\n\n bindings.push(binding);\n\n if (!withinTag && !withinAttribute) {\n // Add a placeholder text node, so we can find it later. Note we only support one dynamic child text node\n htmlString += ' ';\n }\n }\n\n const template = parseTemplate(htmlString);\n\n return {\n template,\n elementsToBindings\n }\n}\n\nfunction applyBindings (bindings, element, instanceBindings) {\n for (let i = 0; i < bindings.length; i++) {\n const binding = bindings[i];\n\n const targetNode = binding.attributeName\n ? element // attribute binding, just use the element itself\n : element.firstChild; // not an attribute binding, so has a placeholder text node\n\n const instanceBinding = {\n binding,\n targetNode,\n targetParentNode: undefined,\n currentExpression: undefined\n };\n\n instanceBindings.push(instanceBinding);\n }\n}\n\nfunction traverseAndSetupBindings (rootElement, elementsToBindings) {\n const instanceBindings = [];\n\n let topLevelBindings;\n if (elementsToBindings.size === 1 && (topLevelBindings = elementsToBindings.get(0))) {\n // Optimization for the common case where there's only one element and one binding\n // Skip creating a TreeWalker entirely and just handle the root DOM element\n applyBindings(topLevelBindings, rootElement, instanceBindings);\n } else {\n // traverse dom\n const treeWalker = document.createTreeWalker(rootElement, NodeFilter.SHOW_ELEMENT);\n\n let element = rootElement;\n let elementIndex = -1;\n do {\n const bindings = elementsToBindings.get(++elementIndex);\n if (bindings) {\n applyBindings(bindings, element, instanceBindings);\n }\n } while ((element = treeWalker.nextNode()))\n }\n\n return instanceBindings\n}\n\nfunction parseHtml (tokens) {\n // All templates and bound expressions are unique per tokens array\n const { template, elementsToBindings } = getFromMap(parseCache, tokens, () => parse(tokens));\n\n // When we parseHtml, we always return a fresh DOM instance ready to be updated\n const dom = template.cloneNode(true).content.firstElementChild;\n const instanceBindings = traverseAndSetupBindings(dom, elementsToBindings);\n\n return function updateDomInstance (expressions) {\n patch(expressions, instanceBindings);\n return dom\n }\n}\n\nfunction createFramework (state) {\n const domInstances = getFromMap(domInstancesCache, state, () => new Map());\n let domInstanceCacheKey = unkeyedSymbol;\n\n function html (tokens, ...expressions) {\n // Each unique lexical usage of map() is considered unique due to the html`` tagged template call it makes,\n // which has lexically unique tokens. The unkeyed symbol is just used for html`` usage outside of a map().\n const domInstancesForTokens = getFromMap(domInstances, tokens, () => new Map());\n const updateDomInstance = getFromMap(domInstancesForTokens, domInstanceCacheKey, () => parseHtml(tokens));\n\n return updateDomInstance(expressions) // update with expressions\n }\n\n function map (array, callback, keyFunction) {\n return array.map((item, index) => {\n const originalCacheKey = domInstanceCacheKey;\n domInstanceCacheKey = keyFunction(item);\n try {\n return callback(item, index)\n } finally {\n domInstanceCacheKey = originalCacheKey;\n }\n })\n }\n\n return { map, html }\n}\n\nfunction render (container, state, helpers, events, actions, refs, abortSignal, actionContext, firstRender) {\n const { labelWithSkin, titleForEmoji, unicodeWithSkin } = helpers;\n const { html, map } = createFramework(state);\n\n function emojiList (emojis, searchMode, prefix) {\n return map(emojis, (emoji, i) => {\n return html`
${\n emoji.unicode\n ? unicodeWithSkin(emoji, state.currentSkinTone)\n : ''\n } `\n // It's important for the cache key to be unique based on the prefix, because the framework caches based on the\n // unique tokens + cache key, and the same emoji may be used in the tab as well as in the fav bar\n }, emoji => `${prefix}-${emoji.id}`)\n }\n\n const section = () => {\n return html`
${state.i18n.searchLabel} ${state.i18n.searchDescription}
${state.skinToneButtonText || ''}
${state.i18n.skinToneDescription} ${\n map(state.skinTones, (skinTone, i) => {\n return html`
${skinTone}
`\n }, skinTone => skinTone)\n }
${\n map(state.groups, (group) => {\n return html`
${group.emoji}
`\n }, group => group.id)\n }
${state.message || ''}
${\n map(state.currentEmojisWithCategories, (emojiWithCategory, i) => {\n return html`
`\n }, emojiWithCategory => emojiWithCategory.category)\n }
${\n emojiList(state.currentFavorites, /* searchMode */ false, /* prefix */ 'fav')\n }
😀 `\n };\n\n const rootDom = section();\n\n // helper for traversing the dom, finding elements by an attribute, and getting the attribute value\n const forElementWithAttribute = (attributeName, callback) => {\n for (const element of container.querySelectorAll(`[${attributeName}]`)) {\n callback(element, element.getAttribute(attributeName));\n }\n };\n\n if (firstRender) { // not a re-render\n container.appendChild(rootDom);\n\n // we only bind events/refs once - there is no need to find them again given this component structure\n\n // bind events\n for (const eventName of ['click', 'focusout', 'input', 'keydown', 'keyup']) {\n forElementWithAttribute(`data-on-${eventName}`, (element, listenerName) => {\n element.addEventListener(eventName, events[listenerName]);\n });\n }\n\n // find refs\n forElementWithAttribute('data-ref', (element, ref) => {\n refs[ref] = element;\n });\n\n // destroy/abort logic\n abortSignal.addEventListener('abort', () => {\n container.removeChild(rootDom);\n });\n }\n\n // set up actions - these are re-bound on every render\n forElementWithAttribute('data-action', (element, action) => {\n let boundActions = actionContext.get(action);\n if (!boundActions) {\n actionContext.set(action, (boundActions = new WeakSet()));\n }\n\n // avoid applying the same action to the same element multiple times\n if (!boundActions.has(element)) {\n boundActions.add(element);\n actions[action](element);\n }\n });\n}\n\n/* istanbul ignore next */\nconst qM = typeof queueMicrotask === 'function' ? queueMicrotask : callback => Promise.resolve().then(callback);\n\nfunction createState (abortSignal) {\n let destroyed = false;\n let currentObserver;\n\n const propsToObservers = new Map();\n const dirtyObservers = new Set();\n\n let queued;\n\n const flush = () => {\n if (destroyed) {\n return\n }\n const observersToRun = [...dirtyObservers];\n dirtyObservers.clear(); // clear before running to force any new updates to run in another tick of the loop\n try {\n for (const observer of observersToRun) {\n observer();\n }\n } finally {\n queued = false;\n if (dirtyObservers.size) { // new updates, queue another one\n queued = true;\n qM(flush);\n }\n }\n };\n\n const state = new Proxy({}, {\n get (target, prop) {\n if (currentObserver) {\n let observers = propsToObservers.get(prop);\n if (!observers) {\n observers = new Set();\n propsToObservers.set(prop, observers);\n }\n observers.add(currentObserver);\n }\n return target[prop]\n },\n set (target, prop, newValue) {\n if (target[prop] !== newValue) {\n target[prop] = newValue;\n const observers = propsToObservers.get(prop);\n if (observers) {\n for (const observer of observers) {\n dirtyObservers.add(observer);\n }\n if (!queued) {\n queued = true;\n qM(flush);\n }\n }\n }\n return true\n }\n });\n\n const createEffect = (callback) => {\n const runnable = () => {\n const oldObserver = currentObserver;\n currentObserver = runnable;\n try {\n return callback()\n } finally {\n currentObserver = oldObserver;\n }\n };\n return runnable()\n };\n\n // destroy logic\n abortSignal.addEventListener('abort', () => {\n destroyed = true;\n });\n\n return {\n state,\n createEffect\n }\n}\n\n// Compare two arrays, with a function called on each item in the two arrays that returns true if the items are equal\nfunction arraysAreEqualByFunction (left, right, areEqualFunc) {\n if (left.length !== right.length) {\n return false\n }\n for (let i = 0; i < left.length; i++) {\n if (!areEqualFunc(left[i], right[i])) {\n return false\n }\n }\n return true\n}\n\nconst intersectionObserverCache = new WeakMap();\n\nfunction intersectionObserverAction (node, abortSignal, listener) {\n /* istanbul ignore else */\n {\n // The scroll root is always `.tabpanel`\n const root = node.closest('.tabpanel');\n\n let observer = intersectionObserverCache.get(root);\n if (!observer) {\n // TODO: replace this with the contentvisibilityautostatechange event when all supported browsers support it.\n // For now we use IntersectionObserver because it has better cross-browser support, and it would be bad for\n // old Safari versions if they eagerly downloaded all custom emoji all at once.\n observer = new IntersectionObserver(listener, {\n root,\n // trigger if we are 1/2 scroll container height away so that the images load a bit quicker while scrolling\n rootMargin: '50% 0px 50% 0px',\n // trigger if any part of the emoji grid is intersecting\n threshold: 0\n });\n\n // avoid creating a new IntersectionObserver for every category; just use one for the whole root\n intersectionObserverCache.set(root, observer);\n\n // assume that the abortSignal is always the same for this root node; just add one event listener\n abortSignal.addEventListener('abort', () => {\n observer.disconnect();\n });\n }\n\n observer.observe(node);\n }\n}\n\n/* eslint-disable prefer-const,no-labels,no-inner-declarations */\n\n// constants\nconst EMPTY_ARRAY = [];\n\nconst { assign } = Object;\n\nfunction createRoot (shadowRoot, props) {\n const refs = {};\n const abortController = new AbortController();\n const abortSignal = abortController.signal;\n const { state, createEffect } = createState(abortSignal);\n const actionContext = new Map();\n\n // initial state\n assign(state, {\n skinToneEmoji: undefined,\n i18n: undefined,\n database: undefined,\n customEmoji: undefined,\n customCategorySorting: undefined,\n emojiVersion: undefined\n });\n\n // public props\n assign(state, props);\n\n // private props\n assign(state, {\n initialLoad: true,\n currentEmojis: [],\n currentEmojisWithCategories: [],\n rawSearchText: '',\n searchText: '',\n searchMode: false,\n activeSearchItem: -1,\n message: undefined,\n skinTonePickerExpanded: false,\n skinTonePickerExpandedAfterAnimation: false,\n currentSkinTone: 0,\n activeSkinTone: 0,\n skinToneButtonText: undefined,\n pickerStyle: undefined,\n skinToneButtonLabel: '',\n skinTones: [],\n currentFavorites: [],\n defaultFavoriteEmojis: undefined,\n numColumns: DEFAULT_NUM_COLUMNS,\n isRtl: false,\n currentGroupIndex: 0,\n groups: groups,\n databaseLoaded: false,\n activeSearchItemId: undefined\n });\n\n //\n // Update the current group based on the currentGroupIndex\n //\n createEffect(() => {\n if (state.currentGroup !== state.groups[state.currentGroupIndex]) {\n state.currentGroup = state.groups[state.currentGroupIndex];\n }\n });\n\n //\n // Utils/helpers\n //\n\n const focus = id => {\n shadowRoot.getElementById(id).focus();\n };\n\n const emojiToDomNode = emoji => shadowRoot.getElementById(`emo-${emoji.id}`);\n\n // fire a custom event that crosses the shadow boundary\n const fireEvent = (name, detail) => {\n refs.rootElement.dispatchEvent(new CustomEvent(name, {\n detail,\n bubbles: true,\n composed: true\n }));\n };\n\n //\n // Comparison utils\n //\n\n const compareEmojiArrays = (a, b) => a.id === b.id;\n\n const compareCurrentEmojisWithCategories = (a, b) => {\n const { category: aCategory, emojis: aEmojis } = a;\n const { category: bCategory, emojis: bEmojis } = b;\n\n if (aCategory !== bCategory) {\n return false\n }\n\n return arraysAreEqualByFunction(aEmojis, bEmojis, compareEmojiArrays)\n };\n\n //\n // Update utils to avoid excessive re-renders\n //\n\n // avoid excessive re-renders by checking the value before setting\n const updateCurrentEmojis = (newEmojis) => {\n if (!arraysAreEqualByFunction(state.currentEmojis, newEmojis, compareEmojiArrays)) {\n state.currentEmojis = newEmojis;\n }\n };\n\n // avoid excessive re-renders\n const updateSearchMode = (newSearchMode) => {\n if (state.searchMode !== newSearchMode) {\n state.searchMode = newSearchMode;\n }\n };\n\n // avoid excessive re-renders\n const updateCurrentEmojisWithCategories = (newEmojisWithCategories) => {\n if (!arraysAreEqualByFunction(state.currentEmojisWithCategories, newEmojisWithCategories, compareCurrentEmojisWithCategories)) {\n state.currentEmojisWithCategories = newEmojisWithCategories;\n }\n };\n\n // Helpers used by PickerTemplate\n\n const unicodeWithSkin = (emoji, currentSkinTone) => (\n (currentSkinTone && emoji.skins && emoji.skins[currentSkinTone]) || emoji.unicode\n );\n\n const labelWithSkin = (emoji, currentSkinTone) => (\n uniq([\n (emoji.name || unicodeWithSkin(emoji, currentSkinTone)),\n emoji.annotation,\n ...(emoji.shortcodes || EMPTY_ARRAY)\n ].filter(Boolean)).join(', ')\n );\n\n const titleForEmoji = (emoji) => (\n emoji.annotation || (emoji.shortcodes || EMPTY_ARRAY).join(', ')\n );\n\n const helpers = {\n labelWithSkin, titleForEmoji, unicodeWithSkin\n };\n const events = {\n onClickSkinToneButton,\n onEmojiClick,\n onNavClick,\n onNavKeydown,\n onSearchKeydown,\n onSkinToneOptionsClick,\n onSkinToneOptionsFocusOut,\n onSkinToneOptionsKeydown,\n onSkinToneOptionsKeyup,\n onSearchInput\n };\n const actions = {\n calculateEmojiGridStyle,\n updateOnIntersection\n };\n\n let firstRender = true;\n createEffect(() => {\n render(shadowRoot, state, helpers, events, actions, refs, abortSignal, actionContext, firstRender);\n firstRender = false;\n });\n\n //\n // Determine the emoji support level (in requestIdleCallback)\n //\n\n // mount logic\n if (!state.emojiVersion) {\n detectEmojiSupportLevel().then(level => {\n // Can't actually test emoji support in Jest/Vitest/JSDom, emoji never render in color in Cairo\n /* istanbul ignore next */\n if (!level) {\n state.message = state.i18n.emojiUnsupportedMessage;\n }\n });\n }\n\n //\n // Set or update the database object\n //\n\n createEffect(() => {\n // show a Loading message if it takes a long time, or show an error if there's a network/IDB error\n async function handleDatabaseLoading () {\n let showingLoadingMessage = false;\n const timeoutHandle = setTimeout(() => {\n showingLoadingMessage = true;\n state.message = state.i18n.loadingMessage;\n }, TIMEOUT_BEFORE_LOADING_MESSAGE);\n try {\n await state.database.ready();\n state.databaseLoaded = true; // eslint-disable-line no-unused-vars\n } catch (err) {\n console.error(err);\n state.message = state.i18n.networkErrorMessage;\n } finally {\n clearTimeout(timeoutHandle);\n if (showingLoadingMessage) { // Seems safer than checking the i18n string, which may change\n showingLoadingMessage = false;\n state.message = ''; // eslint-disable-line no-unused-vars\n }\n }\n }\n\n if (state.database) {\n /* no await */\n handleDatabaseLoading();\n }\n });\n\n //\n // Global styles for the entire picker\n //\n\n createEffect(() => {\n state.pickerStyle = `\n --num-groups: ${state.groups.length}; \n --indicator-opacity: ${state.searchMode ? 0 : 1}; \n --num-skintones: ${NUM_SKIN_TONES};`;\n });\n\n //\n // Set or update the customEmoji\n //\n\n createEffect(() => {\n if (state.customEmoji && state.database) {\n updateCustomEmoji(); // re-run whenever customEmoji change\n }\n });\n\n createEffect(() => {\n if (state.customEmoji && state.customEmoji.length) {\n if (state.groups !== allGroups) { // don't update unnecessarily\n state.groups = allGroups;\n }\n } else if (state.groups !== groups) {\n if (state.currentGroupIndex) {\n // If the current group is anything other than \"custom\" (which is first), decrement.\n // This fixes the odd case where you set customEmoji, then pick a category, then unset customEmoji\n state.currentGroupIndex--;\n }\n state.groups = groups;\n }\n });\n\n //\n // Set or update the preferred skin tone\n //\n\n createEffect(() => {\n async function updatePreferredSkinTone () {\n if (state.databaseLoaded) {\n state.currentSkinTone = await state.database.getPreferredSkinTone();\n }\n }\n\n /* no await */ updatePreferredSkinTone();\n });\n\n createEffect(() => {\n state.skinTones = Array(NUM_SKIN_TONES).fill().map((_, i) => applySkinTone(state.skinToneEmoji, i));\n });\n\n createEffect(() => {\n state.skinToneButtonText = state.skinTones[state.currentSkinTone];\n });\n\n createEffect(() => {\n state.skinToneButtonLabel = state.i18n.skinToneLabel.replace('{skinTone}', state.i18n.skinTones[state.currentSkinTone]);\n });\n\n //\n // Set or update the favorites emojis\n //\n\n createEffect(() => {\n async function updateDefaultFavoriteEmojis () {\n const { database } = state;\n const favs = (await Promise.all(MOST_COMMONLY_USED_EMOJI.map(unicode => (\n database.getEmojiByUnicodeOrName(unicode)\n )))).filter(Boolean); // filter because in Jest/Vitest tests we don't have all the emoji in the DB\n state.defaultFavoriteEmojis = favs;\n }\n\n if (state.databaseLoaded) {\n /* no await */ updateDefaultFavoriteEmojis();\n }\n });\n\n function updateCustomEmoji () {\n // Certain effects have an implicit dependency on customEmoji since it affects the database\n // Getting it here on the state ensures this effect re-runs when customEmoji change.\n const { customEmoji, database } = state;\n const databaseCustomEmoji = customEmoji || EMPTY_ARRAY;\n if (database.customEmoji !== databaseCustomEmoji) {\n // Avoid setting this if the customEmoji have _not_ changed, because the setter triggers a re-computation of the\n // `customEmojiIndex`. Note we don't bother with deep object changes.\n database.customEmoji = databaseCustomEmoji;\n }\n }\n\n createEffect(() => {\n async function updateFavorites () {\n updateCustomEmoji(); // re-run whenever customEmoji change\n const { database, defaultFavoriteEmojis, numColumns } = state;\n const dbFavorites = await database.getTopFavoriteEmoji(numColumns);\n const favorites = await summarizeEmojis(uniqBy([\n ...dbFavorites,\n ...defaultFavoriteEmojis\n ], _ => (_.unicode || _.name)).slice(0, numColumns));\n state.currentFavorites = favorites;\n }\n\n if (state.databaseLoaded && state.defaultFavoriteEmojis) {\n /* no await */ updateFavorites();\n }\n });\n\n //\n // Re-run whenever the emoji grid changes size, and re-calc style/layout-related state variables:\n // 1) Re-calculate the --num-columns var because it may have changed\n // 2) Re-calculate whether we're in RTL mode or not.\n //\n // The benefit of doing this in one place is to align with rAF/ResizeObserver\n // and do all the calculations in one go. RTL vs LTR is not strictly layout-related,\n // but since we're already reading the style here, and since it's already aligned with\n // the rAF loop, this is the most appropriate place to do it perf-wise.\n //\n\n function calculateEmojiGridStyle (node) {\n resizeObserverAction(node, abortSignal, () => {\n /* istanbul ignore next */\n { // jsdom throws errors for this kind of fancy stuff\n // read all the style/layout calculations we need to make\n const style = getComputedStyle(refs.rootElement);\n const newNumColumns = parseInt(style.getPropertyValue('--num-columns'), 10);\n const newIsRtl = style.getPropertyValue('direction') === 'rtl';\n\n // write to state variables\n state.numColumns = newNumColumns;\n state.isRtl = newIsRtl;\n }\n });\n }\n\n // Re-run whenever the custom emoji in a category are shown/hidden. This is an optimization that simulates\n // what we'd get from `
` but without rendering an `
`.\n function updateOnIntersection (node) {\n intersectionObserverAction(node, abortSignal, (entries) => {\n for (const { target, isIntersecting } of entries) {\n target.classList.toggle('onscreen', isIntersecting);\n }\n });\n }\n\n //\n // Set or update the currentEmojis. Check for invalid ZWJ renderings\n // (i.e. double emoji).\n //\n\n createEffect(() => {\n async function updateEmojis () {\n const { searchText, currentGroup, databaseLoaded, customEmoji } = state;\n if (!databaseLoaded) {\n state.currentEmojis = [];\n state.searchMode = false;\n } else if (searchText.length >= MIN_SEARCH_TEXT_LENGTH) {\n const newEmojis = await getEmojisBySearchQuery(searchText);\n if (state.searchText === searchText) { // if the situation changes asynchronously, do not update\n updateCurrentEmojis(newEmojis);\n updateSearchMode(true);\n }\n } else { // database is loaded and we're not in search mode, so we're in normal category mode\n const { id: currentGroupId } = currentGroup;\n // avoid race condition where currentGroupId is -1 and customEmoji is undefined/empty\n if (currentGroupId !== -1 || (customEmoji && customEmoji.length)) {\n const newEmojis = await getEmojisByGroup(currentGroupId);\n if (state.currentGroup.id === currentGroupId) { // if the situation changes asynchronously, do not update\n updateCurrentEmojis(newEmojis);\n updateSearchMode(false);\n }\n }\n }\n }\n\n /* no await */ updateEmojis();\n });\n\n const resetScrollTopInRaf = () => {\n rAF(() => resetScrollTopIfPossible(refs.tabpanelElement));\n };\n\n // Some emojis have their ligatures rendered as two or more consecutive emojis\n // We want to treat these the same as unsupported emojis, so we compare their\n // widths against the baseline widths and remove them as necessary\n createEffect(() => {\n const { currentEmojis, emojiVersion } = state;\n const zwjEmojisToCheck = currentEmojis\n .filter(emoji => emoji.unicode) // filter custom emoji\n .filter(emoji => hasZwj(emoji) && !supportedZwjEmojis.has(emoji.unicode));\n if (!emojiVersion && zwjEmojisToCheck.length) {\n // render now, check their length later\n updateCurrentEmojis(currentEmojis);\n rAF(() => checkZwjSupportAndUpdate(zwjEmojisToCheck));\n } else {\n const newEmojis = emojiVersion ? currentEmojis : currentEmojis.filter(isZwjSupported);\n updateCurrentEmojis(newEmojis);\n // Reset scroll top to 0 when emojis change\n resetScrollTopInRaf();\n }\n });\n\n function checkZwjSupportAndUpdate (zwjEmojisToCheck) {\n const allSupported = checkZwjSupport(zwjEmojisToCheck, refs.baselineEmoji, emojiToDomNode);\n if (allSupported) {\n // Even if all emoji are supported, we still need to reset the scroll top to 0 when emojis change\n resetScrollTopInRaf();\n } else {\n // Force update. We only do this if there are any unsupported ZWJ characters since otherwise,\n // for browsers that support all emoji, it would be an unnecessary extra re-render.\n state.currentEmojis = [...state.currentEmojis];\n }\n }\n\n function isZwjSupported (emoji) {\n return !emoji.unicode || !hasZwj(emoji) || supportedZwjEmojis.get(emoji.unicode)\n }\n\n async function filterEmojisByVersion (emojis) {\n const emojiSupportLevel = state.emojiVersion || await detectEmojiSupportLevel();\n // !version corresponds to custom emoji\n return emojis.filter(({ version }) => !version || version <= emojiSupportLevel)\n }\n\n async function summarizeEmojis (emojis) {\n return summarizeEmojisForUI(emojis, state.emojiVersion || await detectEmojiSupportLevel())\n }\n\n async function getEmojisByGroup (group) {\n // -1 is custom emoji\n const emoji = group === -1 ? state.customEmoji : await state.database.getEmojiByGroup(group);\n return summarizeEmojis(await filterEmojisByVersion(emoji))\n }\n\n async function getEmojisBySearchQuery (query) {\n return summarizeEmojis(await filterEmojisByVersion(await state.database.getEmojiBySearchQuery(query)))\n }\n\n createEffect(() => {\n });\n\n //\n // Derive currentEmojisWithCategories from currentEmojis. This is always done even if there\n // are no categories, because it's just easier to code the HTML this way.\n //\n\n createEffect(() => {\n function calculateCurrentEmojisWithCategories () {\n const { searchMode, currentEmojis } = state;\n if (searchMode) {\n return [\n {\n category: '',\n emojis: currentEmojis\n }\n ]\n }\n const categoriesToEmoji = new Map();\n for (const emoji of currentEmojis) {\n const category = emoji.category || '';\n let emojis = categoriesToEmoji.get(category);\n if (!emojis) {\n emojis = [];\n categoriesToEmoji.set(category, emojis);\n }\n emojis.push(emoji);\n }\n return [...categoriesToEmoji.entries()]\n .map(([category, emojis]) => ({ category, emojis }))\n .sort((a, b) => state.customCategorySorting(a.category, b.category))\n }\n\n const newEmojisWithCategories = calculateCurrentEmojisWithCategories();\n updateCurrentEmojisWithCategories(newEmojisWithCategories);\n });\n\n //\n // Handle active search item (i.e. pressing up or down while searching)\n //\n\n createEffect(() => {\n state.activeSearchItemId = state.activeSearchItem !== -1 && state.currentEmojis[state.activeSearchItem].id;\n });\n\n //\n // Handle user input on the search input\n //\n\n createEffect(() => {\n const { rawSearchText } = state;\n rIC(() => {\n state.searchText = (rawSearchText || '').trim(); // defer to avoid input delays, plus we can trim here\n state.activeSearchItem = -1;\n });\n });\n\n function onSearchKeydown (event) {\n if (!state.searchMode || !state.currentEmojis.length) {\n return\n }\n\n const goToNextOrPrevious = (previous) => {\n halt(event);\n state.activeSearchItem = incrementOrDecrement(previous, state.activeSearchItem, state.currentEmojis);\n };\n\n switch (event.key) {\n case 'ArrowDown':\n return goToNextOrPrevious(false)\n case 'ArrowUp':\n return goToNextOrPrevious(true)\n case 'Enter':\n if (state.activeSearchItem === -1) {\n // focus the first option in the list since the list must be non-empty at this point (it's verified above)\n state.activeSearchItem = 0;\n } else { // there is already an active search item\n halt(event);\n return clickEmoji(state.currentEmojis[state.activeSearchItem].id)\n }\n }\n }\n\n //\n // Handle user input on nav\n //\n\n function onNavClick (event) {\n const { target } = event;\n const closestTarget = target.closest('.nav-button');\n /* istanbul ignore if */\n if (!closestTarget) {\n return // This should never happen, but makes me nervous not to have it\n }\n const groupId = parseInt(closestTarget.dataset.groupId, 10);\n refs.searchElement.value = ''; // clear search box input\n state.rawSearchText = '';\n state.searchText = '';\n state.activeSearchItem = -1;\n state.currentGroupIndex = state.groups.findIndex(_ => _.id === groupId);\n }\n\n function onNavKeydown (event) {\n const { target, key } = event;\n\n const doFocus = el => {\n if (el) {\n halt(event);\n el.focus();\n }\n };\n\n switch (key) {\n case 'ArrowLeft':\n return doFocus(target.previousElementSibling)\n case 'ArrowRight':\n return doFocus(target.nextElementSibling)\n case 'Home':\n return doFocus(target.parentElement.firstElementChild)\n case 'End':\n return doFocus(target.parentElement.lastElementChild)\n }\n }\n\n //\n // Handle user input on an emoji\n //\n\n async function clickEmoji (unicodeOrName) {\n const emoji = await state.database.getEmojiByUnicodeOrName(unicodeOrName);\n const emojiSummary = [...state.currentEmojis, ...state.currentFavorites]\n .find(_ => (_.id === unicodeOrName));\n const skinTonedUnicode = emojiSummary.unicode && unicodeWithSkin(emojiSummary, state.currentSkinTone);\n await state.database.incrementFavoriteEmojiCount(unicodeOrName);\n fireEvent('emoji-click', {\n emoji,\n skinTone: state.currentSkinTone,\n ...(skinTonedUnicode && { unicode: skinTonedUnicode }),\n ...(emojiSummary.name && { name: emojiSummary.name })\n });\n }\n\n async function onEmojiClick (event) {\n const { target } = event;\n /* istanbul ignore if */\n if (!target.classList.contains('emoji')) {\n // This should never happen, but makes me nervous not to have it\n return\n }\n halt(event);\n const id = target.id.substring(4); // replace 'emo-' or 'fav-' prefix\n\n /* no await */ clickEmoji(id);\n }\n\n //\n // Handle user input on the skintone picker\n //\n\n function changeSkinTone (skinTone) {\n state.currentSkinTone = skinTone;\n state.skinTonePickerExpanded = false;\n focus('skintone-button');\n fireEvent('skin-tone-change', { skinTone });\n /* no await */ state.database.setPreferredSkinTone(skinTone);\n }\n\n function onSkinToneOptionsClick (event) {\n const { target: { id } } = event;\n const match = id && id.match(/^skintone-(\\d)/); // skintone option format\n /* istanbul ignore if */\n if (!match) { // not a skintone option\n return // This should never happen, but makes me nervous not to have it\n }\n halt(event);\n const skinTone = parseInt(match[1], 10); // remove 'skintone-' prefix\n changeSkinTone(skinTone);\n }\n\n function onClickSkinToneButton (event) {\n state.skinTonePickerExpanded = !state.skinTonePickerExpanded;\n state.activeSkinTone = state.currentSkinTone;\n // this should always be true, since the button is obscured by the listbox, so this `if` is just to be sure\n if (state.skinTonePickerExpanded) {\n halt(event);\n rAF(() => focus('skintone-list'));\n }\n }\n\n // To make the animation nicer, change the z-index of the skintone picker button\n // *after* the animation has played. This makes it appear that the picker box\n // is expanding \"below\" the button\n createEffect(() => {\n if (state.skinTonePickerExpanded) {\n refs.skinToneDropdown.addEventListener('transitionend', () => {\n state.skinTonePickerExpandedAfterAnimation = true; // eslint-disable-line no-unused-vars\n }, { once: true });\n } else {\n state.skinTonePickerExpandedAfterAnimation = false; // eslint-disable-line no-unused-vars\n }\n });\n\n function onSkinToneOptionsKeydown (event) {\n // this should never happen, but makes me nervous not to have it\n /* istanbul ignore if */\n if (!state.skinTonePickerExpanded) {\n return\n }\n const changeActiveSkinTone = async nextSkinTone => {\n halt(event);\n state.activeSkinTone = nextSkinTone;\n };\n\n switch (event.key) {\n case 'ArrowUp':\n return changeActiveSkinTone(incrementOrDecrement(true, state.activeSkinTone, state.skinTones))\n case 'ArrowDown':\n return changeActiveSkinTone(incrementOrDecrement(false, state.activeSkinTone, state.skinTones))\n case 'Home':\n return changeActiveSkinTone(0)\n case 'End':\n return changeActiveSkinTone(state.skinTones.length - 1)\n case 'Enter':\n // enter on keydown, space on keyup. this is just how browsers work for buttons\n // https://lists.w3.org/Archives/Public/w3c-wai-ig/2019JanMar/0086.html\n halt(event);\n return changeSkinTone(state.activeSkinTone)\n case 'Escape':\n halt(event);\n state.skinTonePickerExpanded = false;\n return focus('skintone-button')\n }\n }\n\n function onSkinToneOptionsKeyup (event) {\n // this should never happen, but makes me nervous not to have it\n /* istanbul ignore if */\n if (!state.skinTonePickerExpanded) {\n return\n }\n switch (event.key) {\n case ' ':\n // enter on keydown, space on keyup. this is just how browsers work for buttons\n // https://lists.w3.org/Archives/Public/w3c-wai-ig/2019JanMar/0086.html\n halt(event);\n return changeSkinTone(state.activeSkinTone)\n }\n }\n\n async function onSkinToneOptionsFocusOut (event) {\n // On blur outside of the skintone listbox, collapse the skintone picker.\n const { relatedTarget } = event;\n // The `else` should never happen, but makes me nervous not to have it\n /* istanbul ignore else */\n if (!relatedTarget || relatedTarget.id !== 'skintone-list') {\n state.skinTonePickerExpanded = false;\n }\n }\n\n function onSearchInput (event) {\n state.rawSearchText = event.target.value;\n }\n\n return {\n $set (newState) {\n assign(state, newState);\n },\n $destroy () {\n abortController.abort();\n }\n }\n}\n\nconst DEFAULT_DATA_SOURCE = 'https://cdn.jsdelivr.net/npm/emoji-picker-element-data@^1/en/emojibase/data.json';\nconst DEFAULT_LOCALE = 'en';\n\nvar enI18n = {\n categoriesLabel: 'Categories',\n emojiUnsupportedMessage: 'Your browser does not support color emoji.',\n favoritesLabel: 'Favorites',\n loadingMessage: 'Loading…',\n networkErrorMessage: 'Could not load emoji.',\n regionLabel: 'Emoji picker',\n searchDescription: 'When search results are available, press up or down to select and enter to choose.',\n searchLabel: 'Search',\n searchResultsLabel: 'Search results',\n skinToneDescription: 'When expanded, press up or down to select and enter to choose.',\n skinToneLabel: 'Choose a skin tone (currently {skinTone})',\n skinTonesLabel: 'Skin tones',\n skinTones: [\n 'Default',\n 'Light',\n 'Medium-Light',\n 'Medium',\n 'Medium-Dark',\n 'Dark'\n ],\n categories: {\n custom: 'Custom',\n 'smileys-emotion': 'Smileys and emoticons',\n 'people-body': 'People and body',\n 'animals-nature': 'Animals and nature',\n 'food-drink': 'Food and drink',\n 'travel-places': 'Travel and places',\n activities: 'Activities',\n objects: 'Objects',\n symbols: 'Symbols',\n flags: 'Flags'\n }\n};\n\nvar baseStyles = \":host{--emoji-size:1.375rem;--emoji-padding:0.5rem;--category-emoji-size:var(--emoji-size);--category-emoji-padding:var(--emoji-padding);--indicator-height:3px;--input-border-radius:0.5rem;--input-border-size:1px;--input-font-size:1rem;--input-line-height:1.5;--input-padding:0.25rem;--num-columns:8;--outline-size:2px;--border-size:1px;--border-radius:0;--skintone-border-radius:1rem;--category-font-size:1rem;display:flex;width:min-content;height:400px}:host,:host(.light){color-scheme:light;--background:#fff;--border-color:#e0e0e0;--indicator-color:#385ac1;--input-border-color:#999;--input-font-color:#111;--input-placeholder-color:#999;--outline-color:#999;--category-font-color:#111;--button-active-background:#e6e6e6;--button-hover-background:#d9d9d9}:host(.dark){color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}@media (prefers-color-scheme:dark){:host{color-scheme:dark;--background:#222;--border-color:#444;--indicator-color:#5373ec;--input-border-color:#ccc;--input-font-color:#efefef;--input-placeholder-color:#ccc;--outline-color:#fff;--category-font-color:#efefef;--button-active-background:#555555;--button-hover-background:#484848}}:host([hidden]){display:none}button{margin:0;padding:0;border:0;background:0 0;box-shadow:none;-webkit-tap-highlight-color:transparent}button::-moz-focus-inner{border:0}input{padding:0;margin:0;line-height:1.15;font-family:inherit}input[type=search]{-webkit-appearance:none}:focus{outline:var(--outline-color) solid var(--outline-size);outline-offset:calc(-1*var(--outline-size))}:host([data-js-focus-visible]) :focus:not([data-focus-visible-added]){outline:0}:focus:not(:focus-visible){outline:0}.hide-focus{outline:0}*{box-sizing:border-box}.picker{contain:content;display:flex;flex-direction:column;background:var(--background);border:var(--border-size) solid var(--border-color);border-radius:var(--border-radius);width:100%;height:100%;overflow:hidden;--total-emoji-size:calc(var(--emoji-size) + (2 * var(--emoji-padding)));--total-category-emoji-size:calc(var(--category-emoji-size) + (2 * var(--category-emoji-padding)))}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.hidden{opacity:0;pointer-events:none}.abs-pos{position:absolute;left:0;top:0}.gone{display:none!important}.skintone-button-wrapper,.skintone-list{background:var(--background);z-index:3}.skintone-button-wrapper.expanded{z-index:1}.skintone-list{position:absolute;inset-inline-end:0;top:0;z-index:2;overflow:visible;border-bottom:var(--border-size) solid var(--border-color);border-radius:0 0 var(--skintone-border-radius) var(--skintone-border-radius);will-change:transform;transition:transform .2s ease-in-out;transform-origin:center 0}@media (prefers-reduced-motion:reduce){.skintone-list{transition-duration:.001s}}@supports not (inset-inline-end:0){.skintone-list{right:0}}.skintone-list.no-animate{transition:none}.tabpanel{overflow-y:auto;scrollbar-gutter:stable;-webkit-overflow-scrolling:touch;will-change:transform;min-height:0;flex:1;contain:content}.emoji-menu{display:grid;grid-template-columns:repeat(var(--num-columns),var(--total-emoji-size));justify-content:space-around;align-items:flex-start;width:100%}.emoji-menu.visibility-auto{content-visibility:auto;contain-intrinsic-size:calc(var(--num-columns)*var(--total-emoji-size)) calc(var(--num-rows)*var(--total-emoji-size))}.category{padding:var(--emoji-padding);font-size:var(--category-font-size);color:var(--category-font-color)}.emoji,button.emoji{font-size:var(--emoji-size);display:flex;align-items:center;justify-content:center;border-radius:100%;height:var(--total-emoji-size);width:var(--total-emoji-size);line-height:1;overflow:hidden;font-family:var(--emoji-font-family);cursor:pointer}@media (hover:hover) and (pointer:fine){.emoji:hover,button.emoji:hover{background:var(--button-hover-background)}}.emoji.active,.emoji:active,button.emoji.active,button.emoji:active{background:var(--button-active-background)}.onscreen .custom-emoji::after{content:\\\"\\\";width:var(--emoji-size);height:var(--emoji-size);background-repeat:no-repeat;background-position:center center;background-size:contain;background-image:var(--custom-emoji-background)}.nav,.nav-button{align-items:center}.nav{display:grid;justify-content:space-between;contain:content}.nav-button{display:flex;justify-content:center}.nav-emoji{font-size:var(--category-emoji-size);width:var(--total-category-emoji-size);height:var(--total-category-emoji-size)}.indicator-wrapper{display:flex;border-bottom:1px solid var(--border-color)}.indicator{width:calc(100%/var(--num-groups));height:var(--indicator-height);opacity:var(--indicator-opacity);background-color:var(--indicator-color);will-change:transform,opacity;transition:opacity .1s linear,transform .25s ease-in-out}@media (prefers-reduced-motion:reduce){.indicator{will-change:opacity;transition:opacity .1s linear}}.pad-top,input.search{background:var(--background);width:100%}.pad-top{height:var(--emoji-padding);z-index:3}.search-row{display:flex;align-items:center;position:relative;padding-inline-start:var(--emoji-padding);padding-bottom:var(--emoji-padding)}.search-wrapper{flex:1;min-width:0}input.search{padding:var(--input-padding);border-radius:var(--input-border-radius);border:var(--input-border-size) solid var(--input-border-color);color:var(--input-font-color);font-size:var(--input-font-size);line-height:var(--input-line-height)}input.search::placeholder{color:var(--input-placeholder-color)}.favorites{overflow-y:auto;scrollbar-gutter:stable;display:flex;flex-direction:row;border-top:var(--border-size) solid var(--border-color);contain:content}.message{padding:var(--emoji-padding)}\";\n\nconst PROPS = [\n 'customEmoji',\n 'customCategorySorting',\n 'database',\n 'dataSource',\n 'i18n',\n 'locale',\n 'skinToneEmoji',\n 'emojiVersion'\n];\n\n// Styles injected ourselves, so we can declare the FONT_FAMILY variable in one place\nconst EXTRA_STYLES = `:host{--emoji-font-family:${FONT_FAMILY}}`;\n\nclass PickerElement extends HTMLElement {\n constructor (props) {\n super();\n this.attachShadow({ mode: 'open' });\n const style = document.createElement('style');\n style.textContent = baseStyles + EXTRA_STYLES;\n this.shadowRoot.appendChild(style);\n this._ctx = {\n // Set defaults\n locale: DEFAULT_LOCALE,\n dataSource: DEFAULT_DATA_SOURCE,\n skinToneEmoji: DEFAULT_SKIN_TONE_EMOJI,\n customCategorySorting: DEFAULT_CATEGORY_SORTING,\n customEmoji: null,\n i18n: enI18n,\n emojiVersion: null,\n ...props\n };\n // Handle properties set before the element was upgraded\n for (const prop of PROPS) {\n if (prop !== 'database' && Object.prototype.hasOwnProperty.call(this, prop)) {\n this._ctx[prop] = this[prop];\n delete this[prop];\n }\n }\n this._dbFlush(); // wait for a flush before creating the db, in case the user calls e.g. a setter or setAttribute\n }\n\n connectedCallback () {\n // The _cmp may be defined if the component was immediately disconnected and then reconnected. In that case,\n // do nothing (preserve the state)\n if (!this._cmp) {\n this._cmp = createRoot(this.shadowRoot, this._ctx);\n }\n }\n\n disconnectedCallback () {\n // Check in a microtask if the element is still connected. If so, treat this as a \"move\" rather than a disconnect\n // Inspired by Vue: https://vuejs.org/guide/extras/web-components.html#building-custom-elements-with-vue\n qM(() => {\n // this._cmp may be defined if connect-disconnect-connect-disconnect occurs synchronously\n if (!this.isConnected && this._cmp) {\n this._cmp.$destroy();\n this._cmp = undefined;\n\n const { database } = this._ctx;\n database.close()\n // only happens if the database failed to load in the first place, so we don't care\n .catch(err => console.error(err));\n }\n });\n }\n\n static get observedAttributes () {\n return ['locale', 'data-source', 'skin-tone-emoji', 'emoji-version'] // complex objects aren't supported, also use kebab-case\n }\n\n attributeChangedCallback (attrName, oldValue, newValue) {\n this._set(\n // convert from kebab-case to camelcase\n // see https://github.com/sveltejs/svelte/issues/3852#issuecomment-665037015\n attrName.replace(/-([a-z])/g, (_, up) => up.toUpperCase()),\n // convert string attribute to float if necessary\n attrName === 'emoji-version' ? parseFloat(newValue) : newValue\n );\n }\n\n _set (prop, newValue) {\n this._ctx[prop] = newValue;\n if (this._cmp) {\n this._cmp.$set({ [prop]: newValue });\n }\n if (['locale', 'dataSource'].includes(prop)) {\n this._dbFlush();\n }\n }\n\n _dbCreate () {\n const { locale, dataSource, database } = this._ctx;\n // only create a new database if we really need to\n if (!database || database.locale !== locale || database.dataSource !== dataSource) {\n this._set('database', new Database({ locale, dataSource }));\n }\n }\n\n // Update the Database in one microtask if the locale/dataSource change. We do one microtask\n // so we don't create two Databases if e.g. both the locale and the dataSource change\n _dbFlush () {\n qM(() => (\n this._dbCreate()\n ));\n }\n}\n\nconst definitions = {};\n\nfor (const prop of PROPS) {\n definitions[prop] = {\n get () {\n if (prop === 'database') {\n // in rare cases, the microtask may not be flushed yet, so we need to instantiate the DB\n // now if the user is asking for it\n this._dbCreate();\n }\n return this._ctx[prop]\n },\n set (val) {\n if (prop === 'database') {\n throw new Error('database is read-only')\n }\n this._set(prop, val);\n }\n };\n}\n\nObject.defineProperties(PickerElement.prototype, definitions);\n\n/* istanbul ignore else */\nif (!customElements.get('emoji-picker')) { // if already defined, do nothing (e.g. same script imported twice)\n customElements.define('emoji-picker', PickerElement);\n}\n\nexport { PickerElement as default };\n"],
- "mappings": ";;;AAAA,SAAS,qBAAsB,KAAK;AAClC,MAAI,OAAO,QAAQ,YAAY,CAAC,KAAK;AACnC,UAAM,IAAI,MAAM,uCAAuC,GAAG;AAAA,EAC5D;AACF;AAEA,SAAS,aAAc,QAAQ;AAC7B,MAAI,OAAO,WAAW,UAAU;AAC9B,UAAM,IAAI,MAAM,6BAA6B,MAAM;AAAA,EACrD;AACF;AAEA,IAAM,qBAAqB;AAC3B,IAAM,qBAAqB;AAC3B,IAAM,cAAc;AACpB,IAAM,iBAAiB;AACvB,IAAM,kBAAkB;AACxB,IAAM,eAAe;AACrB,IAAM,eAAe;AACrB,IAAM,gBAAgB;AACtB,IAAM,cAAc;AACpB,IAAM,cAAc;AACpB,IAAM,cAAc;AACpB,IAAM,wBAAwB;AAC9B,IAAM,WAAW;AACjB,IAAM,UAAU;AAChB,IAAM,yBAAyB;AAC/B,IAAM,gBAAgB;AACtB,IAAM,iBAAiB;AACvB,IAAM,qBAAqB;AAC3B,IAAM,qBAAqB;AAE3B,IAAM,sBAAsB;AAC5B,IAAM,iBAAiB;AAGvB,SAAS,OAAQ,KAAK,MAAM;AAC1B,QAAMA,OAAM,oBAAI,IAAI;AACpB,QAAM,MAAM,CAAC;AACb,aAAW,QAAQ,KAAK;AACtB,UAAM,MAAM,KAAK,IAAI;AACrB,QAAI,CAACA,KAAI,IAAI,GAAG,GAAG;AACjB,MAAAA,KAAI,IAAI,GAAG;AACX,UAAI,KAAK,IAAI;AAAA,IACf;AAAA,EACF;AACA,SAAO;AACT;AAEA,SAAS,UAAW,QAAQ;AAC1B,SAAO,OAAO,QAAQ,OAAK,EAAE,OAAO;AACtC;AAE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AAI,GAAG,SAAS,CAAC;AAAA,IACrC;AACA,QAAI,CAAC,UAAU,YAAY,EAAE,SAAS,IAAI,GAAG;AAC3C,WAAK,SAAS;AAAA,IAChB;AAAA,EACF;AAAA,EAEA,YAAa;AACX,UAAM,EAAE,QAAQ,YAAY,SAAS,IAAI,KAAK;AAE9C,QAAI,CAAC,YAAY,SAAS,WAAW,UAAU,SAAS,eAAe,YAAY;AACjF,WAAK,KAAK,YAAY,IAAI,SAAS,EAAE,QAAQ,WAAW,CAAC,CAAC;AAAA,IAC5D;AAAA,EACF;AAAA;AAAA;AAAA,EAIA,WAAY;AACV,OAAG,MACD,KAAK,UAAU,CAChB;AAAA,EACH;AACF;AAEA,IAAM,cAAc,CAAC;AAErB,WAAW,QAAQ,OAAO;AACxB,cAAY,IAAI,IAAI;AAAA,IAClB,MAAO;AACL,UAAI,SAAS,YAAY;AAGvB,aAAK,UAAU;AAAA,MACjB;AACA,aAAO,KAAK,KAAK,IAAI;AAAA,IACvB;AAAA,IACA,IAAK,KAAK;AACR,UAAI,SAAS,YAAY;AACvB,cAAM,IAAI,MAAM,uBAAuB;AAAA,MACzC;AACA,WAAK,KAAK,MAAM,GAAG;AAAA,IACrB;AAAA,EACF;AACF;AAEA,OAAO,iBAAiB,cAAc,WAAW,WAAW;AAG5D,IAAI,CAAC,eAAe,IAAI,cAAc,GAAG;AACvC,iBAAe,OAAO,gBAAgB,aAAa;AACrD;",
- "names": ["set", "keyPath", "res", "emoji", "version", "_", "result", "customEmojiIndex", "results", "currentMap", "MIN_SEARCH_TEXT_LENGTH", "uniqBy", "set", "DEFAULT_DATA_SOURCE", "DEFAULT_LOCALE"]
-}
diff --git a/node_modules/.vite/deps/js-chacha20.js b/node_modules/.vite/deps/js-chacha20.js
deleted file mode 100644
index 90ec6e5..0000000
--- a/node_modules/.vite/deps/js-chacha20.js
+++ /dev/null
@@ -1,177 +0,0 @@
-import {
- __commonJS
-} from "./chunk-HKJ2B2AA.js";
-
-// node_modules/js-chacha20/src/jschacha20.js
-var require_jschacha20 = __commonJS({
- "node_modules/js-chacha20/src/jschacha20.js"(exports, module) {
- var JSChaCha20 = function(key, nonce, counter) {
- if (typeof counter === "undefined") {
- counter = 0;
- }
- if (!(key instanceof Uint8Array) || key.length !== 32) {
- throw new Error("Key should be 32 byte array!");
- }
- if (!(nonce instanceof Uint8Array) || nonce.length !== 12) {
- throw new Error("Nonce should be 12 byte array!");
- }
- this._rounds = 20;
- this._sigma = [1634760805, 857760878, 2036477234, 1797285236];
- this._param = [
- this._sigma[0],
- this._sigma[1],
- this._sigma[2],
- this._sigma[3],
- // key
- this._get32(key, 0),
- this._get32(key, 4),
- this._get32(key, 8),
- this._get32(key, 12),
- this._get32(key, 16),
- this._get32(key, 20),
- this._get32(key, 24),
- this._get32(key, 28),
- // counter
- counter,
- // nonce
- this._get32(nonce, 0),
- this._get32(nonce, 4),
- this._get32(nonce, 8)
- ];
- this._keystream = [
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ];
- this._byteCounter = 0;
- };
- JSChaCha20.prototype._chacha = function() {
- var mix = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
- var i = 0;
- var b = 0;
- for (i = 0; i < 16; i++) {
- mix[i] = this._param[i];
- }
- for (i = 0; i < this._rounds; i += 2) {
- this._quarterround(mix, 0, 4, 8, 12);
- this._quarterround(mix, 1, 5, 9, 13);
- this._quarterround(mix, 2, 6, 10, 14);
- this._quarterround(mix, 3, 7, 11, 15);
- this._quarterround(mix, 0, 5, 10, 15);
- this._quarterround(mix, 1, 6, 11, 12);
- this._quarterround(mix, 2, 7, 8, 13);
- this._quarterround(mix, 3, 4, 9, 14);
- }
- for (i = 0; i < 16; i++) {
- mix[i] += this._param[i];
- this._keystream[b++] = mix[i] & 255;
- this._keystream[b++] = mix[i] >>> 8 & 255;
- this._keystream[b++] = mix[i] >>> 16 & 255;
- this._keystream[b++] = mix[i] >>> 24 & 255;
- }
- };
- JSChaCha20.prototype._quarterround = function(output, a, b, c, d) {
- output[d] = this._rotl(output[d] ^ (output[a] += output[b]), 16);
- output[b] = this._rotl(output[b] ^ (output[c] += output[d]), 12);
- output[d] = this._rotl(output[d] ^ (output[a] += output[b]), 8);
- output[b] = this._rotl(output[b] ^ (output[c] += output[d]), 7);
- output[a] >>>= 0;
- output[b] >>>= 0;
- output[c] >>>= 0;
- output[d] >>>= 0;
- };
- JSChaCha20.prototype._get32 = function(data, index) {
- return data[index++] ^ data[index++] << 8 ^ data[index++] << 16 ^ data[index] << 24;
- };
- JSChaCha20.prototype._rotl = function(data, shift) {
- return data << shift | data >>> 32 - shift;
- };
- JSChaCha20.prototype.encrypt = function(data) {
- return this._update(data);
- };
- JSChaCha20.prototype.decrypt = function(data) {
- return this._update(data);
- };
- JSChaCha20.prototype._update = function(data) {
- if (!(data instanceof Uint8Array) || data.length === 0) {
- throw new Error("Data should be type of bytes (Uint8Array) and not empty!");
- }
- var output = new Uint8Array(data.length);
- for (var i = 0; i < data.length; i++) {
- if (this._byteCounter === 0 || this._byteCounter === 64) {
- this._chacha();
- this._param[12]++;
- this._byteCounter = 0;
- }
- output[i] = data[i] ^ this._keystream[this._byteCounter++];
- }
- return output;
- };
- if (typeof module !== "undefined" && module.exports) {
- module.exports = JSChaCha20;
- }
- }
-});
-export default require_jschacha20();
-//# sourceMappingURL=js-chacha20.js.map
diff --git a/node_modules/.vite/deps/js-chacha20.js.map b/node_modules/.vite/deps/js-chacha20.js.map
deleted file mode 100644
index 7666e06..0000000
--- a/node_modules/.vite/deps/js-chacha20.js.map
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "version": 3,
- "sources": ["../../js-chacha20/src/jschacha20.js"],
- "sourcesContent": ["'use strict'\n/*\n * Copyright (c) 2017, Bubelich Mykola\n * https, 0x//www.bubelich.com\n *\n * (。◕‿‿◕。)\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met, 0x\n *\n * Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * ChaCha20 is a stream cipher designed by D. J. Bernstein.\n * It is a refinement of the Salsa20 algorithm, and it uses a 256-bit key.\n *\n * ChaCha20 successively calls the ChaCha20 block function, with the same key and nonce, and with successively increasing block counter parameters.\n * ChaCha20 then serializes the resulting state by writing the numbers in little-endian order, creating a keystream block.\n *\n * Concatenating the keystream blocks from the successive blocks forms a keystream.\n * The ChaCha20 function then performs an XOR of this keystream with the plaintext.\n * Alternatively, each keystream block can be XORed with a plaintext block before proceeding to create the next block, saving some memory.\n * There is no requirement for the plaintext to be an integral multiple of 512 bits. If there is extra keystream from the last block, it is discarded.\n *\n * The inputs to ChaCha20 are\n * - 256-bit key\n * - 32-bit initial counter\n * - 96-bit nonce. In some protocols, this is known as the Initialization Vector\n * - Arbitrary-length plaintext\n *\n * Implementation derived from chacha-ref.c version 20080118\n * See for details, 0x http, 0x//cr.yp.to/chacha/chacha-20080128.pdf\n */\n\n/**\n *\n * @param {Uint8Array} key\n * @param {Uint8Array} nonce\n * @param {number} counter\n * @throws {Error}\n *\n * @constructor\n */\nvar JSChaCha20 = function (key, nonce, counter) {\n if (typeof counter === 'undefined') {\n counter = 0\n }\n\n if (!(key instanceof Uint8Array) || key.length !== 32) {\n throw new Error('Key should be 32 byte array!')\n }\n\n if (!(nonce instanceof Uint8Array) || nonce.length !== 12) {\n throw new Error('Nonce should be 12 byte array!')\n }\n\n this._rounds = 20\n // Constants\n this._sigma = [0x61707865, 0x3320646e, 0x79622d32, 0x6b206574]\n\n // param construction\n this._param = [\n this._sigma[0],\n this._sigma[1],\n this._sigma[2],\n this._sigma[3],\n // key\n this._get32(key, 0),\n this._get32(key, 4),\n this._get32(key, 8),\n this._get32(key, 12),\n this._get32(key, 16),\n this._get32(key, 20),\n this._get32(key, 24),\n this._get32(key, 28),\n // counter\n counter,\n // nonce\n this._get32(nonce, 0),\n this._get32(nonce, 4),\n this._get32(nonce, 8)\n ]\n\n // init 64 byte keystream block //\n this._keystream = [\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n ]\n\n // internal byte counter //\n this._byteCounter = 0\n}\n\nJSChaCha20.prototype._chacha = function () {\n var mix = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n var i = 0\n var b = 0\n\n // copy param array to mix //\n for (i = 0; i < 16; i++) {\n mix[i] = this._param[i]\n }\n\n // mix rounds //\n for (i = 0; i < this._rounds; i += 2) {\n this._quarterround(mix, 0, 4, 8, 12)\n this._quarterround(mix, 1, 5, 9, 13)\n this._quarterround(mix, 2, 6, 10, 14)\n this._quarterround(mix, 3, 7, 11, 15)\n\n this._quarterround(mix, 0, 5, 10, 15)\n this._quarterround(mix, 1, 6, 11, 12)\n this._quarterround(mix, 2, 7, 8, 13)\n this._quarterround(mix, 3, 4, 9, 14)\n }\n\n for (i = 0; i < 16; i++) {\n // add\n mix[i] += this._param[i]\n\n // store keystream\n this._keystream[b++] = mix[i] & 0xFF\n this._keystream[b++] = (mix[i] >>> 8) & 0xFF\n this._keystream[b++] = (mix[i] >>> 16) & 0xFF\n this._keystream[b++] = (mix[i] >>> 24) & 0xFF\n }\n}\n\n/**\n * The basic operation of the ChaCha algorithm is the quarter round.\n * It operates on four 32-bit unsigned integers, denoted a, b, c, and d.\n *\n * @param {Array} output\n * @param {number} a\n * @param {number} b\n * @param {number} c\n * @param {number} d\n * @private\n */\nJSChaCha20.prototype._quarterround = function (output, a, b, c, d) {\n output[d] = this._rotl(output[d] ^ (output[a] += output[b]), 16)\n output[b] = this._rotl(output[b] ^ (output[c] += output[d]), 12)\n output[d] = this._rotl(output[d] ^ (output[a] += output[b]), 8)\n output[b] = this._rotl(output[b] ^ (output[c] += output[d]), 7)\n\n // JavaScript hack to make UINT32 :) //\n output[a] >>>= 0\n output[b] >>>= 0\n output[c] >>>= 0\n output[d] >>>= 0\n}\n\n/**\n * Little-endian to uint 32 bytes\n *\n * @param {Uint8Array|[number]} data\n * @param {number} index\n * @return {number}\n * @private\n */\nJSChaCha20.prototype._get32 = function (data, index) {\n return data[index++] ^ (data[index++] << 8) ^ (data[index++] << 16) ^ (data[index] << 24)\n}\n\n/**\n * Cyclic left rotation\n *\n * @param {number} data\n * @param {number} shift\n * @return {number}\n * @private\n */\nJSChaCha20.prototype._rotl = function (data, shift) {\n return ((data << shift) | (data >>> (32 - shift)))\n}\n\n/**\n * Encrypt data with key and nonce\n *\n * @param {Uint8Array} data\n * @return {Uint8Array}\n */\nJSChaCha20.prototype.encrypt = function (data) {\n return this._update(data)\n}\n\n/**\n * Decrypt data with key and nonce\n *\n * @param {Uint8Array} data\n * @return {Uint8Array}\n */\nJSChaCha20.prototype.decrypt = function (data) {\n return this._update(data)\n}\n\n/**\n * Encrypt or Decrypt data with key and nonce\n *\n * @param {Uint8Array} data\n * @return {Uint8Array}\n * @private\n */\nJSChaCha20.prototype._update = function (data) {\n if (!(data instanceof Uint8Array) || data.length === 0) {\n throw new Error('Data should be type of bytes (Uint8Array) and not empty!')\n }\n\n var output = new Uint8Array(data.length)\n\n // core function, build block and xor with input data //\n for (var i = 0; i < data.length; i++) {\n if (this._byteCounter === 0 || this._byteCounter === 64) {\n // generate new block //\n\n this._chacha()\n // counter increment //\n this._param[12]++\n\n // reset internal counter //\n this._byteCounter = 0\n }\n\n output[i] = data[i] ^ this._keystream[this._byteCounter++]\n }\n\n return output\n}\n\n// EXPORT //\nif (typeof module !== 'undefined' && module.exports) {\n module.exports = JSChaCha20\n}\n"],
- "mappings": ";;;;;AAAA;AAAA;AAiEA,QAAI,aAAa,SAAU,KAAK,OAAO,SAAS;AAC9C,UAAI,OAAO,YAAY,aAAa;AAClC,kBAAU;AAAA,MACZ;AAEA,UAAI,EAAE,eAAe,eAAe,IAAI,W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,EAAE,gBAAgB,eAAe,KAAK,WAAW,GAAG;AACtD,cAAM,IAAI,MAAM,0DAA0D;AAAA,MAC5E;AAEA,UAAI,SAAS,IAAI,WAAW,KAAK,MAAM;AAGvC,eAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAI,KAAK,iBAAiB,KAAK,KAAK,iBAAiB,IAAI;AAGvD,eAAK,QAAQ;AAEb,eAAK,OAAO,EAAE;AAGd,eAAK,eAAe;AAAA,QACtB;AAEA,eAAO,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,KAAK,cAAc;AAAA,MAC3D;AAEA,aAAO;AAAA,IACT;AAGA,QAAI,OAAO,WAAW,eAAe,OAAO,SAAS;AACnD,aAAO,UAAU;AAAA,IACnB;AAAA;AAAA;",
- "names": []
-}
diff --git a/node_modules/.vite/deps/js-sha256.js b/node_modules/.vite/deps/js-sha256.js
deleted file mode 100644
index e070513..0000000
--- a/node_modules/.vite/deps/js-sha256.js
+++ /dev/null
@@ -1,539 +0,0 @@
-import {
- require_buffer,
- require_crypto
-} from "./chunk-LNRWHUEM.js";
-import {
- __commonJS
-} from "./chunk-HKJ2B2AA.js";
-
-// node_modules/js-sha256/src/sha256.js
-var require_sha256 = __commonJS({
- "node_modules/js-sha256/src/sha256.js"(exports, module) {
- (function() {
- "use strict";
- var ERROR = "input is invalid type";
- var WINDOW = typeof window === "object";
- var root = WINDOW ? window : {};
- if (root.JS_SHA256_NO_WINDOW) {
- WINDOW = false;
- }
- var WEB_WORKER = !WINDOW && typeof self === "object";
- var NODE_JS = !root.JS_SHA256_NO_NODE_JS && typeof process === "object" && process.versions && process.versions.node;
- if (NODE_JS) {
- root = global;
- } else if (WEB_WORKER) {
- root = self;
- }
- var COMMON_JS = !root.JS_SHA256_NO_COMMON_JS && typeof module === "object" && module.exports;
- var AMD = typeof define === "function" && define.amd;
- var ARRAY_BUFFER = !root.JS_SHA256_NO_ARRAY_BUFFER && typeof ArrayBuffer !== "undefined";
- var HEX_CHARS = "0123456789abcdef".split("");
- var EXTRA = [-2147483648, 8388608, 32768, 128];
- var SHIFT = [24, 16, 8, 0];
- var K = [
- 1116352408,
- 1899447441,
- 3049323471,
- 3921009573,
- 961987163,
- 1508970993,
- 2453635748,
- 2870763221,
- 3624381080,
- 310598401,
- 607225278,
- 1426881987,
- 1925078388,
- 2162078206,
- 2614888103,
- 3248222580,
- 3835390401,
- 4022224774,
- 264347078,
- 604807628,
- 770255983,
- 1249150122,
- 1555081692,
- 1996064986,
- 2554220882,
- 2821834349,
- 2952996808,
- 3210313671,
- 3336571891,
- 3584528711,
- 113926993,
- 338241895,
- 666307205,
- 773529912,
- 1294757372,
- 1396182291,
- 1695183700,
- 1986661051,
- 2177026350,
- 2456956037,
- 2730485921,
- 2820302411,
- 3259730800,
- 3345764771,
- 3516065817,
- 3600352804,
- 4094571909,
- 275423344,
- 430227734,
- 506948616,
- 659060556,
- 883997877,
- 958139571,
- 1322822218,
- 1537002063,
- 1747873779,
- 1955562222,
- 2024104815,
- 2227730452,
- 2361852424,
- 2428436474,
- 2756734187,
- 3204031479,
- 3329325298
- ];
- var OUTPUT_TYPES = ["hex", "array", "digest", "arrayBuffer"];
- var blocks = [];
- if (root.JS_SHA256_NO_NODE_JS || !Array.isArray) {
- Array.isArray = function(obj) {
- return Object.prototype.toString.call(obj) === "[object Array]";
- };
- }
- if (ARRAY_BUFFER && (root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {
- ArrayBuffer.isView = function(obj) {
- return typeof obj === "object" && obj.buffer && obj.buffer.constructor === ArrayBuffer;
- };
- }
- var createOutputMethod = function(outputType, is224) {
- return function(message) {
- return new Sha256(is224, true).update(message)[outputType]();
- };
- };
- var createMethod = function(is224) {
- var method = createOutputMethod("hex", is224);
- if (NODE_JS) {
- method = nodeWrap(method, is224);
- }
- method.create = function() {
- return new Sha256(is224);
- };
- method.update = function(message) {
- return method.create().update(message);
- };
- for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
- var type = OUTPUT_TYPES[i];
- method[type] = createOutputMethod(type, is224);
- }
- return method;
- };
- var nodeWrap = function(method, is224) {
- var crypto = require_crypto();
- var Buffer = require_buffer().Buffer;
- var algorithm = is224 ? "sha224" : "sha256";
- var bufferFrom;
- if (Buffer.from && !root.JS_SHA256_NO_BUFFER_FROM) {
- bufferFrom = Buffer.from;
- } else {
- bufferFrom = function(message) {
- return new Buffer(message);
- };
- }
- var nodeMethod = function(message) {
- if (typeof message === "string") {
- return crypto.createHash(algorithm).update(message, "utf8").digest("hex");
- } else {
- if (message === null || message === void 0) {
- throw new Error(ERROR);
- } else if (message.constructor === ArrayBuffer) {
- message = new Uint8Array(message);
- }
- }
- if (Array.isArray(message) || ArrayBuffer.isView(message) || message.constructor === Buffer) {
- return crypto.createHash(algorithm).update(bufferFrom(message)).digest("hex");
- } else {
- return method(message);
- }
- };
- return nodeMethod;
- };
- var createHmacOutputMethod = function(outputType, is224) {
- return function(key, message) {
- return new HmacSha256(key, is224, true).update(message)[outputType]();
- };
- };
- var createHmacMethod = function(is224) {
- var method = createHmacOutputMethod("hex", is224);
- method.create = function(key) {
- return new HmacSha256(key, is224);
- };
- method.update = function(key, message) {
- return method.create(key).update(message);
- };
- for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
- var type = OUTPUT_TYPES[i];
- method[type] = createHmacOutputMethod(type, is224);
- }
- return method;
- };
- function Sha256(is224, sharedMemory) {
- if (sharedMemory) {
- blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
- this.blocks = blocks;
- } else {
- this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
- }
- if (is224) {
- this.h0 = 3238371032;
- this.h1 = 914150663;
- this.h2 = 812702999;
- this.h3 = 4144912697;
- this.h4 = 4290775857;
- this.h5 = 1750603025;
- this.h6 = 1694076839;
- this.h7 = 3204075428;
- } else {
- this.h0 = 1779033703;
- this.h1 = 3144134277;
- this.h2 = 1013904242;
- this.h3 = 2773480762;
- this.h4 = 1359893119;
- this.h5 = 2600822924;
- this.h6 = 528734635;
- this.h7 = 1541459225;
- }
- this.block = this.start = this.bytes = this.hBytes = 0;
- this.finalized = this.hashed = false;
- this.first = true;
- this.is224 = is224;
- }
- Sha256.prototype.update = function(message) {
- if (this.finalized) {
- return;
- }
- var notString, type = typeof message;
- if (type !== "string") {
- if (type === "object") {
- if (message === null) {
- throw new Error(ERROR);
- } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {
- message = new Uint8Array(message);
- } else if (!Array.isArray(message)) {
- if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) {
- throw new Error(ERROR);
- }
- }
- } else {
- throw new Error(ERROR);
- }
- notString = true;
- }
- var code, index = 0, i, length = message.length, blocks2 = this.blocks;
- while (index < length) {
- if (this.hashed) {
- this.hashed = false;
- blocks2[0] = this.block;
- this.block = blocks2[16] = blocks2[1] = blocks2[2] = blocks2[3] = blocks2[4] = blocks2[5] = blocks2[6] = blocks2[7] = blocks2[8] = blocks2[9] = blocks2[10] = blocks2[11] = blocks2[12] = blocks2[13] = blocks2[14] = blocks2[15] = 0;
- }
- if (notString) {
- for (i = this.start; index < length && i < 64; ++index) {
- blocks2[i >>> 2] |= message[index] << SHIFT[i++ & 3];
- }
- } else {
- for (i = this.start; index < length && i < 64; ++index) {
- code = message.charCodeAt(index);
- if (code < 128) {
- blocks2[i >>> 2] |= code << SHIFT[i++ & 3];
- } else if (code < 2048) {
- blocks2[i >>> 2] |= (192 | code >>> 6) << SHIFT[i++ & 3];
- blocks2[i >>> 2] |= (128 | code & 63) << SHIFT[i++ & 3];
- } else if (code < 55296 || code >= 57344) {
- blocks2[i >>> 2] |= (224 | code >>> 12) << SHIFT[i++ & 3];
- blocks2[i >>> 2] |= (128 | code >>> 6 & 63) << SHIFT[i++ & 3];
- blocks2[i >>> 2] |= (128 | code & 63) << SHIFT[i++ & 3];
- } else {
- code = 65536 + ((code & 1023) << 10 | message.charCodeAt(++index) & 1023);
- blocks2[i >>> 2] |= (240 | code >>> 18) << SHIFT[i++ & 3];
- blocks2[i >>> 2] |= (128 | code >>> 12 & 63) << SHIFT[i++ & 3];
- blocks2[i >>> 2] |= (128 | code >>> 6 & 63) << SHIFT[i++ & 3];
- blocks2[i >>> 2] |= (128 | code & 63) << SHIFT[i++ & 3];
- }
- }
- }
- this.lastByteIndex = i;
- this.bytes += i - this.start;
- if (i >= 64) {
- this.block = blocks2[16];
- this.start = i - 64;
- this.hash();
- this.hashed = true;
- } else {
- this.start = i;
- }
- }
- if (this.bytes > 4294967295) {
- this.hBytes += this.bytes / 4294967296 << 0;
- this.bytes = this.bytes % 4294967296;
- }
- return this;
- };
- Sha256.prototype.finalize = function() {
- if (this.finalized) {
- return;
- }
- this.finalized = true;
- var blocks2 = this.blocks, i = this.lastByteIndex;
- blocks2[16] = this.block;
- blocks2[i >>> 2] |= EXTRA[i & 3];
- this.block = blocks2[16];
- if (i >= 56) {
- if (!this.hashed) {
- this.hash();
- }
- blocks2[0] = this.block;
- blocks2[16] = blocks2[1] = blocks2[2] = blocks2[3] = blocks2[4] = blocks2[5] = blocks2[6] = blocks2[7] = blocks2[8] = blocks2[9] = blocks2[10] = blocks2[11] = blocks2[12] = blocks2[13] = blocks2[14] = blocks2[15] = 0;
- }
- blocks2[14] = this.hBytes << 3 | this.bytes >>> 29;
- blocks2[15] = this.bytes << 3;
- this.hash();
- };
- Sha256.prototype.hash = function() {
- var a = this.h0, b = this.h1, c = this.h2, d = this.h3, e = this.h4, f = this.h5, g = this.h6, h = this.h7, blocks2 = this.blocks, j, s0, s1, maj, t1, t2, ch, ab, da, cd, bc;
- for (j = 16; j < 64; ++j) {
- t1 = blocks2[j - 15];
- s0 = (t1 >>> 7 | t1 << 25) ^ (t1 >>> 18 | t1 << 14) ^ t1 >>> 3;
- t1 = blocks2[j - 2];
- s1 = (t1 >>> 17 | t1 << 15) ^ (t1 >>> 19 | t1 << 13) ^ t1 >>> 10;
- blocks2[j] = blocks2[j - 16] + s0 + blocks2[j - 7] + s1 << 0;
- }
- bc = b & c;
- for (j = 0; j < 64; j += 4) {
- if (this.first) {
- if (this.is224) {
- ab = 300032;
- t1 = blocks2[0] - 1413257819;
- h = t1 - 150054599 << 0;
- d = t1 + 24177077 << 0;
- } else {
- ab = 704751109;
- t1 = blocks2[0] - 210244248;
- h = t1 - 1521486534 << 0;
- d = t1 + 143694565 << 0;
- }
- this.first = false;
- } else {
- s0 = (a >>> 2 | a << 30) ^ (a >>> 13 | a << 19) ^ (a >>> 22 | a << 10);
- s1 = (e >>> 6 | e << 26) ^ (e >>> 11 | e << 21) ^ (e >>> 25 | e << 7);
- ab = a & b;
- maj = ab ^ a & c ^ bc;
- ch = e & f ^ ~e & g;
- t1 = h + s1 + ch + K[j] + blocks2[j];
- t2 = s0 + maj;
- h = d + t1 << 0;
- d = t1 + t2 << 0;
- }
- s0 = (d >>> 2 | d << 30) ^ (d >>> 13 | d << 19) ^ (d >>> 22 | d << 10);
- s1 = (h >>> 6 | h << 26) ^ (h >>> 11 | h << 21) ^ (h >>> 25 | h << 7);
- da = d & a;
- maj = da ^ d & b ^ ab;
- ch = h & e ^ ~h & f;
- t1 = g + s1 + ch + K[j + 1] + blocks2[j + 1];
- t2 = s0 + maj;
- g = c + t1 << 0;
- c = t1 + t2 << 0;
- s0 = (c >>> 2 | c << 30) ^ (c >>> 13 | c << 19) ^ (c >>> 22 | c << 10);
- s1 = (g >>> 6 | g << 26) ^ (g >>> 11 | g << 21) ^ (g >>> 25 | g << 7);
- cd = c & d;
- maj = cd ^ c & a ^ da;
- ch = g & h ^ ~g & e;
- t1 = f + s1 + ch + K[j + 2] + blocks2[j + 2];
- t2 = s0 + maj;
- f = b + t1 << 0;
- b = t1 + t2 << 0;
- s0 = (b >>> 2 | b << 30) ^ (b >>> 13 | b << 19) ^ (b >>> 22 | b << 10);
- s1 = (f >>> 6 | f << 26) ^ (f >>> 11 | f << 21) ^ (f >>> 25 | f << 7);
- bc = b & c;
- maj = bc ^ b & d ^ cd;
- ch = f & g ^ ~f & h;
- t1 = e + s1 + ch + K[j + 3] + blocks2[j + 3];
- t2 = s0 + maj;
- e = a + t1 << 0;
- a = t1 + t2 << 0;
- this.chromeBugWorkAround = true;
- }
- this.h0 = this.h0 + a << 0;
- this.h1 = this.h1 + b << 0;
- this.h2 = this.h2 + c << 0;
- this.h3 = this.h3 + d << 0;
- this.h4 = this.h4 + e << 0;
- this.h5 = this.h5 + f << 0;
- this.h6 = this.h6 + g << 0;
- this.h7 = this.h7 + h << 0;
- };
- Sha256.prototype.hex = function() {
- this.finalize();
- var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4, h5 = this.h5, h6 = this.h6, h7 = this.h7;
- var hex = HEX_CHARS[h0 >>> 28 & 15] + HEX_CHARS[h0 >>> 24 & 15] + HEX_CHARS[h0 >>> 20 & 15] + HEX_CHARS[h0 >>> 16 & 15] + HEX_CHARS[h0 >>> 12 & 15] + HEX_CHARS[h0 >>> 8 & 15] + HEX_CHARS[h0 >>> 4 & 15] + HEX_CHARS[h0 & 15] + HEX_CHARS[h1 >>> 28 & 15] + HEX_CHARS[h1 >>> 24 & 15] + HEX_CHARS[h1 >>> 20 & 15] + HEX_CHARS[h1 >>> 16 & 15] + HEX_CHARS[h1 >>> 12 & 15] + HEX_CHARS[h1 >>> 8 & 15] + HEX_CHARS[h1 >>> 4 & 15] + HEX_CHARS[h1 & 15] + HEX_CHARS[h2 >>> 28 & 15] + HEX_CHARS[h2 >>> 24 & 15] + HEX_CHARS[h2 >>> 20 & 15] + HEX_CHARS[h2 >>> 16 & 15] + HEX_CHARS[h2 >>> 12 & 15] + HEX_CHARS[h2 >>> 8 & 15] + HEX_CHARS[h2 >>> 4 & 15] + HEX_CHARS[h2 & 15] + HEX_CHARS[h3 >>> 28 & 15] + HEX_CHARS[h3 >>> 24 & 15] + HEX_CHARS[h3 >>> 20 & 15] + HEX_CHARS[h3 >>> 16 & 15] + HEX_CHARS[h3 >>> 12 & 15] + HEX_CHARS[h3 >>> 8 & 15] + HEX_CHARS[h3 >>> 4 & 15] + HEX_CHARS[h3 & 15] + HEX_CHARS[h4 >>> 28 & 15] + HEX_CHARS[h4 >>> 24 & 15] + HEX_CHARS[h4 >>> 20 & 15] + HEX_CHARS[h4 >>> 16 & 15] + HEX_CHARS[h4 >>> 12 & 15] + HEX_CHARS[h4 >>> 8 & 15] + HEX_CHARS[h4 >>> 4 & 15] + HEX_CHARS[h4 & 15] + HEX_CHARS[h5 >>> 28 & 15] + HEX_CHARS[h5 >>> 24 & 15] + HEX_CHARS[h5 >>> 20 & 15] + HEX_CHARS[h5 >>> 16 & 15] + HEX_CHARS[h5 >>> 12 & 15] + HEX_CHARS[h5 >>> 8 & 15] + HEX_CHARS[h5 >>> 4 & 15] + HEX_CHARS[h5 & 15] + HEX_CHARS[h6 >>> 28 & 15] + HEX_CHARS[h6 >>> 24 & 15] + HEX_CHARS[h6 >>> 20 & 15] + HEX_CHARS[h6 >>> 16 & 15] + HEX_CHARS[h6 >>> 12 & 15] + HEX_CHARS[h6 >>> 8 & 15] + HEX_CHARS[h6 >>> 4 & 15] + HEX_CHARS[h6 & 15];
- if (!this.is224) {
- hex += HEX_CHARS[h7 >>> 28 & 15] + HEX_CHARS[h7 >>> 24 & 15] + HEX_CHARS[h7 >>> 20 & 15] + HEX_CHARS[h7 >>> 16 & 15] + HEX_CHARS[h7 >>> 12 & 15] + HEX_CHARS[h7 >>> 8 & 15] + HEX_CHARS[h7 >>> 4 & 15] + HEX_CHARS[h7 & 15];
- }
- return hex;
- };
- Sha256.prototype.toString = Sha256.prototype.hex;
- Sha256.prototype.digest = function() {
- this.finalize();
- var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4, h5 = this.h5, h6 = this.h6, h7 = this.h7;
- var arr = [
- h0 >>> 24 & 255,
- h0 >>> 16 & 255,
- h0 >>> 8 & 255,
- h0 & 255,
- h1 >>> 24 & 255,
- h1 >>> 16 & 255,
- h1 >>> 8 & 255,
- h1 & 255,
- h2 >>> 24 & 255,
- h2 >>> 16 & 255,
- h2 >>> 8 & 255,
- h2 & 255,
- h3 >>> 24 & 255,
- h3 >>> 16 & 255,
- h3 >>> 8 & 255,
- h3 & 255,
- h4 >>> 24 & 255,
- h4 >>> 16 & 255,
- h4 >>> 8 & 255,
- h4 & 255,
- h5 >>> 24 & 255,
- h5 >>> 16 & 255,
- h5 >>> 8 & 255,
- h5 & 255,
- h6 >>> 24 & 255,
- h6 >>> 16 & 255,
- h6 >>> 8 & 255,
- h6 & 255
- ];
- if (!this.is224) {
- arr.push(h7 >>> 24 & 255, h7 >>> 16 & 255, h7 >>> 8 & 255, h7 & 255);
- }
- return arr;
- };
- Sha256.prototype.array = Sha256.prototype.digest;
- Sha256.prototype.arrayBuffer = function() {
- this.finalize();
- var buffer = new ArrayBuffer(this.is224 ? 28 : 32);
- var dataView = new DataView(buffer);
- dataView.setUint32(0, this.h0);
- dataView.setUint32(4, this.h1);
- dataView.setUint32(8, this.h2);
- dataView.setUint32(12, this.h3);
- dataView.setUint32(16, this.h4);
- dataView.setUint32(20, this.h5);
- dataView.setUint32(24, this.h6);
- if (!this.is224) {
- dataView.setUint32(28, this.h7);
- }
- return buffer;
- };
- function HmacSha256(key, is224, sharedMemory) {
- var i, type = typeof key;
- if (type === "string") {
- var bytes = [], length = key.length, index = 0, code;
- for (i = 0; i < length; ++i) {
- code = key.charCodeAt(i);
- if (code < 128) {
- bytes[index++] = code;
- } else if (code < 2048) {
- bytes[index++] = 192 | code >>> 6;
- bytes[index++] = 128 | code & 63;
- } else if (code < 55296 || code >= 57344) {
- bytes[index++] = 224 | code >>> 12;
- bytes[index++] = 128 | code >>> 6 & 63;
- bytes[index++] = 128 | code & 63;
- } else {
- code = 65536 + ((code & 1023) << 10 | key.charCodeAt(++i) & 1023);
- bytes[index++] = 240 | code >>> 18;
- bytes[index++] = 128 | code >>> 12 & 63;
- bytes[index++] = 128 | code >>> 6 & 63;
- bytes[index++] = 128 | code & 63;
- }
- }
- key = bytes;
- } else {
- if (type === "object") {
- if (key === null) {
- throw new Error(ERROR);
- } else if (ARRAY_BUFFER && key.constructor === ArrayBuffer) {
- key = new Uint8Array(key);
- } else if (!Array.isArray(key)) {
- if (!ARRAY_BUFFER || !ArrayBuffer.isView(key)) {
- throw new Error(ERROR);
- }
- }
- } else {
- throw new Error(ERROR);
- }
- }
- if (key.length > 64) {
- key = new Sha256(is224, true).update(key).array();
- }
- var oKeyPad = [], iKeyPad = [];
- for (i = 0; i < 64; ++i) {
- var b = key[i] || 0;
- oKeyPad[i] = 92 ^ b;
- iKeyPad[i] = 54 ^ b;
- }
- Sha256.call(this, is224, sharedMemory);
- this.update(iKeyPad);
- this.oKeyPad = oKeyPad;
- this.inner = true;
- this.sharedMemory = sharedMemory;
- }
- HmacSha256.prototype = new Sha256();
- HmacSha256.prototype.finalize = function() {
- Sha256.prototype.finalize.call(this);
- if (this.inner) {
- this.inner = false;
- var innerHash = this.array();
- Sha256.call(this, this.is224, this.sharedMemory);
- this.update(this.oKeyPad);
- this.update(innerHash);
- Sha256.prototype.finalize.call(this);
- }
- };
- var exports2 = createMethod();
- exports2.sha256 = exports2;
- exports2.sha224 = createMethod(true);
- exports2.sha256.hmac = createHmacMethod();
- exports2.sha224.hmac = createHmacMethod(true);
- if (COMMON_JS) {
- module.exports = exports2;
- } else {
- root.sha256 = exports2.sha256;
- root.sha224 = exports2.sha224;
- if (AMD) {
- define(function() {
- return exports2;
- });
- }
- }
- })();
- }
-});
-export default require_sha256();
-/*! Bundled license information:
-
-js-sha256/src/sha256.js:
- (**
- * [js-sha256]{@link https://github.com/emn178/js-sha256}
- *
- * @version 0.11.0
- * @author Chen, Yi-Cyuan [emn178@gmail.com]
- * @copyright Chen, Yi-Cyuan 2014-2024
- * @license MIT
- *)
-*/
-//# sourceMappingURL=js-sha256.js.map
diff --git a/node_modules/.vite/deps/js-sha256.js.map b/node_modules/.vite/deps/js-sha256.js.map
deleted file mode 100644
index 248f3ca..0000000
--- a/node_modules/.vite/deps/js-sha256.js.map
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "version": 3,
- "sources": ["../../js-sha256/src/sha256.js"],
- "sourcesContent": ["/**\n * [js-sha256]{@link https://github.com/emn178/js-sha256}\n *\n * @version 0.11.0\n * @author Chen, Yi-Cyuan [emn178@gmail.com]\n * @copyright Chen, Yi-Cyuan 2014-2024\n * @license MIT\n */\n/*jslint bitwise: true */\n(function () {\n 'use strict';\n\n var ERROR = 'input is invalid type';\n var WINDOW = typeof window === 'object';\n var root = WINDOW ? window : {};\n if (root.JS_SHA256_NO_WINDOW) {\n WINDOW = false;\n }\n var WEB_WORKER = !WINDOW && typeof self === 'object';\n var NODE_JS = !root.JS_SHA256_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;\n if (NODE_JS) {\n root = global;\n } else if (WEB_WORKER) {\n root = self;\n }\n var COMMON_JS = !root.JS_SHA256_NO_COMMON_JS && typeof module === 'object' && module.exports;\n var AMD = typeof define === 'function' && define.amd;\n var ARRAY_BUFFER = !root.JS_SHA256_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined';\n var HEX_CHARS = '0123456789abcdef'.split('');\n var EXTRA = [-2147483648, 8388608, 32768, 128];\n var SHIFT = [24, 16, 8, 0];\n var K = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n ];\n var OUTPUT_TYPES = ['hex', 'array', 'digest', 'arrayBuffer'];\n\n var blocks = [];\n\n if (root.JS_SHA256_NO_NODE_JS || !Array.isArray) {\n Array.isArray = function (obj) {\n return Object.prototype.toString.call(obj) === '[object Array]';\n };\n }\n\n if (ARRAY_BUFFER && (root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {\n ArrayBuffer.isView = function (obj) {\n return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer;\n };\n }\n\n var createOutputMethod = function (outputType, is224) {\n return function (message) {\n return new Sha256(is224, true).update(message)[outputType]();\n };\n };\n\n var createMethod = function (is224) {\n var method = createOutputMethod('hex', is224);\n if (NODE_JS) {\n method = nodeWrap(method, is224);\n }\n method.create = function () {\n return new Sha256(is224);\n };\n method.update = function (message) {\n return method.create().update(message);\n };\n for (var i = 0; i < OUTPUT_TYPES.length; ++i) {\n var type = OUTPUT_TYPES[i];\n method[type] = createOutputMethod(type, is224);\n }\n return method;\n };\n\n var nodeWrap = function (method, is224) {\n var crypto = require('crypto')\n var Buffer = require('buffer').Buffer;\n var algorithm = is224 ? 'sha224' : 'sha256';\n var bufferFrom;\n if (Buffer.from && !root.JS_SHA256_NO_BUFFER_FROM) {\n bufferFrom = Buffer.from;\n } else {\n bufferFrom = function (message) {\n return new Buffer(message);\n };\n }\n var nodeMethod = function (message) {\n if (typeof message === 'string') {\n return crypto.createHash(algorithm).update(message, 'utf8').digest('hex');\n } else {\n if (message === null || message === undefined) {\n throw new Error(ERROR);\n } else if (message.constructor === ArrayBuffer) {\n message = new Uint8Array(message);\n }\n }\n if (Array.isArray(message) || ArrayBuffer.isView(message) ||\n message.constructor === Buffer) {\n return crypto.createHash(algorithm).update(bufferFrom(message)).digest('hex');\n } else {\n return method(message);\n }\n };\n return nodeMethod;\n };\n\n var createHmacOutputMethod = function (outputType, is224) {\n return function (key, message) {\n return new HmacSha256(key, is224, true).update(message)[outputType]();\n };\n };\n\n var createHmacMethod = function (is224) {\n var method = createHmacOutputMethod('hex', is224);\n method.create = function (key) {\n return new HmacSha256(key, is224);\n };\n method.update = function (key, message) {\n return method.create(key).update(message);\n };\n for (var i = 0; i < OUTPUT_TYPES.length; ++i) {\n var type = OUTPUT_TYPES[i];\n method[type] = createHmacOutputMethod(type, is224);\n }\n return method;\n };\n\n function Sha256(is224, sharedMemory) {\n if (sharedMemory) {\n blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] =\n blocks[4] = blocks[5] = blocks[6] = blocks[7] =\n blocks[8] = blocks[9] = blocks[10] = blocks[11] =\n blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;\n this.blocks = blocks;\n } else {\n this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n }\n\n if (is224) {\n this.h0 = 0xc1059ed8;\n this.h1 = 0x367cd507;\n this.h2 = 0x3070dd17;\n this.h3 = 0xf70e5939;\n this.h4 = 0xffc00b31;\n this.h5 = 0x68581511;\n this.h6 = 0x64f98fa7;\n this.h7 = 0xbefa4fa4;\n } else { // 256\n this.h0 = 0x6a09e667;\n this.h1 = 0xbb67ae85;\n this.h2 = 0x3c6ef372;\n this.h3 = 0xa54ff53a;\n this.h4 = 0x510e527f;\n this.h5 = 0x9b05688c;\n this.h6 = 0x1f83d9ab;\n this.h7 = 0x5be0cd19;\n }\n\n this.block = this.start = this.bytes = this.hBytes = 0;\n this.finalized = this.hashed = false;\n this.first = true;\n this.is224 = is224;\n }\n\n Sha256.prototype.update = function (message) {\n if (this.finalized) {\n return;\n }\n var notString, type = typeof message;\n if (type !== 'string') {\n if (type === 'object') {\n if (message === null) {\n throw new Error(ERROR);\n } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {\n message = new Uint8Array(message);\n } else if (!Array.isArray(message)) {\n if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) {\n throw new Error(ERROR);\n }\n }\n } else {\n throw new Error(ERROR);\n }\n notString = true;\n }\n var code, index = 0, i, length = message.length, blocks = this.blocks;\n while (index < length) {\n if (this.hashed) {\n this.hashed = false;\n blocks[0] = this.block;\n this.block = blocks[16] = blocks[1] = blocks[2] = blocks[3] =\n blocks[4] = blocks[5] = blocks[6] = blocks[7] =\n blocks[8] = blocks[9] = blocks[10] = blocks[11] =\n blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;\n }\n\n if (notString) {\n for (i = this.start; index < length && i < 64; ++index) {\n blocks[i >>> 2] |= message[index] << SHIFT[i++ & 3];\n }\n } else {\n for (i = this.start; index < length && i < 64; ++index) {\n code = message.charCodeAt(index);\n if (code < 0x80) {\n blocks[i >>> 2] |= code << SHIFT[i++ & 3];\n } else if (code < 0x800) {\n blocks[i >>> 2] |= (0xc0 | (code >>> 6)) << SHIFT[i++ & 3];\n blocks[i >>> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else if (code < 0xd800 || code >= 0xe000) {\n blocks[i >>> 2] |= (0xe0 | (code >>> 12)) << SHIFT[i++ & 3];\n blocks[i >>> 2] |= (0x80 | ((code >>> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >>> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));\n blocks[i >>> 2] |= (0xf0 | (code >>> 18)) << SHIFT[i++ & 3];\n blocks[i >>> 2] |= (0x80 | ((code >>> 12) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >>> 2] |= (0x80 | ((code >>> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >>> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n }\n }\n }\n\n this.lastByteIndex = i;\n this.bytes += i - this.start;\n if (i >= 64) {\n this.block = blocks[16];\n this.start = i - 64;\n this.hash();\n this.hashed = true;\n } else {\n this.start = i;\n }\n }\n if (this.bytes > 4294967295) {\n this.hBytes += this.bytes / 4294967296 << 0;\n this.bytes = this.bytes % 4294967296;\n }\n return this;\n };\n\n Sha256.prototype.finalize = function () {\n if (this.finalized) {\n return;\n }\n this.finalized = true;\n var blocks = this.blocks, i = this.lastByteIndex;\n blocks[16] = this.block;\n blocks[i >>> 2] |= EXTRA[i & 3];\n this.block = blocks[16];\n if (i >= 56) {\n if (!this.hashed) {\n this.hash();\n }\n blocks[0] = this.block;\n blocks[16] = blocks[1] = blocks[2] = blocks[3] =\n blocks[4] = blocks[5] = blocks[6] = blocks[7] =\n blocks[8] = blocks[9] = blocks[10] = blocks[11] =\n blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;\n }\n blocks[14] = this.hBytes << 3 | this.bytes >>> 29;\n blocks[15] = this.bytes << 3;\n this.hash();\n };\n\n Sha256.prototype.hash = function () {\n var a = this.h0, b = this.h1, c = this.h2, d = this.h3, e = this.h4, f = this.h5, g = this.h6,\n h = this.h7, blocks = this.blocks, j, s0, s1, maj, t1, t2, ch, ab, da, cd, bc;\n\n for (j = 16; j < 64; ++j) {\n // rightrotate\n t1 = blocks[j - 15];\n s0 = ((t1 >>> 7) | (t1 << 25)) ^ ((t1 >>> 18) | (t1 << 14)) ^ (t1 >>> 3);\n t1 = blocks[j - 2];\n s1 = ((t1 >>> 17) | (t1 << 15)) ^ ((t1 >>> 19) | (t1 << 13)) ^ (t1 >>> 10);\n blocks[j] = blocks[j - 16] + s0 + blocks[j - 7] + s1 << 0;\n }\n\n bc = b & c;\n for (j = 0; j < 64; j += 4) {\n if (this.first) {\n if (this.is224) {\n ab = 300032;\n t1 = blocks[0] - 1413257819;\n h = t1 - 150054599 << 0;\n d = t1 + 24177077 << 0;\n } else {\n ab = 704751109;\n t1 = blocks[0] - 210244248;\n h = t1 - 1521486534 << 0;\n d = t1 + 143694565 << 0;\n }\n this.first = false;\n } else {\n s0 = ((a >>> 2) | (a << 30)) ^ ((a >>> 13) | (a << 19)) ^ ((a >>> 22) | (a << 10));\n s1 = ((e >>> 6) | (e << 26)) ^ ((e >>> 11) | (e << 21)) ^ ((e >>> 25) | (e << 7));\n ab = a & b;\n maj = ab ^ (a & c) ^ bc;\n ch = (e & f) ^ (~e & g);\n t1 = h + s1 + ch + K[j] + blocks[j];\n t2 = s0 + maj;\n h = d + t1 << 0;\n d = t1 + t2 << 0;\n }\n s0 = ((d >>> 2) | (d << 30)) ^ ((d >>> 13) | (d << 19)) ^ ((d >>> 22) | (d << 10));\n s1 = ((h >>> 6) | (h << 26)) ^ ((h >>> 11) | (h << 21)) ^ ((h >>> 25) | (h << 7));\n da = d & a;\n maj = da ^ (d & b) ^ ab;\n ch = (h & e) ^ (~h & f);\n t1 = g + s1 + ch + K[j + 1] + blocks[j + 1];\n t2 = s0 + maj;\n g = c + t1 << 0;\n c = t1 + t2 << 0;\n s0 = ((c >>> 2) | (c << 30)) ^ ((c >>> 13) | (c << 19)) ^ ((c >>> 22) | (c << 10));\n s1 = ((g >>> 6) | (g << 26)) ^ ((g >>> 11) | (g << 21)) ^ ((g >>> 25) | (g << 7));\n cd = c & d;\n maj = cd ^ (c & a) ^ da;\n ch = (g & h) ^ (~g & e);\n t1 = f + s1 + ch + K[j + 2] + blocks[j + 2];\n t2 = s0 + maj;\n f = b + t1 << 0;\n b = t1 + t2 << 0;\n s0 = ((b >>> 2) | (b << 30)) ^ ((b >>> 13) | (b << 19)) ^ ((b >>> 22) | (b << 10));\n s1 = ((f >>> 6) | (f << 26)) ^ ((f >>> 11) | (f << 21)) ^ ((f >>> 25) | (f << 7));\n bc = b & c;\n maj = bc ^ (b & d) ^ cd;\n ch = (f & g) ^ (~f & h);\n t1 = e + s1 + ch + K[j + 3] + blocks[j + 3];\n t2 = s0 + maj;\n e = a + t1 << 0;\n a = t1 + t2 << 0;\n this.chromeBugWorkAround = true;\n }\n\n this.h0 = this.h0 + a << 0;\n this.h1 = this.h1 + b << 0;\n this.h2 = this.h2 + c << 0;\n this.h3 = this.h3 + d << 0;\n this.h4 = this.h4 + e << 0;\n this.h5 = this.h5 + f << 0;\n this.h6 = this.h6 + g << 0;\n this.h7 = this.h7 + h << 0;\n };\n\n Sha256.prototype.hex = function () {\n this.finalize();\n\n var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4, h5 = this.h5,\n h6 = this.h6, h7 = this.h7;\n\n var hex = HEX_CHARS[(h0 >>> 28) & 0x0F] + HEX_CHARS[(h0 >>> 24) & 0x0F] +\n HEX_CHARS[(h0 >>> 20) & 0x0F] + HEX_CHARS[(h0 >>> 16) & 0x0F] +\n HEX_CHARS[(h0 >>> 12) & 0x0F] + HEX_CHARS[(h0 >>> 8) & 0x0F] +\n HEX_CHARS[(h0 >>> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] +\n HEX_CHARS[(h1 >>> 28) & 0x0F] + HEX_CHARS[(h1 >>> 24) & 0x0F] +\n HEX_CHARS[(h1 >>> 20) & 0x0F] + HEX_CHARS[(h1 >>> 16) & 0x0F] +\n HEX_CHARS[(h1 >>> 12) & 0x0F] + HEX_CHARS[(h1 >>> 8) & 0x0F] +\n HEX_CHARS[(h1 >>> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] +\n HEX_CHARS[(h2 >>> 28) & 0x0F] + HEX_CHARS[(h2 >>> 24) & 0x0F] +\n HEX_CHARS[(h2 >>> 20) & 0x0F] + HEX_CHARS[(h2 >>> 16) & 0x0F] +\n HEX_CHARS[(h2 >>> 12) & 0x0F] + HEX_CHARS[(h2 >>> 8) & 0x0F] +\n HEX_CHARS[(h2 >>> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] +\n HEX_CHARS[(h3 >>> 28) & 0x0F] + HEX_CHARS[(h3 >>> 24) & 0x0F] +\n HEX_CHARS[(h3 >>> 20) & 0x0F] + HEX_CHARS[(h3 >>> 16) & 0x0F] +\n HEX_CHARS[(h3 >>> 12) & 0x0F] + HEX_CHARS[(h3 >>> 8) & 0x0F] +\n HEX_CHARS[(h3 >>> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] +\n HEX_CHARS[(h4 >>> 28) & 0x0F] + HEX_CHARS[(h4 >>> 24) & 0x0F] +\n HEX_CHARS[(h4 >>> 20) & 0x0F] + HEX_CHARS[(h4 >>> 16) & 0x0F] +\n HEX_CHARS[(h4 >>> 12) & 0x0F] + HEX_CHARS[(h4 >>> 8) & 0x0F] +\n HEX_CHARS[(h4 >>> 4) & 0x0F] + HEX_CHARS[h4 & 0x0F] +\n HEX_CHARS[(h5 >>> 28) & 0x0F] + HEX_CHARS[(h5 >>> 24) & 0x0F] +\n HEX_CHARS[(h5 >>> 20) & 0x0F] + HEX_CHARS[(h5 >>> 16) & 0x0F] +\n HEX_CHARS[(h5 >>> 12) & 0x0F] + HEX_CHARS[(h5 >>> 8) & 0x0F] +\n HEX_CHARS[(h5 >>> 4) & 0x0F] + HEX_CHARS[h5 & 0x0F] +\n HEX_CHARS[(h6 >>> 28) & 0x0F] + HEX_CHARS[(h6 >>> 24) & 0x0F] +\n HEX_CHARS[(h6 >>> 20) & 0x0F] + HEX_CHARS[(h6 >>> 16) & 0x0F] +\n HEX_CHARS[(h6 >>> 12) & 0x0F] + HEX_CHARS[(h6 >>> 8) & 0x0F] +\n HEX_CHARS[(h6 >>> 4) & 0x0F] + HEX_CHARS[h6 & 0x0F];\n if (!this.is224) {\n hex += HEX_CHARS[(h7 >>> 28) & 0x0F] + HEX_CHARS[(h7 >>> 24) & 0x0F] +\n HEX_CHARS[(h7 >>> 20) & 0x0F] + HEX_CHARS[(h7 >>> 16) & 0x0F] +\n HEX_CHARS[(h7 >>> 12) & 0x0F] + HEX_CHARS[(h7 >>> 8) & 0x0F] +\n HEX_CHARS[(h7 >>> 4) & 0x0F] + HEX_CHARS[h7 & 0x0F];\n }\n return hex;\n };\n\n Sha256.prototype.toString = Sha256.prototype.hex;\n\n Sha256.prototype.digest = function () {\n this.finalize();\n\n var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4, h5 = this.h5,\n h6 = this.h6, h7 = this.h7;\n\n var arr = [\n (h0 >>> 24) & 0xFF, (h0 >>> 16) & 0xFF, (h0 >>> 8) & 0xFF, h0 & 0xFF,\n (h1 >>> 24) & 0xFF, (h1 >>> 16) & 0xFF, (h1 >>> 8) & 0xFF, h1 & 0xFF,\n (h2 >>> 24) & 0xFF, (h2 >>> 16) & 0xFF, (h2 >>> 8) & 0xFF, h2 & 0xFF,\n (h3 >>> 24) & 0xFF, (h3 >>> 16) & 0xFF, (h3 >>> 8) & 0xFF, h3 & 0xFF,\n (h4 >>> 24) & 0xFF, (h4 >>> 16) & 0xFF, (h4 >>> 8) & 0xFF, h4 & 0xFF,\n (h5 >>> 24) & 0xFF, (h5 >>> 16) & 0xFF, (h5 >>> 8) & 0xFF, h5 & 0xFF,\n (h6 >>> 24) & 0xFF, (h6 >>> 16) & 0xFF, (h6 >>> 8) & 0xFF, h6 & 0xFF\n ];\n if (!this.is224) {\n arr.push((h7 >>> 24) & 0xFF, (h7 >>> 16) & 0xFF, (h7 >>> 8) & 0xFF, h7 & 0xFF);\n }\n return arr;\n };\n\n Sha256.prototype.array = Sha256.prototype.digest;\n\n Sha256.prototype.arrayBuffer = function () {\n this.finalize();\n\n var buffer = new ArrayBuffer(this.is224 ? 28 : 32);\n var dataView = new DataView(buffer);\n dataView.setUint32(0, this.h0);\n dataView.setUint32(4, this.h1);\n dataView.setUint32(8, this.h2);\n dataView.setUint32(12, this.h3);\n dataView.setUint32(16, this.h4);\n dataView.setUint32(20, this.h5);\n dataView.setUint32(24, this.h6);\n if (!this.is224) {\n dataView.setUint32(28, this.h7);\n }\n return buffer;\n };\n\n function HmacSha256(key, is224, sharedMemory) {\n var i, type = typeof key;\n if (type === 'string') {\n var bytes = [], length = key.length, index = 0, code;\n for (i = 0; i < length; ++i) {\n code = key.charCodeAt(i);\n if (code < 0x80) {\n bytes[index++] = code;\n } else if (code < 0x800) {\n bytes[index++] = (0xc0 | (code >>> 6));\n bytes[index++] = (0x80 | (code & 0x3f));\n } else if (code < 0xd800 || code >= 0xe000) {\n bytes[index++] = (0xe0 | (code >>> 12));\n bytes[index++] = (0x80 | ((code >>> 6) & 0x3f));\n bytes[index++] = (0x80 | (code & 0x3f));\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (key.charCodeAt(++i) & 0x3ff));\n bytes[index++] = (0xf0 | (code >>> 18));\n bytes[index++] = (0x80 | ((code >>> 12) & 0x3f));\n bytes[index++] = (0x80 | ((code >>> 6) & 0x3f));\n bytes[index++] = (0x80 | (code & 0x3f));\n }\n }\n key = bytes;\n } else {\n if (type === 'object') {\n if (key === null) {\n throw new Error(ERROR);\n } else if (ARRAY_BUFFER && key.constructor === ArrayBuffer) {\n key = new Uint8Array(key);\n } else if (!Array.isArray(key)) {\n if (!ARRAY_BUFFER || !ArrayBuffer.isView(key)) {\n throw new Error(ERROR);\n }\n }\n } else {\n throw new Error(ERROR);\n }\n }\n\n if (key.length > 64) {\n key = (new Sha256(is224, true)).update(key).array();\n }\n\n var oKeyPad = [], iKeyPad = [];\n for (i = 0; i < 64; ++i) {\n var b = key[i] || 0;\n oKeyPad[i] = 0x5c ^ b;\n iKeyPad[i] = 0x36 ^ b;\n }\n\n Sha256.call(this, is224, sharedMemory);\n\n this.update(iKeyPad);\n this.oKeyPad = oKeyPad;\n this.inner = true;\n this.sharedMemory = sharedMemory;\n }\n HmacSha256.prototype = new Sha256();\n\n HmacSha256.prototype.finalize = function () {\n Sha256.prototype.finalize.call(this);\n if (this.inner) {\n this.inner = false;\n var innerHash = this.array();\n Sha256.call(this, this.is224, this.sharedMemory);\n this.update(this.oKeyPad);\n this.update(innerHash);\n Sha256.prototype.finalize.call(this);\n }\n };\n\n var exports = createMethod();\n exports.sha256 = exports;\n exports.sha224 = createMethod(true);\n exports.sha256.hmac = createHmacMethod();\n exports.sha224.hmac = createHmacMethod(true);\n\n if (COMMON_JS) {\n module.exports = exports;\n } else {\n root.sha256 = exports.sha256;\n root.sha224 = exports.sha224;\n if (AMD) {\n define(function () {\n return exports;\n });\n }\n }\n})();\n"],
- "mappings": ";;;;;;;;;AAAA;AAAA;AASA,KAAC,WAAY;AACX;AAEA,UAAI,QAAQ;AACZ,UAAI,SAAS,OAAO,WAAW;AAC/B,UAAI,OAAO,SAAS,SAAS,CAAC;AAC9B,UAAI,KAAK,qBAAqB;AAC5B,iBAAS;AAAA,MACX;AACA,UAAI,aAAa,CAAC,UAAU,OAAO,SAAS;AAC5C,UAAI,UAAU,CAAC,KAAK,wBAAwB,OAAO,YAAY,YAAY,QAAQ,YAAY,QAAQ,SAAS;AAChH,UAAI,SAAS;AACX,eAAO;AAAA,MACT,WAAW,YAAY;AACrB,eAAO;AAAA,MACT;AACA,UAAI,YAAY,CAAC,KAAK,0BAA0B,OAAO,WAAW,YAAY,OAAO;AACrF,UAAI,MAAM,OAAO,WAAW,cAAc,OAAO;AACjD,UAAI,eAAe,CAAC,KAAK,6BAA6B,OAAO,gBAAgB;AAC7E,UAAI,YAAY,mBAAmB,MAAM,EAAE;AAC3C,UAAI,QAAQ,CAAC,aAAa,SAAS,OAAO,GAAG;AAC7C,UAAI,QAAQ,CAAC,IAAI,IAAI,GAAG,CAAC;AACzB,UAAI,IAAI;AAAA,QACN;AAAA,QAAY;AAAA,QAAY;AAAA,Q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,UAAU;AACf,aAAK,QAAQ;AACb,aAAK,eAAe;AAAA,MACtB;AACA,iBAAW,YAAY,IAAI,OAAO;AAElC,iBAAW,UAAU,WAAW,WAAY;AAC1C,eAAO,UAAU,SAAS,KAAK,IAAI;AACnC,YAAI,KAAK,OAAO;AACd,eAAK,QAAQ;AACb,cAAI,YAAY,KAAK,MAAM;AAC3B,iBAAO,KAAK,MAAM,KAAK,OAAO,KAAK,YAAY;AAC/C,eAAK,OAAO,KAAK,OAAO;AACxB,eAAK,OAAO,SAAS;AACrB,iBAAO,UAAU,SAAS,KAAK,IAAI;AAAA,QACrC;AAAA,MACF;AAEA,UAAIC,WAAU,aAAa;AAC3B,MAAAA,SAAQ,SAASA;AACjB,MAAAA,SAAQ,SAAS,aAAa,IAAI;AAClC,MAAAA,SAAQ,OAAO,OAAO,iBAAiB;AACvC,MAAAA,SAAQ,OAAO,OAAO,iBAAiB,IAAI;AAE3C,UAAI,WAAW;AACb,eAAO,UAAUA;AAAA,MACnB,OAAO;AACL,aAAK,SAASA,SAAQ;AACtB,aAAK,SAASA,SAAQ;AACtB,YAAI,KAAK;AACP,iBAAO,WAAY;AACjB,mBAAOA;AAAA,UACT,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF,GAAG;AAAA;AAAA;",
- "names": ["blocks", "exports"]
-}
diff --git a/node_modules/.vite/deps/package.json b/node_modules/.vite/deps/package.json
deleted file mode 100644
index 3dbc1ca..0000000
--- a/node_modules/.vite/deps/package.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "type": "module"
-}
diff --git a/node_modules/@trysound/sax/LICENSE b/node_modules/@trysound/sax/LICENSE
new file mode 100644
index 0000000..19129e3
--- /dev/null
+++ b/node_modules/@trysound/sax/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/@trysound/sax/README.md b/node_modules/@trysound/sax/README.md
new file mode 100644
index 0000000..c43d2ac
--- /dev/null
+++ b/node_modules/@trysound/sax/README.md
@@ -0,0 +1,202 @@
+# svg/sax
+
+A maintained fork of [sax-js](https://github.com/isaacs/sax-js) sax-style parser for XML and HTML.
+
+Designed with [node](http://nodejs.org/) in mind, but should work fine in
+the browser or other CommonJS implementations.
+
+## What This Is
+
+* A very simple tool to parse through an XML string.
+* A stepping stone to a streaming HTML parser.
+* A handy way to deal with RSS and other mostly-ok-but-kinda-broken XML
+ docs.
+
+## What This Is (probably) Not
+
+* An HTML Parser - That's a fine goal, but this isn't it. It's just
+ XML.
+* A DOM Builder - You can use it to build an object model out of XML,
+ but it doesn't do that out of the box.
+* XSLT - No DOM = no querying.
+* 100% Compliant with (some other SAX implementation) - Most SAX
+ implementations are in Java and do a lot more than this does.
+* An XML Validator - It does a little validation when in strict mode, but
+ not much.
+* A Schema-Aware XSD Thing - Schemas are an exercise in fetishistic
+ masochism.
+* A DTD-aware Thing - Fetching DTDs is a much bigger job.
+
+## Regarding `Hello,
world !').close();
+```
+
+
+## Arguments
+
+Pass the following arguments to the parser function. All are optional.
+
+`strict` - Boolean. Whether or not to be a jerk. Default: `false`.
+
+`opt` - Object bag of settings regarding string formatting. All default to `false`.
+
+Settings supported:
+
+* `trim` - Boolean. Whether or not to trim text and comment nodes.
+* `normalize` - Boolean. If true, then turn any whitespace into a single
+ space.
+* `lowercase` - Boolean. If true, then lowercase tag names and attribute names
+ in loose mode, rather than uppercasing them.
+* `xmlns` - Boolean. If true, then namespaces are supported.
+* `position` - Boolean. If false, then don't track line/col/position.
+* `strictEntities` - Boolean. If true, only parse [predefined XML
+ entities](http://www.w3.org/TR/REC-xml/#sec-predefined-ent)
+ (`&`, `'`, `>`, `<`, and `"`)
+
+## Methods
+
+`write` - Write bytes onto the stream. You don't have to do this all at
+once. You can keep writing as much as you want.
+
+`close` - Close the stream. Once closed, no more data may be written until
+it is done processing the buffer, which is signaled by the `end` event.
+
+`resume` - To gracefully handle errors, assign a listener to the `error`
+event. Then, when the error is taken care of, you can call `resume` to
+continue parsing. Otherwise, the parser will not continue while in an error
+state.
+
+## Members
+
+At all times, the parser object will have the following members:
+
+`line`, `column`, `position` - Indications of the position in the XML
+document where the parser currently is looking.
+
+`startTagPosition` - Indicates the position where the current tag starts.
+
+`closed` - Boolean indicating whether or not the parser can be written to.
+If it's `true`, then wait for the `ready` event to write again.
+
+`strict` - Boolean indicating whether or not the parser is a jerk.
+
+`opt` - Any options passed into the constructor.
+
+`tag` - The current tag being dealt with.
+
+And a bunch of other stuff that you probably shouldn't touch.
+
+## Events
+
+All events emit with a single argument. To listen to an event, assign a
+function to `on
`. Functions get executed in the this-context of
+the parser object. The list of supported events are also in the exported
+`EVENTS` array.
+
+`error` - Indication that something bad happened. The error will be hanging
+out on `parser.error`, and must be deleted before parsing can continue. By
+listening to this event, you can keep an eye on that kind of stuff. Note:
+this happens *much* more in strict mode. Argument: instance of `Error`.
+
+`text` - Text node. Argument: string of text.
+
+`doctype` - The ``. Argument:
+object with `name` and `body` members. Attributes are not parsed, as
+processing instructions have implementation dependent semantics.
+
+`sgmldeclaration` - Random SGML declarations. Stuff like ``
+would trigger this kind of event. This is a weird thing to support, so it
+might go away at some point. SAX isn't intended to be used to parse SGML,
+after all.
+
+`opentagstart` - Emitted immediately when the tag name is available,
+but before any attributes are encountered. Argument: object with a
+`name` field and an empty `attributes` set. Note that this is the
+same object that will later be emitted in the `opentag` event.
+
+`opentag` - An opening tag. Argument: object with `name` and `attributes`.
+In non-strict mode, tag names are uppercased, unless the `lowercase`
+option is set. If the `xmlns` option is set, then it will contain
+namespace binding information on the `ns` member, and will have a
+`local`, `prefix`, and `uri` member.
+
+`closetag` - A closing tag. In loose mode, tags are auto-closed if their
+parent closes. In strict mode, well-formedness is enforced. Note that
+self-closing tags will have `closeTag` emitted immediately after `openTag`.
+Argument: tag name.
+
+`attribute` - An attribute node. Argument: object with `name` and `value`.
+In non-strict mode, attribute names are uppercased, unless the `lowercase`
+option is set. If the `xmlns` option is set, it will also contains namespace
+information.
+
+`comment` - A comment node. Argument: the string of the comment.
+
+`opencdata` - The opening tag of a ``) of a `` tags trigger a `"script"`
+event, and their contents are not checked for special xml characters.
+If you pass `noscript: true`, then this behavior is suppressed.
+
+## Reporting Problems
+
+It's best to write a failing test if you find an issue. I will always
+accept pull requests with failing tests if they demonstrate intended
+behavior, but it is very hard to figure out what issue you're describing
+without a test. Writing a test is also the best way for you yourself
+to figure out if you really understand the issue you think you have with
+sax-js.
diff --git a/node_modules/@trysound/sax/lib/sax.js b/node_modules/@trysound/sax/lib/sax.js
new file mode 100644
index 0000000..5416e88
--- /dev/null
+++ b/node_modules/@trysound/sax/lib/sax.js
@@ -0,0 +1,1413 @@
+;(function (sax) { // wrapper for non-node envs
+ sax.parser = function (strict, opt) { return new SAXParser(strict, opt) }
+ sax.SAXParser = SAXParser
+
+ // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.
+ // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),
+ // since that's the earliest that a buffer overrun could occur. This way, checks are
+ // as rare as required, but as often as necessary to ensure never crossing this bound.
+ // Furthermore, buffers are only tested at most once per write(), so passing a very
+ // large string into write() might have undesirable effects, but this is manageable by
+ // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme
+ // edge case, result in creating at most one complete copy of the string passed in.
+ // Set to Infinity to have unlimited buffers.
+ sax.MAX_BUFFER_LENGTH = 64 * 1024
+
+ var buffers = [
+ 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype',
+ 'procInstName', 'procInstBody', 'entity', 'attribName',
+ 'attribValue', 'cdata', 'script'
+ ]
+
+ sax.EVENTS = [
+ 'text',
+ 'processinginstruction',
+ 'sgmldeclaration',
+ 'doctype',
+ 'comment',
+ 'opentagstart',
+ 'attribute',
+ 'opentag',
+ 'closetag',
+ 'opencdata',
+ 'cdata',
+ 'closecdata',
+ 'error',
+ 'end',
+ 'ready',
+ 'script',
+ 'opennamespace',
+ 'closenamespace'
+ ]
+
+ function SAXParser (strict, opt) {
+ if (!(this instanceof SAXParser)) {
+ return new SAXParser(strict, opt)
+ }
+
+ var parser = this
+ clearBuffers(parser)
+ parser.q = parser.c = ''
+ parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH
+ parser.opt = opt || {}
+ parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags
+ parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase'
+ parser.tags = []
+ parser.closed = parser.closedRoot = parser.sawRoot = false
+ parser.tag = parser.error = null
+ parser.strict = !!strict
+ parser.noscript = !!(strict || parser.opt.noscript)
+ parser.state = S.BEGIN
+ parser.strictEntities = parser.opt.strictEntities
+ parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES)
+ parser.attribList = []
+
+ // namespaces form a prototype chain.
+ // it always points at the current tag,
+ // which protos to its parent tag.
+ if (parser.opt.xmlns) {
+ parser.ns = Object.create(rootNS)
+ }
+
+ // mostly just for error reporting
+ parser.trackPosition = parser.opt.position !== false
+ if (parser.trackPosition) {
+ parser.position = parser.line = parser.column = 0
+ }
+ emit(parser, 'onready')
+ }
+
+ if (!Object.create) {
+ Object.create = function (o) {
+ function F () {}
+ F.prototype = o
+ var newf = new F()
+ return newf
+ }
+ }
+
+ if (!Object.keys) {
+ Object.keys = function (o) {
+ var a = []
+ for (var i in o) if (o.hasOwnProperty(i)) a.push(i)
+ return a
+ }
+ }
+
+ function checkBufferLength (parser) {
+ var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)
+ var maxActual = 0
+ for (var i = 0, l = buffers.length; i < l; i++) {
+ var len = parser[buffers[i]].length
+ if (len > maxAllowed) {
+ // Text/cdata nodes can get big, and since they're buffered,
+ // we can get here under normal conditions.
+ // Avoid issues by emitting the text node now,
+ // so at least it won't get any bigger.
+ switch (buffers[i]) {
+ case 'textNode':
+ closeText(parser)
+ break
+
+ case 'cdata':
+ emitNode(parser, 'oncdata', parser.cdata)
+ parser.cdata = ''
+ break
+
+ case 'script':
+ emitNode(parser, 'onscript', parser.script)
+ parser.script = ''
+ break
+
+ default:
+ error(parser, 'Max buffer length exceeded: ' + buffers[i])
+ }
+ }
+ maxActual = Math.max(maxActual, len)
+ }
+ // schedule the next check for the earliest possible buffer overrun.
+ var m = sax.MAX_BUFFER_LENGTH - maxActual
+ parser.bufferCheckPosition = m + parser.position
+ }
+
+ function clearBuffers (parser) {
+ for (var i = 0, l = buffers.length; i < l; i++) {
+ parser[buffers[i]] = ''
+ }
+ }
+
+ function flushBuffers (parser) {
+ closeText(parser)
+ if (parser.cdata !== '') {
+ emitNode(parser, 'oncdata', parser.cdata)
+ parser.cdata = ''
+ }
+ if (parser.script !== '') {
+ emitNode(parser, 'onscript', parser.script)
+ parser.script = ''
+ }
+ }
+
+ SAXParser.prototype = {
+ end: function () { end(this) },
+ write: write,
+ resume: function () { this.error = null; return this },
+ close: function () { return this.write(null) },
+ flush: function () { flushBuffers(this) }
+ }
+
+ // this really needs to be replaced with character classes.
+ // XML allows all manner of ridiculous numbers and digits.
+ var CDATA = '[CDATA['
+ var DOCTYPE = 'DOCTYPE'
+ var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace'
+ var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/'
+ var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }
+
+ // http://www.w3.org/TR/REC-xml/#NT-NameStartChar
+ // This implementation works on strings, a single character at a time
+ // as such, it cannot ever support astral-plane characters (10000-EFFFF)
+ // without a significant breaking change to either this parser, or the
+ // JavaScript language. Implementation of an emoji-capable xml parser
+ // is left as an exercise for the reader.
+ var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
+
+ var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/
+
+ var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
+ var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/
+
+ function isWhitespace (c) {
+ return c === ' ' || c === '\n' || c === '\r' || c === '\t'
+ }
+
+ function isQuote (c) {
+ return c === '"' || c === '\''
+ }
+
+ function isAttribEnd (c) {
+ return c === '>' || isWhitespace(c)
+ }
+
+ function isMatch (regex, c) {
+ return regex.test(c)
+ }
+
+ function notMatch (regex, c) {
+ return !isMatch(regex, c)
+ }
+
+ var S = 0
+ sax.STATE = {
+ BEGIN: S++, // leading byte order mark or whitespace
+ BEGIN_WHITESPACE: S++, // leading whitespace
+ TEXT: S++, // general stuff
+ TEXT_ENTITY: S++, // & and such.
+ OPEN_WAKA: S++, // <
+ SGML_DECL: S++, //
+ SCRIPT: S++, //
+
+```
+
+- `dist/csstree.esm.js` – minified ES module
+```html
+
+```
+
+One of CDN services like `unpkg` or `jsDelivr` can be used. By default (for short path) a ESM version is exposing. For IIFE version a full path to a bundle should be specified:
+
+```html
+
+
+
+
+
+
+```
+
+## Top level API
+
+
+
+## License
+
+MIT
diff --git a/node_modules/css-tree/cjs/convertor/create.cjs b/node_modules/css-tree/cjs/convertor/create.cjs
new file mode 100644
index 0000000..55c655b
--- /dev/null
+++ b/node_modules/css-tree/cjs/convertor/create.cjs
@@ -0,0 +1,32 @@
+'use strict';
+
+const List = require('../utils/List.cjs');
+
+function createConvertor(walk) {
+ return {
+ fromPlainObject(ast) {
+ walk(ast, {
+ enter(node) {
+ if (node.children && node.children instanceof List.List === false) {
+ node.children = new List.List().fromArray(node.children);
+ }
+ }
+ });
+
+ return ast;
+ },
+ toPlainObject(ast) {
+ walk(ast, {
+ leave(node) {
+ if (node.children && node.children instanceof List.List) {
+ node.children = node.children.toArray();
+ }
+ }
+ });
+
+ return ast;
+ }
+ };
+}
+
+exports.createConvertor = createConvertor;
diff --git a/node_modules/css-tree/cjs/convertor/index.cjs b/node_modules/css-tree/cjs/convertor/index.cjs
new file mode 100644
index 0000000..6654278
--- /dev/null
+++ b/node_modules/css-tree/cjs/convertor/index.cjs
@@ -0,0 +1,8 @@
+'use strict';
+
+const create = require('./create.cjs');
+const index$1 = require('../walker/index.cjs');
+
+const index = create.createConvertor(index$1);
+
+module.exports = index;
diff --git a/node_modules/css-tree/cjs/data-patch.cjs b/node_modules/css-tree/cjs/data-patch.cjs
new file mode 100644
index 0000000..9103ea4
--- /dev/null
+++ b/node_modules/css-tree/cjs/data-patch.cjs
@@ -0,0 +1,7 @@
+'use strict';
+
+const patch = require('../data/patch.json');
+
+const patch$1 = patch;
+
+module.exports = patch$1;
diff --git a/node_modules/css-tree/cjs/data.cjs b/node_modules/css-tree/cjs/data.cjs
new file mode 100644
index 0000000..3ef8afd
--- /dev/null
+++ b/node_modules/css-tree/cjs/data.cjs
@@ -0,0 +1,99 @@
+'use strict';
+
+const dataPatch = require('./data-patch.cjs');
+
+const mdnAtrules = require('mdn-data/css/at-rules.json');
+const mdnProperties = require('mdn-data/css/properties.json');
+const mdnSyntaxes = require('mdn-data/css/syntaxes.json');
+
+const extendSyntax = /^\s*\|\s*/;
+
+function preprocessAtrules(dict) {
+ const result = Object.create(null);
+
+ for (const atruleName in dict) {
+ const atrule = dict[atruleName];
+ let descriptors = null;
+
+ if (atrule.descriptors) {
+ descriptors = Object.create(null);
+
+ for (const descriptor in atrule.descriptors) {
+ descriptors[descriptor] = atrule.descriptors[descriptor].syntax;
+ }
+ }
+
+ result[atruleName.substr(1)] = {
+ prelude: atrule.syntax.trim().replace(/\{(.|\s)+\}/, '').match(/^@\S+\s+([^;\{]*)/)[1].trim() || null,
+ descriptors
+ };
+ }
+
+ return result;
+}
+
+function patchDictionary(dict, patchDict) {
+ const result = {};
+
+ // copy all syntaxes for an original dict
+ for (const key in dict) {
+ result[key] = dict[key].syntax || dict[key];
+ }
+
+ // apply a patch
+ for (const key in patchDict) {
+ if (key in dict) {
+ if (patchDict[key].syntax) {
+ result[key] = extendSyntax.test(patchDict[key].syntax)
+ ? result[key] + ' ' + patchDict[key].syntax.trim()
+ : patchDict[key].syntax;
+ } else {
+ delete result[key];
+ }
+ } else {
+ if (patchDict[key].syntax) {
+ result[key] = patchDict[key].syntax.replace(extendSyntax, '');
+ }
+ }
+ }
+
+ return result;
+}
+
+function patchAtrules(dict, patchDict) {
+ const result = {};
+
+ // copy all syntaxes for an original dict
+ for (const key in dict) {
+ const atrulePatch = patchDict[key] || {};
+
+ result[key] = {
+ prelude: key in patchDict && 'prelude' in atrulePatch
+ ? atrulePatch.prelude
+ : dict[key].prelude || null,
+ descriptors: patchDictionary(dict[key].descriptors || {}, atrulePatch.descriptors || {})
+ };
+ }
+
+ // apply a patch
+ for (const key in patchDict) {
+ if (!hasOwnProperty.call(dict, key)) {
+ const atrulePatch = patchDict[key] || {};
+
+ result[key] = {
+ prelude: atrulePatch.prelude || null,
+ descriptors: atrulePatch.descriptors && patchDictionary({}, atrulePatch.descriptors)
+ };
+ }
+ }
+
+ return result;
+}
+
+const definitions = {
+ types: patchDictionary(mdnSyntaxes, dataPatch.types),
+ atrules: patchAtrules(preprocessAtrules(mdnAtrules), dataPatch.atrules),
+ properties: patchDictionary(mdnProperties, dataPatch.properties)
+};
+
+module.exports = definitions;
diff --git a/node_modules/css-tree/cjs/definition-syntax/SyntaxError.cjs b/node_modules/css-tree/cjs/definition-syntax/SyntaxError.cjs
new file mode 100644
index 0000000..d24e7ce
--- /dev/null
+++ b/node_modules/css-tree/cjs/definition-syntax/SyntaxError.cjs
@@ -0,0 +1,16 @@
+'use strict';
+
+const createCustomError = require('../utils/create-custom-error.cjs');
+
+function SyntaxError(message, input, offset) {
+ return Object.assign(createCustomError.createCustomError('SyntaxError', message), {
+ input,
+ offset,
+ rawMessage: message,
+ message: message + '\n' +
+ ' ' + input + '\n' +
+ '--' + new Array((offset || input.length) + 1).join('-') + '^'
+ });
+}
+
+exports.SyntaxError = SyntaxError;
diff --git a/node_modules/css-tree/cjs/definition-syntax/generate.cjs b/node_modules/css-tree/cjs/definition-syntax/generate.cjs
new file mode 100644
index 0000000..785af06
--- /dev/null
+++ b/node_modules/css-tree/cjs/definition-syntax/generate.cjs
@@ -0,0 +1,135 @@
+'use strict';
+
+function noop(value) {
+ return value;
+}
+
+function generateMultiplier(multiplier) {
+ const { min, max, comma } = multiplier;
+
+ if (min === 0 && max === 0) {
+ return comma ? '#?' : '*';
+ }
+
+ if (min === 0 && max === 1) {
+ return '?';
+ }
+
+ if (min === 1 && max === 0) {
+ return comma ? '#' : '+';
+ }
+
+ if (min === 1 && max === 1) {
+ return '';
+ }
+
+ return (
+ (comma ? '#' : '') +
+ (min === max
+ ? '{' + min + '}'
+ : '{' + min + ',' + (max !== 0 ? max : '') + '}'
+ )
+ );
+}
+
+function generateTypeOpts(node) {
+ switch (node.type) {
+ case 'Range':
+ return (
+ ' [' +
+ (node.min === null ? '-∞' : node.min) +
+ ',' +
+ (node.max === null ? '∞' : node.max) +
+ ']'
+ );
+
+ default:
+ throw new Error('Unknown node type `' + node.type + '`');
+ }
+}
+
+function generateSequence(node, decorate, forceBraces, compact) {
+ const combinator = node.combinator === ' ' || compact ? node.combinator : ' ' + node.combinator + ' ';
+ const result = node.terms
+ .map(term => internalGenerate(term, decorate, forceBraces, compact))
+ .join(combinator);
+
+ if (node.explicit || forceBraces) {
+ return (compact || result[0] === ',' ? '[' : '[ ') + result + (compact ? ']' : ' ]');
+ }
+
+ return result;
+}
+
+function internalGenerate(node, decorate, forceBraces, compact) {
+ let result;
+
+ switch (node.type) {
+ case 'Group':
+ result =
+ generateSequence(node, decorate, forceBraces, compact) +
+ (node.disallowEmpty ? '!' : '');
+ break;
+
+ case 'Multiplier':
+ // return since node is a composition
+ return (
+ internalGenerate(node.term, decorate, forceBraces, compact) +
+ decorate(generateMultiplier(node), node)
+ );
+
+ case 'Type':
+ result = '<' + node.name + (node.opts ? decorate(generateTypeOpts(node.opts), node.opts) : '') + '>';
+ break;
+
+ case 'Property':
+ result = '<\'' + node.name + '\'>';
+ break;
+
+ case 'Keyword':
+ result = node.name;
+ break;
+
+ case 'AtKeyword':
+ result = '@' + node.name;
+ break;
+
+ case 'Function':
+ result = node.name + '(';
+ break;
+
+ case 'String':
+ case 'Token':
+ result = node.value;
+ break;
+
+ case 'Comma':
+ result = ',';
+ break;
+
+ default:
+ throw new Error('Unknown node type `' + node.type + '`');
+ }
+
+ return decorate(result, node);
+}
+
+function generate(node, options) {
+ let decorate = noop;
+ let forceBraces = false;
+ let compact = false;
+
+ if (typeof options === 'function') {
+ decorate = options;
+ } else if (options) {
+ forceBraces = Boolean(options.forceBraces);
+ compact = Boolean(options.compact);
+ if (typeof options.decorate === 'function') {
+ decorate = options.decorate;
+ }
+ }
+
+ return internalGenerate(node, decorate, forceBraces, compact);
+}
+
+exports.generate = generate;
diff --git a/node_modules/css-tree/cjs/definition-syntax/index.cjs b/node_modules/css-tree/cjs/definition-syntax/index.cjs
new file mode 100644
index 0000000..0afb505
--- /dev/null
+++ b/node_modules/css-tree/cjs/definition-syntax/index.cjs
@@ -0,0 +1,13 @@
+'use strict';
+
+const SyntaxError = require('./SyntaxError.cjs');
+const generate = require('./generate.cjs');
+const parse = require('./parse.cjs');
+const walk = require('./walk.cjs');
+
+
+
+exports.SyntaxError = SyntaxError.SyntaxError;
+exports.generate = generate.generate;
+exports.parse = parse.parse;
+exports.walk = walk.walk;
diff --git a/node_modules/css-tree/cjs/definition-syntax/parse.cjs b/node_modules/css-tree/cjs/definition-syntax/parse.cjs
new file mode 100644
index 0000000..53eee01
--- /dev/null
+++ b/node_modules/css-tree/cjs/definition-syntax/parse.cjs
@@ -0,0 +1,588 @@
+'use strict';
+
+const tokenizer = require('./tokenizer.cjs');
+
+const TAB = 9;
+const N = 10;
+const F = 12;
+const R = 13;
+const SPACE = 32;
+const EXCLAMATIONMARK = 33; // !
+const NUMBERSIGN = 35; // #
+const AMPERSAND = 38; // &
+const APOSTROPHE = 39; // '
+const LEFTPARENTHESIS = 40; // (
+const RIGHTPARENTHESIS = 41; // )
+const ASTERISK = 42; // *
+const PLUSSIGN = 43; // +
+const COMMA = 44; // ,
+const HYPERMINUS = 45; // -
+const LESSTHANSIGN = 60; // <
+const GREATERTHANSIGN = 62; // >
+const QUESTIONMARK = 63; // ?
+const COMMERCIALAT = 64; // @
+const LEFTSQUAREBRACKET = 91; // [
+const RIGHTSQUAREBRACKET = 93; // ]
+const LEFTCURLYBRACKET = 123; // {
+const VERTICALLINE = 124; // |
+const RIGHTCURLYBRACKET = 125; // }
+const INFINITY = 8734; // ∞
+const NAME_CHAR = new Uint8Array(128).map((_, idx) =>
+ /[a-zA-Z0-9\-]/.test(String.fromCharCode(idx)) ? 1 : 0
+);
+const COMBINATOR_PRECEDENCE = {
+ ' ': 1,
+ '&&': 2,
+ '||': 3,
+ '|': 4
+};
+
+function scanSpaces(tokenizer) {
+ return tokenizer.substringToPos(
+ tokenizer.findWsEnd(tokenizer.pos)
+ );
+}
+
+function scanWord(tokenizer) {
+ let end = tokenizer.pos;
+
+ for (; end < tokenizer.str.length; end++) {
+ const code = tokenizer.str.charCodeAt(end);
+ if (code >= 128 || NAME_CHAR[code] === 0) {
+ break;
+ }
+ }
+
+ if (tokenizer.pos === end) {
+ tokenizer.error('Expect a keyword');
+ }
+
+ return tokenizer.substringToPos(end);
+}
+
+function scanNumber(tokenizer) {
+ let end = tokenizer.pos;
+
+ for (; end < tokenizer.str.length; end++) {
+ const code = tokenizer.str.charCodeAt(end);
+ if (code < 48 || code > 57) {
+ break;
+ }
+ }
+
+ if (tokenizer.pos === end) {
+ tokenizer.error('Expect a number');
+ }
+
+ return tokenizer.substringToPos(end);
+}
+
+function scanString(tokenizer) {
+ const end = tokenizer.str.indexOf('\'', tokenizer.pos + 1);
+
+ if (end === -1) {
+ tokenizer.pos = tokenizer.str.length;
+ tokenizer.error('Expect an apostrophe');
+ }
+
+ return tokenizer.substringToPos(end + 1);
+}
+
+function readMultiplierRange(tokenizer) {
+ let min = null;
+ let max = null;
+
+ tokenizer.eat(LEFTCURLYBRACKET);
+
+ min = scanNumber(tokenizer);
+
+ if (tokenizer.charCode() === COMMA) {
+ tokenizer.pos++;
+ if (tokenizer.charCode() !== RIGHTCURLYBRACKET) {
+ max = scanNumber(tokenizer);
+ }
+ } else {
+ max = min;
+ }
+
+ tokenizer.eat(RIGHTCURLYBRACKET);
+
+ return {
+ min: Number(min),
+ max: max ? Number(max) : 0
+ };
+}
+
+function readMultiplier(tokenizer) {
+ let range = null;
+ let comma = false;
+
+ switch (tokenizer.charCode()) {
+ case ASTERISK:
+ tokenizer.pos++;
+
+ range = {
+ min: 0,
+ max: 0
+ };
+
+ break;
+
+ case PLUSSIGN:
+ tokenizer.pos++;
+
+ range = {
+ min: 1,
+ max: 0
+ };
+
+ break;
+
+ case QUESTIONMARK:
+ tokenizer.pos++;
+
+ range = {
+ min: 0,
+ max: 1
+ };
+
+ break;
+
+ case NUMBERSIGN:
+ tokenizer.pos++;
+
+ comma = true;
+
+ if (tokenizer.charCode() === LEFTCURLYBRACKET) {
+ range = readMultiplierRange(tokenizer);
+ } else if (tokenizer.charCode() === QUESTIONMARK) {
+ // https://www.w3.org/TR/css-values-4/#component-multipliers
+ // > the # and ? multipliers may be stacked as #?
+ // In this case just treat "#?" as a single multiplier
+ // { min: 0, max: 0, comma: true }
+ tokenizer.pos++;
+ range = {
+ min: 0,
+ max: 0
+ };
+ } else {
+ range = {
+ min: 1,
+ max: 0
+ };
+ }
+
+ break;
+
+ case LEFTCURLYBRACKET:
+ range = readMultiplierRange(tokenizer);
+ break;
+
+ default:
+ return null;
+ }
+
+ return {
+ type: 'Multiplier',
+ comma,
+ min: range.min,
+ max: range.max,
+ term: null
+ };
+}
+
+function maybeMultiplied(tokenizer, node) {
+ const multiplier = readMultiplier(tokenizer);
+
+ if (multiplier !== null) {
+ multiplier.term = node;
+
+ // https://www.w3.org/TR/css-values-4/#component-multipliers
+ // > The + and # multipliers may be stacked as +#;
+ // Represent "+#" as nested multipliers:
+ // { ...,
+ // term: {
+ // ...,
+ // term: node
+ // }
+ // }
+ if (tokenizer.charCode() === NUMBERSIGN &&
+ tokenizer.charCodeAt(tokenizer.pos - 1) === PLUSSIGN) {
+ return maybeMultiplied(tokenizer, multiplier);
+ }
+
+ return multiplier;
+ }
+
+ return node;
+}
+
+function maybeToken(tokenizer) {
+ const ch = tokenizer.peek();
+
+ if (ch === '') {
+ return null;
+ }
+
+ return {
+ type: 'Token',
+ value: ch
+ };
+}
+
+function readProperty(tokenizer) {
+ let name;
+
+ tokenizer.eat(LESSTHANSIGN);
+ tokenizer.eat(APOSTROPHE);
+
+ name = scanWord(tokenizer);
+
+ tokenizer.eat(APOSTROPHE);
+ tokenizer.eat(GREATERTHANSIGN);
+
+ return maybeMultiplied(tokenizer, {
+ type: 'Property',
+ name
+ });
+}
+
+// https://drafts.csswg.org/css-values-3/#numeric-ranges
+// 4.1. Range Restrictions and Range Definition Notation
+//
+// Range restrictions can be annotated in the numeric type notation using CSS bracketed
+// range notation—[min,max]—within the angle brackets, after the identifying keyword,
+// indicating a closed range between (and including) min and max.
+// For example, indicates an integer between 0 and 10, inclusive.
+function readTypeRange(tokenizer) {
+ // use null for Infinity to make AST format JSON serializable/deserializable
+ let min = null; // -Infinity
+ let max = null; // Infinity
+ let sign = 1;
+
+ tokenizer.eat(LEFTSQUAREBRACKET);
+
+ if (tokenizer.charCode() === HYPERMINUS) {
+ tokenizer.peek();
+ sign = -1;
+ }
+
+ if (sign == -1 && tokenizer.charCode() === INFINITY) {
+ tokenizer.peek();
+ } else {
+ min = sign * Number(scanNumber(tokenizer));
+
+ if (NAME_CHAR[tokenizer.charCode()] !== 0) {
+ min += scanWord(tokenizer);
+ }
+ }
+
+ scanSpaces(tokenizer);
+ tokenizer.eat(COMMA);
+ scanSpaces(tokenizer);
+
+ if (tokenizer.charCode() === INFINITY) {
+ tokenizer.peek();
+ } else {
+ sign = 1;
+
+ if (tokenizer.charCode() === HYPERMINUS) {
+ tokenizer.peek();
+ sign = -1;
+ }
+
+ max = sign * Number(scanNumber(tokenizer));
+
+ if (NAME_CHAR[tokenizer.charCode()] !== 0) {
+ max += scanWord(tokenizer);
+ }
+ }
+
+ tokenizer.eat(RIGHTSQUAREBRACKET);
+
+ return {
+ type: 'Range',
+ min,
+ max
+ };
+}
+
+function readType(tokenizer) {
+ let name;
+ let opts = null;
+
+ tokenizer.eat(LESSTHANSIGN);
+ name = scanWord(tokenizer);
+
+ if (tokenizer.charCode() === LEFTPARENTHESIS &&
+ tokenizer.nextCharCode() === RIGHTPARENTHESIS) {
+ tokenizer.pos += 2;
+ name += '()';
+ }
+
+ if (tokenizer.charCodeAt(tokenizer.findWsEnd(tokenizer.pos)) === LEFTSQUAREBRACKET) {
+ scanSpaces(tokenizer);
+ opts = readTypeRange(tokenizer);
+ }
+
+ tokenizer.eat(GREATERTHANSIGN);
+
+ return maybeMultiplied(tokenizer, {
+ type: 'Type',
+ name,
+ opts
+ });
+}
+
+function readKeywordOrFunction(tokenizer) {
+ const name = scanWord(tokenizer);
+
+ if (tokenizer.charCode() === LEFTPARENTHESIS) {
+ tokenizer.pos++;
+
+ return {
+ type: 'Function',
+ name
+ };
+ }
+
+ return maybeMultiplied(tokenizer, {
+ type: 'Keyword',
+ name
+ });
+}
+
+function regroupTerms(terms, combinators) {
+ function createGroup(terms, combinator) {
+ return {
+ type: 'Group',
+ terms,
+ combinator,
+ disallowEmpty: false,
+ explicit: false
+ };
+ }
+
+ let combinator;
+
+ combinators = Object.keys(combinators)
+ .sort((a, b) => COMBINATOR_PRECEDENCE[a] - COMBINATOR_PRECEDENCE[b]);
+
+ while (combinators.length > 0) {
+ combinator = combinators.shift();
+
+ let i = 0;
+ let subgroupStart = 0;
+
+ for (; i < terms.length; i++) {
+ const term = terms[i];
+
+ if (term.type === 'Combinator') {
+ if (term.value === combinator) {
+ if (subgroupStart === -1) {
+ subgroupStart = i - 1;
+ }
+ terms.splice(i, 1);
+ i--;
+ } else {
+ if (subgroupStart !== -1 && i - subgroupStart > 1) {
+ terms.splice(
+ subgroupStart,
+ i - subgroupStart,
+ createGroup(terms.slice(subgroupStart, i), combinator)
+ );
+ i = subgroupStart + 1;
+ }
+ subgroupStart = -1;
+ }
+ }
+ }
+
+ if (subgroupStart !== -1 && combinators.length) {
+ terms.splice(
+ subgroupStart,
+ i - subgroupStart,
+ createGroup(terms.slice(subgroupStart, i), combinator)
+ );
+ }
+ }
+
+ return combinator;
+}
+
+function readImplicitGroup(tokenizer) {
+ const terms = [];
+ const combinators = {};
+ let token;
+ let prevToken = null;
+ let prevTokenPos = tokenizer.pos;
+
+ while (token = peek(tokenizer)) {
+ if (token.type !== 'Spaces') {
+ if (token.type === 'Combinator') {
+ // check for combinator in group beginning and double combinator sequence
+ if (prevToken === null || prevToken.type === 'Combinator') {
+ tokenizer.pos = prevTokenPos;
+ tokenizer.error('Unexpected combinator');
+ }
+
+ combinators[token.value] = true;
+ } else if (prevToken !== null && prevToken.type !== 'Combinator') {
+ combinators[' '] = true; // a b
+ terms.push({
+ type: 'Combinator',
+ value: ' '
+ });
+ }
+
+ terms.push(token);
+ prevToken = token;
+ prevTokenPos = tokenizer.pos;
+ }
+ }
+
+ // check for combinator in group ending
+ if (prevToken !== null && prevToken.type === 'Combinator') {
+ tokenizer.pos -= prevTokenPos;
+ tokenizer.error('Unexpected combinator');
+ }
+
+ return {
+ type: 'Group',
+ terms,
+ combinator: regroupTerms(terms, combinators) || ' ',
+ disallowEmpty: false,
+ explicit: false
+ };
+}
+
+function readGroup(tokenizer) {
+ let result;
+
+ tokenizer.eat(LEFTSQUAREBRACKET);
+ result = readImplicitGroup(tokenizer);
+ tokenizer.eat(RIGHTSQUAREBRACKET);
+
+ result.explicit = true;
+
+ if (tokenizer.charCode() === EXCLAMATIONMARK) {
+ tokenizer.pos++;
+ result.disallowEmpty = true;
+ }
+
+ return result;
+}
+
+function peek(tokenizer) {
+ let code = tokenizer.charCode();
+
+ if (code < 128 && NAME_CHAR[code] === 1) {
+ return readKeywordOrFunction(tokenizer);
+ }
+
+ switch (code) {
+ case RIGHTSQUAREBRACKET:
+ // don't eat, stop scan a group
+ break;
+
+ case LEFTSQUAREBRACKET:
+ return maybeMultiplied(tokenizer, readGroup(tokenizer));
+
+ case LESSTHANSIGN:
+ return tokenizer.nextCharCode() === APOSTROPHE
+ ? readProperty(tokenizer)
+ : readType(tokenizer);
+
+ case VERTICALLINE:
+ return {
+ type: 'Combinator',
+ value: tokenizer.substringToPos(
+ tokenizer.pos + (tokenizer.nextCharCode() === VERTICALLINE ? 2 : 1)
+ )
+ };
+
+ case AMPERSAND:
+ tokenizer.pos++;
+ tokenizer.eat(AMPERSAND);
+
+ return {
+ type: 'Combinator',
+ value: '&&'
+ };
+
+ case COMMA:
+ tokenizer.pos++;
+ return {
+ type: 'Comma'
+ };
+
+ case APOSTROPHE:
+ return maybeMultiplied(tokenizer, {
+ type: 'String',
+ value: scanString(tokenizer)
+ });
+
+ case SPACE:
+ case TAB:
+ case N:
+ case R:
+ case F:
+ return {
+ type: 'Spaces',
+ value: scanSpaces(tokenizer)
+ };
+
+ case COMMERCIALAT:
+ code = tokenizer.nextCharCode();
+
+ if (code < 128 && NAME_CHAR[code] === 1) {
+ tokenizer.pos++;
+ return {
+ type: 'AtKeyword',
+ name: scanWord(tokenizer)
+ };
+ }
+
+ return maybeToken(tokenizer);
+
+ case ASTERISK:
+ case PLUSSIGN:
+ case QUESTIONMARK:
+ case NUMBERSIGN:
+ case EXCLAMATIONMARK:
+ // prohibited tokens (used as a multiplier start)
+ break;
+
+ case LEFTCURLYBRACKET:
+ // LEFTCURLYBRACKET is allowed since mdn/data uses it w/o quoting
+ // check next char isn't a number, because it's likely a disjoined multiplier
+ code = tokenizer.nextCharCode();
+
+ if (code < 48 || code > 57) {
+ return maybeToken(tokenizer);
+ }
+
+ break;
+
+ default:
+ return maybeToken(tokenizer);
+ }
+}
+
+function parse(source) {
+ const tokenizer$1 = new tokenizer.Tokenizer(source);
+ const result = readImplicitGroup(tokenizer$1);
+
+ if (tokenizer$1.pos !== source.length) {
+ tokenizer$1.error('Unexpected input');
+ }
+
+ // reduce redundant groups with single group term
+ if (result.terms.length === 1 && result.terms[0].type === 'Group') {
+ return result.terms[0];
+ }
+
+ return result;
+}
+
+exports.parse = parse;
diff --git a/node_modules/css-tree/cjs/definition-syntax/tokenizer.cjs b/node_modules/css-tree/cjs/definition-syntax/tokenizer.cjs
new file mode 100644
index 0000000..6ab5ece
--- /dev/null
+++ b/node_modules/css-tree/cjs/definition-syntax/tokenizer.cjs
@@ -0,0 +1,56 @@
+'use strict';
+
+const SyntaxError = require('./SyntaxError.cjs');
+
+const TAB = 9;
+const N = 10;
+const F = 12;
+const R = 13;
+const SPACE = 32;
+
+class Tokenizer {
+ constructor(str) {
+ this.str = str;
+ this.pos = 0;
+ }
+ charCodeAt(pos) {
+ return pos < this.str.length ? this.str.charCodeAt(pos) : 0;
+ }
+ charCode() {
+ return this.charCodeAt(this.pos);
+ }
+ nextCharCode() {
+ return this.charCodeAt(this.pos + 1);
+ }
+ nextNonWsCode(pos) {
+ return this.charCodeAt(this.findWsEnd(pos));
+ }
+ findWsEnd(pos) {
+ for (; pos < this.str.length; pos++) {
+ const code = this.str.charCodeAt(pos);
+ if (code !== R && code !== N && code !== F && code !== SPACE && code !== TAB) {
+ break;
+ }
+ }
+
+ return pos;
+ }
+ substringToPos(end) {
+ return this.str.substring(this.pos, this.pos = end);
+ }
+ eat(code) {
+ if (this.charCode() !== code) {
+ this.error('Expect `' + String.fromCharCode(code) + '`');
+ }
+
+ this.pos++;
+ }
+ peek() {
+ return this.pos < this.str.length ? this.str.charAt(this.pos++) : '';
+ }
+ error(message) {
+ throw new SyntaxError.SyntaxError(message, this.str, this.pos);
+ }
+}
+
+exports.Tokenizer = Tokenizer;
diff --git a/node_modules/css-tree/cjs/definition-syntax/walk.cjs b/node_modules/css-tree/cjs/definition-syntax/walk.cjs
new file mode 100644
index 0000000..728a446
--- /dev/null
+++ b/node_modules/css-tree/cjs/definition-syntax/walk.cjs
@@ -0,0 +1,56 @@
+'use strict';
+
+const noop = function() {};
+
+function ensureFunction(value) {
+ return typeof value === 'function' ? value : noop;
+}
+
+function walk(node, options, context) {
+ function walk(node) {
+ enter.call(context, node);
+
+ switch (node.type) {
+ case 'Group':
+ node.terms.forEach(walk);
+ break;
+
+ case 'Multiplier':
+ walk(node.term);
+ break;
+
+ case 'Type':
+ case 'Property':
+ case 'Keyword':
+ case 'AtKeyword':
+ case 'Function':
+ case 'String':
+ case 'Token':
+ case 'Comma':
+ break;
+
+ default:
+ throw new Error('Unknown type: ' + node.type);
+ }
+
+ leave.call(context, node);
+ }
+
+ let enter = noop;
+ let leave = noop;
+
+ if (typeof options === 'function') {
+ enter = options;
+ } else if (options) {
+ enter = ensureFunction(options.enter);
+ leave = ensureFunction(options.leave);
+ }
+
+ if (enter === noop && leave === noop) {
+ throw new Error('Neither `enter` nor `leave` walker handler is set or both aren\'t a function');
+ }
+
+ walk(node);
+}
+
+exports.walk = walk;
diff --git a/node_modules/css-tree/cjs/generator/create.cjs b/node_modules/css-tree/cjs/generator/create.cjs
new file mode 100644
index 0000000..ab80f3a
--- /dev/null
+++ b/node_modules/css-tree/cjs/generator/create.cjs
@@ -0,0 +1,103 @@
+'use strict';
+
+const index = require('../tokenizer/index.cjs');
+const sourceMap = require('./sourceMap.cjs');
+const tokenBefore = require('./token-before.cjs');
+const types = require('../tokenizer/types.cjs');
+
+const REVERSESOLIDUS = 0x005c; // U+005C REVERSE SOLIDUS (\)
+
+function processChildren(node, delimeter) {
+ if (typeof delimeter === 'function') {
+ let prev = null;
+
+ node.children.forEach(node => {
+ if (prev !== null) {
+ delimeter.call(this, prev);
+ }
+
+ this.node(node);
+ prev = node;
+ });
+
+ return;
+ }
+
+ node.children.forEach(this.node, this);
+}
+
+function processChunk(chunk) {
+ index.tokenize(chunk, (type, start, end) => {
+ this.token(type, chunk.slice(start, end));
+ });
+}
+
+function createGenerator(config) {
+ const types$1 = new Map();
+
+ for (let name in config.node) {
+ const item = config.node[name];
+ const fn = item.generate || item;
+
+ if (typeof fn === 'function') {
+ types$1.set(name, item.generate || item);
+ }
+ }
+
+ return function(node, options) {
+ let buffer = '';
+ let prevCode = 0;
+ let handlers = {
+ node(node) {
+ if (types$1.has(node.type)) {
+ types$1.get(node.type).call(publicApi, node);
+ } else {
+ throw new Error('Unknown node type: ' + node.type);
+ }
+ },
+ tokenBefore: tokenBefore.safe,
+ token(type, value) {
+ prevCode = this.tokenBefore(prevCode, type, value);
+
+ this.emit(value, type, false);
+
+ if (type === types.Delim && value.charCodeAt(0) === REVERSESOLIDUS) {
+ this.emit('\n', types.WhiteSpace, true);
+ }
+ },
+ emit(value) {
+ buffer += value;
+ },
+ result() {
+ return buffer;
+ }
+ };
+
+ if (options) {
+ if (typeof options.decorator === 'function') {
+ handlers = options.decorator(handlers);
+ }
+
+ if (options.sourceMap) {
+ handlers = sourceMap.generateSourceMap(handlers);
+ }
+
+ if (options.mode in tokenBefore) {
+ handlers.tokenBefore = tokenBefore[options.mode];
+ }
+ }
+
+ const publicApi = {
+ node: (node) => handlers.node(node),
+ children: processChildren,
+ token: (type, value) => handlers.token(type, value),
+ tokenize: processChunk
+ };
+
+ handlers.node(node);
+
+ return handlers.result();
+ };
+}
+
+exports.createGenerator = createGenerator;
diff --git a/node_modules/css-tree/cjs/generator/index.cjs b/node_modules/css-tree/cjs/generator/index.cjs
new file mode 100644
index 0000000..5c87cd3
--- /dev/null
+++ b/node_modules/css-tree/cjs/generator/index.cjs
@@ -0,0 +1,8 @@
+'use strict';
+
+const create = require('./create.cjs');
+const generator = require('../syntax/config/generator.cjs');
+
+const index = create.createGenerator(generator);
+
+module.exports = index;
diff --git a/node_modules/css-tree/cjs/generator/sourceMap.cjs b/node_modules/css-tree/cjs/generator/sourceMap.cjs
new file mode 100644
index 0000000..efbc5b9
--- /dev/null
+++ b/node_modules/css-tree/cjs/generator/sourceMap.cjs
@@ -0,0 +1,96 @@
+'use strict';
+
+const sourceMapGenerator_js = require('source-map-js/lib/source-map-generator.js');
+
+const trackNodes = new Set(['Atrule', 'Selector', 'Declaration']);
+
+function generateSourceMap(handlers) {
+ const map = new sourceMapGenerator_js.SourceMapGenerator();
+ const generated = {
+ line: 1,
+ column: 0
+ };
+ const original = {
+ line: 0, // should be zero to add first mapping
+ column: 0
+ };
+ const activatedGenerated = {
+ line: 1,
+ column: 0
+ };
+ const activatedMapping = {
+ generated: activatedGenerated
+ };
+ let line = 1;
+ let column = 0;
+ let sourceMappingActive = false;
+
+ const origHandlersNode = handlers.node;
+ handlers.node = function(node) {
+ if (node.loc && node.loc.start && trackNodes.has(node.type)) {
+ const nodeLine = node.loc.start.line;
+ const nodeColumn = node.loc.start.column - 1;
+
+ if (original.line !== nodeLine ||
+ original.column !== nodeColumn) {
+ original.line = nodeLine;
+ original.column = nodeColumn;
+
+ generated.line = line;
+ generated.column = column;
+
+ if (sourceMappingActive) {
+ sourceMappingActive = false;
+ if (generated.line !== activatedGenerated.line ||
+ generated.column !== activatedGenerated.column) {
+ map.addMapping(activatedMapping);
+ }
+ }
+
+ sourceMappingActive = true;
+ map.addMapping({
+ source: node.loc.source,
+ original,
+ generated
+ });
+ }
+ }
+
+ origHandlersNode.call(this, node);
+
+ if (sourceMappingActive && trackNodes.has(node.type)) {
+ activatedGenerated.line = line;
+ activatedGenerated.column = column;
+ }
+ };
+
+ const origHandlersEmit = handlers.emit;
+ handlers.emit = function(value, type, auto) {
+ for (let i = 0; i < value.length; i++) {
+ if (value.charCodeAt(i) === 10) { // \n
+ line++;
+ column = 0;
+ } else {
+ column++;
+ }
+ }
+
+ origHandlersEmit(value, type, auto);
+ };
+
+ const origHandlersResult = handlers.result;
+ handlers.result = function() {
+ if (sourceMappingActive) {
+ map.addMapping(activatedMapping);
+ }
+
+ return {
+ css: origHandlersResult(),
+ map
+ };
+ };
+
+ return handlers;
+}
+
+exports.generateSourceMap = generateSourceMap;
diff --git a/node_modules/css-tree/cjs/generator/token-before.cjs b/node_modules/css-tree/cjs/generator/token-before.cjs
new file mode 100644
index 0000000..87bf4a3
--- /dev/null
+++ b/node_modules/css-tree/cjs/generator/token-before.cjs
@@ -0,0 +1,170 @@
+'use strict';
+
+const types = require('../tokenizer/types.cjs');
+
+const PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)
+const HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)
+
+const code = (type, value) => {
+ if (type === types.Delim) {
+ type = value;
+ }
+
+ if (typeof type === 'string') {
+ const charCode = type.charCodeAt(0);
+ return charCode > 0x7F ? 0x8000 : charCode << 8;
+ }
+
+ return type;
+};
+
+// https://www.w3.org/TR/css-syntax-3/#serialization
+// The only requirement for serialization is that it must "round-trip" with parsing,
+// that is, parsing the stylesheet must produce the same data structures as parsing,
+// serializing, and parsing again, except for consecutive s,
+// which may be collapsed into a single token.
+
+const specPairs = [
+ [types.Ident, types.Ident],
+ [types.Ident, types.Function],
+ [types.Ident, types.Url],
+ [types.Ident, types.BadUrl],
+ [types.Ident, '-'],
+ [types.Ident, types.Number],
+ [types.Ident, types.Percentage],
+ [types.Ident, types.Dimension],
+ [types.Ident, types.CDC],
+ [types.Ident, types.LeftParenthesis],
+
+ [types.AtKeyword, types.Ident],
+ [types.AtKeyword, types.Function],
+ [types.AtKeyword, types.Url],
+ [types.AtKeyword, types.BadUrl],
+ [types.AtKeyword, '-'],
+ [types.AtKeyword, types.Number],
+ [types.AtKeyword, types.Percentage],
+ [types.AtKeyword, types.Dimension],
+ [types.AtKeyword, types.CDC],
+
+ [types.Hash, types.Ident],
+ [types.Hash, types.Function],
+ [types.Hash, types.Url],
+ [types.Hash, types.BadUrl],
+ [types.Hash, '-'],
+ [types.Hash, types.Number],
+ [types.Hash, types.Percentage],
+ [types.Hash, types.Dimension],
+ [types.Hash, types.CDC],
+
+ [types.Dimension, types.Ident],
+ [types.Dimension, types.Function],
+ [types.Dimension, types.Url],
+ [types.Dimension, types.BadUrl],
+ [types.Dimension, '-'],
+ [types.Dimension, types.Number],
+ [types.Dimension, types.Percentage],
+ [types.Dimension, types.Dimension],
+ [types.Dimension, types.CDC],
+
+ ['#', types.Ident],
+ ['#', types.Function],
+ ['#', types.Url],
+ ['#', types.BadUrl],
+ ['#', '-'],
+ ['#', types.Number],
+ ['#', types.Percentage],
+ ['#', types.Dimension],
+ ['#', types.CDC], // https://github.com/w3c/csswg-drafts/pull/6874
+
+ ['-', types.Ident],
+ ['-', types.Function],
+ ['-', types.Url],
+ ['-', types.BadUrl],
+ ['-', '-'],
+ ['-', types.Number],
+ ['-', types.Percentage],
+ ['-', types.Dimension],
+ ['-', types.CDC], // https://github.com/w3c/csswg-drafts/pull/6874
+
+ [types.Number, types.Ident],
+ [types.Number, types.Function],
+ [types.Number, types.Url],
+ [types.Number, types.BadUrl],
+ [types.Number, types.Number],
+ [types.Number, types.Percentage],
+ [types.Number, types.Dimension],
+ [types.Number, '%'],
+ [types.Number, types.CDC], // https://github.com/w3c/csswg-drafts/pull/6874
+
+ ['@', types.Ident],
+ ['@', types.Function],
+ ['@', types.Url],
+ ['@', types.BadUrl],
+ ['@', '-'],
+ ['@', types.CDC], // https://github.com/w3c/csswg-drafts/pull/6874
+
+ ['.', types.Number],
+ ['.', types.Percentage],
+ ['.', types.Dimension],
+
+ ['+', types.Number],
+ ['+', types.Percentage],
+ ['+', types.Dimension],
+
+ ['/', '*']
+];
+// validate with scripts/generate-safe
+const safePairs = specPairs.concat([
+ [types.Ident, types.Hash],
+
+ [types.Dimension, types.Hash],
+
+ [types.Hash, types.Hash],
+
+ [types.AtKeyword, types.LeftParenthesis],
+ [types.AtKeyword, types.String],
+ [types.AtKeyword, types.Colon],
+
+ [types.Percentage, types.Percentage],
+ [types.Percentage, types.Dimension],
+ [types.Percentage, types.Function],
+ [types.Percentage, '-'],
+
+ [types.RightParenthesis, types.Ident],
+ [types.RightParenthesis, types.Function],
+ [types.RightParenthesis, types.Percentage],
+ [types.RightParenthesis, types.Dimension],
+ [types.RightParenthesis, types.Hash],
+ [types.RightParenthesis, '-']
+]);
+
+function createMap(pairs) {
+ const isWhiteSpaceRequired = new Set(
+ pairs.map(([prev, next]) => (code(prev) << 16 | code(next)))
+ );
+
+ return function(prevCode, type, value) {
+ const nextCode = code(type, value);
+ const nextCharCode = value.charCodeAt(0);
+ const emitWs =
+ (nextCharCode === HYPHENMINUS &&
+ type !== types.Ident &&
+ type !== types.Function &&
+ type !== types.CDC) ||
+ (nextCharCode === PLUSSIGN)
+ ? isWhiteSpaceRequired.has(prevCode << 16 | nextCharCode << 8)
+ : isWhiteSpaceRequired.has(prevCode << 16 | nextCode);
+
+ if (emitWs) {
+ this.emit(' ', types.WhiteSpace, true);
+ }
+
+ return nextCode;
+ };
+}
+
+const spec = createMap(specPairs);
+const safe = createMap(safePairs);
+
+exports.safe = safe;
+exports.spec = spec;
diff --git a/node_modules/css-tree/cjs/index.cjs b/node_modules/css-tree/cjs/index.cjs
new file mode 100644
index 0000000..b781d15
--- /dev/null
+++ b/node_modules/css-tree/cjs/index.cjs
@@ -0,0 +1,63 @@
+'use strict';
+
+const index$1 = require('./syntax/index.cjs');
+const version = require('./version.cjs');
+const create = require('./syntax/create.cjs');
+const List = require('./utils/List.cjs');
+const Lexer = require('./lexer/Lexer.cjs');
+const index = require('./definition-syntax/index.cjs');
+const clone = require('./utils/clone.cjs');
+const names$1 = require('./utils/names.cjs');
+const ident = require('./utils/ident.cjs');
+const string = require('./utils/string.cjs');
+const url = require('./utils/url.cjs');
+const types = require('./tokenizer/types.cjs');
+const names = require('./tokenizer/names.cjs');
+const TokenStream = require('./tokenizer/TokenStream.cjs');
+
+const {
+ tokenize,
+ parse,
+ generate,
+ lexer,
+ createLexer,
+
+ walk,
+ find,
+ findLast,
+ findAll,
+
+ toPlainObject,
+ fromPlainObject,
+
+ fork
+} = index$1;
+
+exports.version = version.version;
+exports.createSyntax = create;
+exports.List = List.List;
+exports.Lexer = Lexer.Lexer;
+exports.definitionSyntax = index;
+exports.clone = clone.clone;
+exports.isCustomProperty = names$1.isCustomProperty;
+exports.keyword = names$1.keyword;
+exports.property = names$1.property;
+exports.vendorPrefix = names$1.vendorPrefix;
+exports.ident = ident;
+exports.string = string;
+exports.url = url;
+exports.tokenTypes = types;
+exports.tokenNames = names;
+exports.TokenStream = TokenStream.TokenStream;
+exports.createLexer = createLexer;
+exports.find = find;
+exports.findAll = findAll;
+exports.findLast = findLast;
+exports.fork = fork;
+exports.fromPlainObject = fromPlainObject;
+exports.generate = generate;
+exports.lexer = lexer;
+exports.parse = parse;
+exports.toPlainObject = toPlainObject;
+exports.tokenize = tokenize;
+exports.walk = walk;
diff --git a/node_modules/css-tree/cjs/lexer/Lexer.cjs b/node_modules/css-tree/cjs/lexer/Lexer.cjs
new file mode 100644
index 0000000..46380fa
--- /dev/null
+++ b/node_modules/css-tree/cjs/lexer/Lexer.cjs
@@ -0,0 +1,470 @@
+'use strict';
+
+const error = require('./error.cjs');
+const names = require('../utils/names.cjs');
+const genericConst = require('./generic-const.cjs');
+const generic = require('./generic.cjs');
+const units = require('./units.cjs');
+const prepareTokens = require('./prepare-tokens.cjs');
+const matchGraph = require('./match-graph.cjs');
+const match = require('./match.cjs');
+const trace = require('./trace.cjs');
+const search = require('./search.cjs');
+const structure = require('./structure.cjs');
+const parse = require('../definition-syntax/parse.cjs');
+const generate = require('../definition-syntax/generate.cjs');
+const walk = require('../definition-syntax/walk.cjs');
+
+const cssWideKeywordsSyntax = matchGraph.buildMatchGraph(genericConst.cssWideKeywords.join(' | '));
+
+function dumpMapSyntax(map, compact, syntaxAsAst) {
+ const result = {};
+
+ for (const name in map) {
+ if (map[name].syntax) {
+ result[name] = syntaxAsAst
+ ? map[name].syntax
+ : generate.generate(map[name].syntax, { compact });
+ }
+ }
+
+ return result;
+}
+
+function dumpAtruleMapSyntax(map, compact, syntaxAsAst) {
+ const result = {};
+
+ for (const [name, atrule] of Object.entries(map)) {
+ result[name] = {
+ prelude: atrule.prelude && (
+ syntaxAsAst
+ ? atrule.prelude.syntax
+ : generate.generate(atrule.prelude.syntax, { compact })
+ ),
+ descriptors: atrule.descriptors && dumpMapSyntax(atrule.descriptors, compact, syntaxAsAst)
+ };
+ }
+
+ return result;
+}
+
+function valueHasVar(tokens) {
+ for (let i = 0; i < tokens.length; i++) {
+ if (tokens[i].value.toLowerCase() === 'var(') {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+function buildMatchResult(matched, error, iterations) {
+ return {
+ matched,
+ iterations,
+ error,
+ ...trace
+ };
+}
+
+function matchSyntax(lexer, syntax, value, useCssWideKeywords) {
+ const tokens = prepareTokens(value, lexer.syntax);
+ let result;
+
+ if (valueHasVar(tokens)) {
+ return buildMatchResult(null, new Error('Matching for a tree with var() is not supported'));
+ }
+
+ if (useCssWideKeywords) {
+ result = match.matchAsTree(tokens, lexer.cssWideKeywordsSyntax, lexer);
+ }
+
+ if (!useCssWideKeywords || !result.match) {
+ result = match.matchAsTree(tokens, syntax.match, lexer);
+ if (!result.match) {
+ return buildMatchResult(
+ null,
+ new error.SyntaxMatchError(result.reason, syntax.syntax, value, result),
+ result.iterations
+ );
+ }
+ }
+
+ return buildMatchResult(result.match, null, result.iterations);
+}
+
+class Lexer {
+ constructor(config, syntax, structure$1) {
+ this.cssWideKeywordsSyntax = cssWideKeywordsSyntax;
+ this.syntax = syntax;
+ this.generic = false;
+ this.units = { ...units };
+ this.atrules = Object.create(null);
+ this.properties = Object.create(null);
+ this.types = Object.create(null);
+ this.structure = structure$1 || structure.getStructureFromConfig(config);
+
+ if (config) {
+ if (config.units) {
+ for (const group of Object.keys(units)) {
+ if (Array.isArray(config.units[group])) {
+ this.units[group] = config.units[group];
+ }
+ }
+ }
+
+ if (config.types) {
+ for (const name in config.types) {
+ this.addType_(name, config.types[name]);
+ }
+ }
+
+ if (config.generic) {
+ this.generic = true;
+ for (const [name, value] of Object.entries(generic.createGenericTypes(this.units))) {
+ this.addType_(name, value);
+ }
+ }
+
+ if (config.atrules) {
+ for (const name in config.atrules) {
+ this.addAtrule_(name, config.atrules[name]);
+ }
+ }
+
+ if (config.properties) {
+ for (const name in config.properties) {
+ this.addProperty_(name, config.properties[name]);
+ }
+ }
+ }
+ }
+
+ checkStructure(ast) {
+ function collectWarning(node, message) {
+ warns.push({ node, message });
+ }
+
+ const structure = this.structure;
+ const warns = [];
+
+ this.syntax.walk(ast, function(node) {
+ if (structure.hasOwnProperty(node.type)) {
+ structure[node.type].check(node, collectWarning);
+ } else {
+ collectWarning(node, 'Unknown node type `' + node.type + '`');
+ }
+ });
+
+ return warns.length ? warns : false;
+ }
+
+ createDescriptor(syntax, type, name, parent = null) {
+ const ref = {
+ type,
+ name
+ };
+ const descriptor = {
+ type,
+ name,
+ parent,
+ serializable: typeof syntax === 'string' || (syntax && typeof syntax.type === 'string'),
+ syntax: null,
+ match: null
+ };
+
+ if (typeof syntax === 'function') {
+ descriptor.match = matchGraph.buildMatchGraph(syntax, ref);
+ } else {
+ if (typeof syntax === 'string') {
+ // lazy parsing on first access
+ Object.defineProperty(descriptor, 'syntax', {
+ get() {
+ Object.defineProperty(descriptor, 'syntax', {
+ value: parse.parse(syntax)
+ });
+
+ return descriptor.syntax;
+ }
+ });
+ } else {
+ descriptor.syntax = syntax;
+ }
+
+ // lazy graph build on first access
+ Object.defineProperty(descriptor, 'match', {
+ get() {
+ Object.defineProperty(descriptor, 'match', {
+ value: matchGraph.buildMatchGraph(descriptor.syntax, ref)
+ });
+
+ return descriptor.match;
+ }
+ });
+ }
+
+ return descriptor;
+ }
+ addAtrule_(name, syntax) {
+ if (!syntax) {
+ return;
+ }
+
+ this.atrules[name] = {
+ type: 'Atrule',
+ name: name,
+ prelude: syntax.prelude ? this.createDescriptor(syntax.prelude, 'AtrulePrelude', name) : null,
+ descriptors: syntax.descriptors
+ ? Object.keys(syntax.descriptors).reduce(
+ (map, descName) => {
+ map[descName] = this.createDescriptor(syntax.descriptors[descName], 'AtruleDescriptor', descName, name);
+ return map;
+ },
+ Object.create(null)
+ )
+ : null
+ };
+ }
+ addProperty_(name, syntax) {
+ if (!syntax) {
+ return;
+ }
+
+ this.properties[name] = this.createDescriptor(syntax, 'Property', name);
+ }
+ addType_(name, syntax) {
+ if (!syntax) {
+ return;
+ }
+
+ this.types[name] = this.createDescriptor(syntax, 'Type', name);
+ }
+
+ checkAtruleName(atruleName) {
+ if (!this.getAtrule(atruleName)) {
+ return new error.SyntaxReferenceError('Unknown at-rule', '@' + atruleName);
+ }
+ }
+ checkAtrulePrelude(atruleName, prelude) {
+ const error = this.checkAtruleName(atruleName);
+
+ if (error) {
+ return error;
+ }
+
+ const atrule = this.getAtrule(atruleName);
+
+ if (!atrule.prelude && prelude) {
+ return new SyntaxError('At-rule `@' + atruleName + '` should not contain a prelude');
+ }
+
+ if (atrule.prelude && !prelude) {
+ if (!matchSyntax(this, atrule.prelude, '', false).matched) {
+ return new SyntaxError('At-rule `@' + atruleName + '` should contain a prelude');
+ }
+ }
+ }
+ checkAtruleDescriptorName(atruleName, descriptorName) {
+ const error$1 = this.checkAtruleName(atruleName);
+
+ if (error$1) {
+ return error$1;
+ }
+
+ const atrule = this.getAtrule(atruleName);
+ const descriptor = names.keyword(descriptorName);
+
+ if (!atrule.descriptors) {
+ return new SyntaxError('At-rule `@' + atruleName + '` has no known descriptors');
+ }
+
+ if (!atrule.descriptors[descriptor.name] &&
+ !atrule.descriptors[descriptor.basename]) {
+ return new error.SyntaxReferenceError('Unknown at-rule descriptor', descriptorName);
+ }
+ }
+ checkPropertyName(propertyName) {
+ if (!this.getProperty(propertyName)) {
+ return new error.SyntaxReferenceError('Unknown property', propertyName);
+ }
+ }
+
+ matchAtrulePrelude(atruleName, prelude) {
+ const error = this.checkAtrulePrelude(atruleName, prelude);
+
+ if (error) {
+ return buildMatchResult(null, error);
+ }
+
+ const atrule = this.getAtrule(atruleName);
+
+ if (!atrule.prelude) {
+ return buildMatchResult(null, null);
+ }
+
+ return matchSyntax(this, atrule.prelude, prelude || '', false);
+ }
+ matchAtruleDescriptor(atruleName, descriptorName, value) {
+ const error = this.checkAtruleDescriptorName(atruleName, descriptorName);
+
+ if (error) {
+ return buildMatchResult(null, error);
+ }
+
+ const atrule = this.getAtrule(atruleName);
+ const descriptor = names.keyword(descriptorName);
+
+ return matchSyntax(this, atrule.descriptors[descriptor.name] || atrule.descriptors[descriptor.basename], value, false);
+ }
+ matchDeclaration(node) {
+ if (node.type !== 'Declaration') {
+ return buildMatchResult(null, new Error('Not a Declaration node'));
+ }
+
+ return this.matchProperty(node.property, node.value);
+ }
+ matchProperty(propertyName, value) {
+ // don't match syntax for a custom property at the moment
+ if (names.property(propertyName).custom) {
+ return buildMatchResult(null, new Error('Lexer matching doesn\'t applicable for custom properties'));
+ }
+
+ const error = this.checkPropertyName(propertyName);
+
+ if (error) {
+ return buildMatchResult(null, error);
+ }
+
+ return matchSyntax(this, this.getProperty(propertyName), value, true);
+ }
+ matchType(typeName, value) {
+ const typeSyntax = this.getType(typeName);
+
+ if (!typeSyntax) {
+ return buildMatchResult(null, new error.SyntaxReferenceError('Unknown type', typeName));
+ }
+
+ return matchSyntax(this, typeSyntax, value, false);
+ }
+ match(syntax, value) {
+ if (typeof syntax !== 'string' && (!syntax || !syntax.type)) {
+ return buildMatchResult(null, new error.SyntaxReferenceError('Bad syntax'));
+ }
+
+ if (typeof syntax === 'string' || !syntax.match) {
+ syntax = this.createDescriptor(syntax, 'Type', 'anonymous');
+ }
+
+ return matchSyntax(this, syntax, value, false);
+ }
+
+ findValueFragments(propertyName, value, type, name) {
+ return search.matchFragments(this, value, this.matchProperty(propertyName, value), type, name);
+ }
+ findDeclarationValueFragments(declaration, type, name) {
+ return search.matchFragments(this, declaration.value, this.matchDeclaration(declaration), type, name);
+ }
+ findAllFragments(ast, type, name) {
+ const result = [];
+
+ this.syntax.walk(ast, {
+ visit: 'Declaration',
+ enter: (declaration) => {
+ result.push.apply(result, this.findDeclarationValueFragments(declaration, type, name));
+ }
+ });
+
+ return result;
+ }
+
+ getAtrule(atruleName, fallbackBasename = true) {
+ const atrule = names.keyword(atruleName);
+ const atruleEntry = atrule.vendor && fallbackBasename
+ ? this.atrules[atrule.name] || this.atrules[atrule.basename]
+ : this.atrules[atrule.name];
+
+ return atruleEntry || null;
+ }
+ getAtrulePrelude(atruleName, fallbackBasename = true) {
+ const atrule = this.getAtrule(atruleName, fallbackBasename);
+
+ return atrule && atrule.prelude || null;
+ }
+ getAtruleDescriptor(atruleName, name) {
+ return this.atrules.hasOwnProperty(atruleName) && this.atrules.declarators
+ ? this.atrules[atruleName].declarators[name] || null
+ : null;
+ }
+ getProperty(propertyName, fallbackBasename = true) {
+ const property = names.property(propertyName);
+ const propertyEntry = property.vendor && fallbackBasename
+ ? this.properties[property.name] || this.properties[property.basename]
+ : this.properties[property.name];
+
+ return propertyEntry || null;
+ }
+ getType(name) {
+ return hasOwnProperty.call(this.types, name) ? this.types[name] : null;
+ }
+
+ validate() {
+ function validate(syntax, name, broken, descriptor) {
+ if (broken.has(name)) {
+ return broken.get(name);
+ }
+
+ broken.set(name, false);
+ if (descriptor.syntax !== null) {
+ walk.walk(descriptor.syntax, function(node) {
+ if (node.type !== 'Type' && node.type !== 'Property') {
+ return;
+ }
+
+ const map = node.type === 'Type' ? syntax.types : syntax.properties;
+ const brokenMap = node.type === 'Type' ? brokenTypes : brokenProperties;
+
+ if (!hasOwnProperty.call(map, node.name) || validate(syntax, node.name, brokenMap, map[node.name])) {
+ broken.set(name, true);
+ }
+ }, this);
+ }
+ }
+
+ let brokenTypes = new Map();
+ let brokenProperties = new Map();
+
+ for (const key in this.types) {
+ validate(this, key, brokenTypes, this.types[key]);
+ }
+
+ for (const key in this.properties) {
+ validate(this, key, brokenProperties, this.properties[key]);
+ }
+
+ brokenTypes = [...brokenTypes.keys()].filter(name => brokenTypes.get(name));
+ brokenProperties = [...brokenProperties.keys()].filter(name => brokenProperties.get(name));
+
+ if (brokenTypes.length || brokenProperties.length) {
+ return {
+ types: brokenTypes,
+ properties: brokenProperties
+ };
+ }
+
+ return null;
+ }
+ dump(syntaxAsAst, pretty) {
+ return {
+ generic: this.generic,
+ units: this.units,
+ types: dumpMapSyntax(this.types, !pretty, syntaxAsAst),
+ properties: dumpMapSyntax(this.properties, !pretty, syntaxAsAst),
+ atrules: dumpAtruleMapSyntax(this.atrules, !pretty, syntaxAsAst)
+ };
+ }
+ toString() {
+ return JSON.stringify(this.dump());
+ }
+}
+
+exports.Lexer = Lexer;
diff --git a/node_modules/css-tree/cjs/lexer/error.cjs b/node_modules/css-tree/cjs/lexer/error.cjs
new file mode 100644
index 0000000..8d252ee
--- /dev/null
+++ b/node_modules/css-tree/cjs/lexer/error.cjs
@@ -0,0 +1,128 @@
+'use strict';
+
+const createCustomError = require('../utils/create-custom-error.cjs');
+const generate = require('../definition-syntax/generate.cjs');
+
+const defaultLoc = { offset: 0, line: 1, column: 1 };
+
+function locateMismatch(matchResult, node) {
+ const tokens = matchResult.tokens;
+ const longestMatch = matchResult.longestMatch;
+ const mismatchNode = longestMatch < tokens.length ? tokens[longestMatch].node || null : null;
+ const badNode = mismatchNode !== node ? mismatchNode : null;
+ let mismatchOffset = 0;
+ let mismatchLength = 0;
+ let entries = 0;
+ let css = '';
+ let start;
+ let end;
+
+ for (let i = 0; i < tokens.length; i++) {
+ const token = tokens[i].value;
+
+ if (i === longestMatch) {
+ mismatchLength = token.length;
+ mismatchOffset = css.length;
+ }
+
+ if (badNode !== null && tokens[i].node === badNode) {
+ if (i <= longestMatch) {
+ entries++;
+ } else {
+ entries = 0;
+ }
+ }
+
+ css += token;
+ }
+
+ if (longestMatch === tokens.length || entries > 1) { // last
+ start = fromLoc(badNode || node, 'end') || buildLoc(defaultLoc, css);
+ end = buildLoc(start);
+ } else {
+ start = fromLoc(badNode, 'start') ||
+ buildLoc(fromLoc(node, 'start') || defaultLoc, css.slice(0, mismatchOffset));
+ end = fromLoc(badNode, 'end') ||
+ buildLoc(start, css.substr(mismatchOffset, mismatchLength));
+ }
+
+ return {
+ css,
+ mismatchOffset,
+ mismatchLength,
+ start,
+ end
+ };
+}
+
+function fromLoc(node, point) {
+ const value = node && node.loc && node.loc[point];
+
+ if (value) {
+ return 'line' in value ? buildLoc(value) : value;
+ }
+
+ return null;
+}
+
+function buildLoc({ offset, line, column }, extra) {
+ const loc = {
+ offset,
+ line,
+ column
+ };
+
+ if (extra) {
+ const lines = extra.split(/\n|\r\n?|\f/);
+
+ loc.offset += extra.length;
+ loc.line += lines.length - 1;
+ loc.column = lines.length === 1 ? loc.column + extra.length : lines.pop().length + 1;
+ }
+
+ return loc;
+}
+
+const SyntaxReferenceError = function(type, referenceName) {
+ const error = createCustomError.createCustomError(
+ 'SyntaxReferenceError',
+ type + (referenceName ? ' `' + referenceName + '`' : '')
+ );
+
+ error.reference = referenceName;
+
+ return error;
+};
+
+const SyntaxMatchError = function(message, syntax, node, matchResult) {
+ const error = createCustomError.createCustomError('SyntaxMatchError', message);
+ const {
+ css,
+ mismatchOffset,
+ mismatchLength,
+ start,
+ end
+ } = locateMismatch(matchResult, node);
+
+ error.rawMessage = message;
+ error.syntax = syntax ? generate.generate(syntax) : '';
+ error.css = css;
+ error.mismatchOffset = mismatchOffset;
+ error.mismatchLength = mismatchLength;
+ error.message = message + '\n' +
+ ' syntax: ' + error.syntax + '\n' +
+ ' value: ' + (css || '') + '\n' +
+ ' --------' + new Array(error.mismatchOffset + 1).join('-') + '^';
+
+ Object.assign(error, start);
+ error.loc = {
+ source: (node && node.loc && node.loc.source) || '',
+ start,
+ end
+ };
+
+ return error;
+};
+
+exports.SyntaxMatchError = SyntaxMatchError;
+exports.SyntaxReferenceError = SyntaxReferenceError;
diff --git a/node_modules/css-tree/cjs/lexer/generic-an-plus-b.cjs b/node_modules/css-tree/cjs/lexer/generic-an-plus-b.cjs
new file mode 100644
index 0000000..a5dfba3
--- /dev/null
+++ b/node_modules/css-tree/cjs/lexer/generic-an-plus-b.cjs
@@ -0,0 +1,235 @@
+'use strict';
+
+const charCodeDefinitions = require('../tokenizer/char-code-definitions.cjs');
+const types = require('../tokenizer/types.cjs');
+const utils = require('../tokenizer/utils.cjs');
+
+const PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)
+const HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)
+const N = 0x006E; // U+006E LATIN SMALL LETTER N (n)
+const DISALLOW_SIGN = true;
+const ALLOW_SIGN = false;
+
+function isDelim(token, code) {
+ return token !== null && token.type === types.Delim && token.value.charCodeAt(0) === code;
+}
+
+function skipSC(token, offset, getNextToken) {
+ while (token !== null && (token.type === types.WhiteSpace || token.type === types.Comment)) {
+ token = getNextToken(++offset);
+ }
+
+ return offset;
+}
+
+function checkInteger(token, valueOffset, disallowSign, offset) {
+ if (!token) {
+ return 0;
+ }
+
+ const code = token.value.charCodeAt(valueOffset);
+
+ if (code === PLUSSIGN || code === HYPHENMINUS) {
+ if (disallowSign) {
+ // Number sign is not allowed
+ return 0;
+ }
+ valueOffset++;
+ }
+
+ for (; valueOffset < token.value.length; valueOffset++) {
+ if (!charCodeDefinitions.isDigit(token.value.charCodeAt(valueOffset))) {
+ // Integer is expected
+ return 0;
+ }
+ }
+
+ return offset + 1;
+}
+
+// ...
+// ... ['+' | '-']
+function consumeB(token, offset_, getNextToken) {
+ let sign = false;
+ let offset = skipSC(token, offset_, getNextToken);
+
+ token = getNextToken(offset);
+
+ if (token === null) {
+ return offset_;
+ }
+
+ if (token.type !== types.Number) {
+ if (isDelim(token, PLUSSIGN) || isDelim(token, HYPHENMINUS)) {
+ sign = true;
+ offset = skipSC(getNextToken(++offset), offset, getNextToken);
+ token = getNextToken(offset);
+
+ if (token === null || token.type !== types.Number) {
+ return 0;
+ }
+ } else {
+ return offset_;
+ }
+ }
+
+ if (!sign) {
+ const code = token.value.charCodeAt(0);
+ if (code !== PLUSSIGN && code !== HYPHENMINUS) {
+ // Number sign is expected
+ return 0;
+ }
+ }
+
+ return checkInteger(token, sign ? 0 : 1, sign, offset);
+}
+
+// An+B microsyntax https://www.w3.org/TR/css-syntax-3/#anb
+function anPlusB(token, getNextToken) {
+ /* eslint-disable brace-style*/
+ let offset = 0;
+
+ if (!token) {
+ return 0;
+ }
+
+ //
+ if (token.type === types.Number) {
+ return checkInteger(token, 0, ALLOW_SIGN, offset); // b
+ }
+
+ // -n
+ // -n
+ // -n ['+' | '-']
+ // -n-
+ //
+ else if (token.type === types.Ident && token.value.charCodeAt(0) === HYPHENMINUS) {
+ // expect 1st char is N
+ if (!utils.cmpChar(token.value, 1, N)) {
+ return 0;
+ }
+
+ switch (token.value.length) {
+ // -n
+ // -n
+ // -n ['+' | '-']
+ case 2:
+ return consumeB(getNextToken(++offset), offset, getNextToken);
+
+ // -n-
+ case 3:
+ if (token.value.charCodeAt(2) !== HYPHENMINUS) {
+ return 0;
+ }
+
+ offset = skipSC(getNextToken(++offset), offset, getNextToken);
+ token = getNextToken(offset);
+
+ return checkInteger(token, 0, DISALLOW_SIGN, offset);
+
+ //
+ default:
+ if (token.value.charCodeAt(2) !== HYPHENMINUS) {
+ return 0;
+ }
+
+ return checkInteger(token, 3, DISALLOW_SIGN, offset);
+ }
+ }
+
+ // '+'? n
+ // '+'? n
+ // '+'? n ['+' | '-']
+ // '+'? n-
+ // '+'?
+ else if (token.type === types.Ident || (isDelim(token, PLUSSIGN) && getNextToken(offset + 1).type === types.Ident)) {
+ // just ignore a plus
+ if (token.type !== types.Ident) {
+ token = getNextToken(++offset);
+ }
+
+ if (token === null || !utils.cmpChar(token.value, 0, N)) {
+ return 0;
+ }
+
+ switch (token.value.length) {
+ // '+'? n
+ // '+'? n
+ // '+'? n ['+' | '-']
+ case 1:
+ return consumeB(getNextToken(++offset), offset, getNextToken);
+
+ // '+'? n-
+ case 2:
+ if (token.value.charCodeAt(1) !== HYPHENMINUS) {
+ return 0;
+ }
+
+ offset = skipSC(getNextToken(++offset), offset, getNextToken);
+ token = getNextToken(offset);
+
+ return checkInteger(token, 0, DISALLOW_SIGN, offset);
+
+ // '+'?
+ default:
+ if (token.value.charCodeAt(1) !== HYPHENMINUS) {
+ return 0;
+ }
+
+ return checkInteger(token, 2, DISALLOW_SIGN, offset);
+ }
+ }
+
+ //
+ //
+ //
+ //
+ // ['+' | '-']
+ else if (token.type === types.Dimension) {
+ let code = token.value.charCodeAt(0);
+ let sign = code === PLUSSIGN || code === HYPHENMINUS ? 1 : 0;
+ let i = sign;
+
+ for (; i < token.value.length; i++) {
+ if (!charCodeDefinitions.isDigit(token.value.charCodeAt(i))) {
+ break;
+ }
+ }
+
+ if (i === sign) {
+ // Integer is expected
+ return 0;
+ }
+
+ if (!utils.cmpChar(token.value, i, N)) {
+ return 0;
+ }
+
+ //
+ //
+ // ['+' | '-']
+ if (i + 1 === token.value.length) {
+ return consumeB(getNextToken(++offset), offset, getNextToken);
+ } else {
+ if (token.value.charCodeAt(i + 1) !== HYPHENMINUS) {
+ return 0;
+ }
+
+ //
+ if (i + 2 === token.value.length) {
+ offset = skipSC(getNextToken(++offset), offset, getNextToken);
+ token = getNextToken(offset);
+
+ return checkInteger(token, 0, DISALLOW_SIGN, offset);
+ }
+ //
+ else {
+ return checkInteger(token, i + 2, DISALLOW_SIGN, offset);
+ }
+ }
+ }
+
+ return 0;
+}
+
+module.exports = anPlusB;
diff --git a/node_modules/css-tree/cjs/lexer/generic-const.cjs b/node_modules/css-tree/cjs/lexer/generic-const.cjs
new file mode 100644
index 0000000..9b9f615
--- /dev/null
+++ b/node_modules/css-tree/cjs/lexer/generic-const.cjs
@@ -0,0 +1,12 @@
+'use strict';
+
+// https://drafts.csswg.org/css-cascade-5/
+const cssWideKeywords = [
+ 'initial',
+ 'inherit',
+ 'unset',
+ 'revert',
+ 'revert-layer'
+];
+
+exports.cssWideKeywords = cssWideKeywords;
diff --git a/node_modules/css-tree/cjs/lexer/generic-urange.cjs b/node_modules/css-tree/cjs/lexer/generic-urange.cjs
new file mode 100644
index 0000000..ce167bb
--- /dev/null
+++ b/node_modules/css-tree/cjs/lexer/generic-urange.cjs
@@ -0,0 +1,149 @@
+'use strict';
+
+const charCodeDefinitions = require('../tokenizer/char-code-definitions.cjs');
+const types = require('../tokenizer/types.cjs');
+const utils = require('../tokenizer/utils.cjs');
+
+const PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)
+const HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)
+const QUESTIONMARK = 0x003F; // U+003F QUESTION MARK (?)
+const U = 0x0075; // U+0075 LATIN SMALL LETTER U (u)
+
+function isDelim(token, code) {
+ return token !== null && token.type === types.Delim && token.value.charCodeAt(0) === code;
+}
+
+function startsWith(token, code) {
+ return token.value.charCodeAt(0) === code;
+}
+
+function hexSequence(token, offset, allowDash) {
+ let hexlen = 0;
+
+ for (let pos = offset; pos < token.value.length; pos++) {
+ const code = token.value.charCodeAt(pos);
+
+ if (code === HYPHENMINUS && allowDash && hexlen !== 0) {
+ hexSequence(token, offset + hexlen + 1, false);
+ return 6; // dissallow following question marks
+ }
+
+ if (!charCodeDefinitions.isHexDigit(code)) {
+ return 0; // not a hex digit
+ }
+
+ if (++hexlen > 6) {
+ return 0; // too many hex digits
+ } }
+
+ return hexlen;
+}
+
+function withQuestionMarkSequence(consumed, length, getNextToken) {
+ if (!consumed) {
+ return 0; // nothing consumed
+ }
+
+ while (isDelim(getNextToken(length), QUESTIONMARK)) {
+ if (++consumed > 6) {
+ return 0; // too many question marks
+ }
+
+ length++;
+ }
+
+ return length;
+}
+
+// https://drafts.csswg.org/css-syntax/#urange
+// Informally, the production has three forms:
+// U+0001
+// Defines a range consisting of a single code point, in this case the code point "1".
+// U+0001-00ff
+// Defines a range of codepoints between the first and the second value, in this case
+// the range between "1" and "ff" (255 in decimal) inclusive.
+// U+00??
+// Defines a range of codepoints where the "?" characters range over all hex digits,
+// in this case defining the same as the value U+0000-00ff.
+// In each form, a maximum of 6 digits is allowed for each hexadecimal number (if you treat "?" as a hexadecimal digit).
+//
+// =
+// u '+' '?'* |
+// u '?'* |
+// u '?'* |
+// u |
+// u |
+// u '+' '?'+
+function urange(token, getNextToken) {
+ let length = 0;
+
+ // should start with `u` or `U`
+ if (token === null || token.type !== types.Ident || !utils.cmpChar(token.value, 0, U)) {
+ return 0;
+ }
+
+ token = getNextToken(++length);
+ if (token === null) {
+ return 0;
+ }
+
+ // u '+' '?'*
+ // u '+' '?'+
+ if (isDelim(token, PLUSSIGN)) {
+ token = getNextToken(++length);
+ if (token === null) {
+ return 0;
+ }
+
+ if (token.type === types.Ident) {
+ // u '+' '?'*
+ return withQuestionMarkSequence(hexSequence(token, 0, true), ++length, getNextToken);
+ }
+
+ if (isDelim(token, QUESTIONMARK)) {
+ // u '+' '?'+
+ return withQuestionMarkSequence(1, ++length, getNextToken);
+ }
+
+ // Hex digit or question mark is expected
+ return 0;
+ }
+
+ // u '?'*
+ // u
+ // u
+ if (token.type === types.Number) {
+ const consumedHexLength = hexSequence(token, 1, true);
+ if (consumedHexLength === 0) {
+ return 0;
+ }
+
+ token = getNextToken(++length);
+ if (token === null) {
+ // u
+ return length;
+ }
+
+ if (token.type === types.Dimension || token.type === types.Number) {
+ // u
+ // u
+ if (!startsWith(token, HYPHENMINUS) || !hexSequence(token, 1, false)) {
+ return 0;
+ }
+
+ return length + 1;
+ }
+
+ // u '?'*
+ return withQuestionMarkSequence(consumedHexLength, length, getNextToken);
+ }
+
+ // u '?'*
+ if (token.type === types.Dimension) {
+ return withQuestionMarkSequence(hexSequence(token, 1, true), ++length, getNextToken);
+ }
+
+ return 0;
+}
+
+module.exports = urange;
diff --git a/node_modules/css-tree/cjs/lexer/generic.cjs b/node_modules/css-tree/cjs/lexer/generic.cjs
new file mode 100644
index 0000000..6b9e5ce
--- /dev/null
+++ b/node_modules/css-tree/cjs/lexer/generic.cjs
@@ -0,0 +1,573 @@
+'use strict';
+
+const genericConst = require('./generic-const.cjs');
+const genericAnPlusB = require('./generic-an-plus-b.cjs');
+const genericUrange = require('./generic-urange.cjs');
+const types = require('../tokenizer/types.cjs');
+const charCodeDefinitions = require('../tokenizer/char-code-definitions.cjs');
+const utils = require('../tokenizer/utils.cjs');
+
+const calcFunctionNames = ['calc(', '-moz-calc(', '-webkit-calc('];
+const balancePair = new Map([
+ [types.Function, types.RightParenthesis],
+ [types.LeftParenthesis, types.RightParenthesis],
+ [types.LeftSquareBracket, types.RightSquareBracket],
+ [types.LeftCurlyBracket, types.RightCurlyBracket]
+]);
+
+// safe char code getter
+function charCodeAt(str, index) {
+ return index < str.length ? str.charCodeAt(index) : 0;
+}
+
+function eqStr(actual, expected) {
+ return utils.cmpStr(actual, 0, actual.length, expected);
+}
+
+function eqStrAny(actual, expected) {
+ for (let i = 0; i < expected.length; i++) {
+ if (eqStr(actual, expected[i])) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+// IE postfix hack, i.e. 123\0 or 123px\9
+function isPostfixIeHack(str, offset) {
+ if (offset !== str.length - 2) {
+ return false;
+ }
+
+ return (
+ charCodeAt(str, offset) === 0x005C && // U+005C REVERSE SOLIDUS (\)
+ charCodeDefinitions.isDigit(charCodeAt(str, offset + 1))
+ );
+}
+
+function outOfRange(opts, value, numEnd) {
+ if (opts && opts.type === 'Range') {
+ const num = Number(
+ numEnd !== undefined && numEnd !== value.length
+ ? value.substr(0, numEnd)
+ : value
+ );
+
+ if (isNaN(num)) {
+ return true;
+ }
+
+ // FIXME: when opts.min is a string it's a dimension, skip a range validation
+ // for now since it requires a type covertation which is not implmented yet
+ if (opts.min !== null && num < opts.min && typeof opts.min !== 'string') {
+ return true;
+ }
+
+ // FIXME: when opts.max is a string it's a dimension, skip a range validation
+ // for now since it requires a type covertation which is not implmented yet
+ if (opts.max !== null && num > opts.max && typeof opts.max !== 'string') {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+function consumeFunction(token, getNextToken) {
+ let balanceCloseType = 0;
+ let balanceStash = [];
+ let length = 0;
+
+ // balanced token consuming
+ scan:
+ do {
+ switch (token.type) {
+ case types.RightCurlyBracket:
+ case types.RightParenthesis:
+ case types.RightSquareBracket:
+ if (token.type !== balanceCloseType) {
+ break scan;
+ }
+
+ balanceCloseType = balanceStash.pop();
+
+ if (balanceStash.length === 0) {
+ length++;
+ break scan;
+ }
+
+ break;
+
+ case types.Function:
+ case types.LeftParenthesis:
+ case types.LeftSquareBracket:
+ case types.LeftCurlyBracket:
+ balanceStash.push(balanceCloseType);
+ balanceCloseType = balancePair.get(token.type);
+ break;
+ }
+
+ length++;
+ } while (token = getNextToken(length));
+
+ return length;
+}
+
+// TODO: implement
+// can be used wherever , , , , , , or values are allowed
+// https://drafts.csswg.org/css-values/#calc-notation
+function calc(next) {
+ return function(token, getNextToken, opts) {
+ if (token === null) {
+ return 0;
+ }
+
+ if (token.type === types.Function && eqStrAny(token.value, calcFunctionNames)) {
+ return consumeFunction(token, getNextToken);
+ }
+
+ return next(token, getNextToken, opts);
+ };
+}
+
+function tokenType(expectedTokenType) {
+ return function(token) {
+ if (token === null || token.type !== expectedTokenType) {
+ return 0;
+ }
+
+ return 1;
+ };
+}
+
+// =========================
+// Complex types
+//
+
+// https://drafts.csswg.org/css-values-4/#custom-idents
+// 4.2. Author-defined Identifiers: the type
+// Some properties accept arbitrary author-defined identifiers as a component value.
+// This generic data type is denoted by , and represents any valid CSS identifier
+// that would not be misinterpreted as a pre-defined keyword in that property’s value definition.
+//
+// See also: https://developer.mozilla.org/en-US/docs/Web/CSS/custom-ident
+function customIdent(token) {
+ if (token === null || token.type !== types.Ident) {
+ return 0;
+ }
+
+ const name = token.value.toLowerCase();
+
+ // The CSS-wide keywords are not valid s
+ if (eqStrAny(name, genericConst.cssWideKeywords)) {
+ return 0;
+ }
+
+ // The default keyword is reserved and is also not a valid
+ if (eqStr(name, 'default')) {
+ return 0;
+ }
+
+ // TODO: ignore property specific keywords (as described https://developer.mozilla.org/en-US/docs/Web/CSS/custom-ident)
+ // Specifications using must specify clearly what other keywords
+ // are excluded from , if any—for example by saying that any pre-defined keywords
+ // in that property’s value definition are excluded. Excluded keywords are excluded
+ // in all ASCII case permutations.
+
+ return 1;
+}
+
+// https://drafts.csswg.org/css-variables/#typedef-custom-property-name
+// A custom property is any property whose name starts with two dashes (U+002D HYPHEN-MINUS), like --foo.
+// The production corresponds to this: it’s defined as any valid identifier
+// that starts with two dashes, except -- itself, which is reserved for future use by CSS.
+// NOTE: Current implementation treat `--` as a valid name since most (all?) major browsers treat it as valid.
+function customPropertyName(token) {
+ // ... defined as any valid identifier
+ if (token === null || token.type !== types.Ident) {
+ return 0;
+ }
+
+ // ... that starts with two dashes (U+002D HYPHEN-MINUS)
+ if (charCodeAt(token.value, 0) !== 0x002D || charCodeAt(token.value, 1) !== 0x002D) {
+ return 0;
+ }
+
+ return 1;
+}
+
+// https://drafts.csswg.org/css-color-4/#hex-notation
+// The syntax of a is a token whose value consists of 3, 4, 6, or 8 hexadecimal digits.
+// In other words, a hex color is written as a hash character, "#", followed by some number of digits 0-9 or
+// letters a-f (the case of the letters doesn’t matter - #00ff00 is identical to #00FF00).
+function hexColor(token) {
+ if (token === null || token.type !== types.Hash) {
+ return 0;
+ }
+
+ const length = token.value.length;
+
+ // valid values (length): #rgb (4), #rgba (5), #rrggbb (7), #rrggbbaa (9)
+ if (length !== 4 && length !== 5 && length !== 7 && length !== 9) {
+ return 0;
+ }
+
+ for (let i = 1; i < length; i++) {
+ if (!charCodeDefinitions.isHexDigit(charCodeAt(token.value, i))) {
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+function idSelector(token) {
+ if (token === null || token.type !== types.Hash) {
+ return 0;
+ }
+
+ if (!charCodeDefinitions.isIdentifierStart(charCodeAt(token.value, 1), charCodeAt(token.value, 2), charCodeAt(token.value, 3))) {
+ return 0;
+ }
+
+ return 1;
+}
+
+// https://drafts.csswg.org/css-syntax/#any-value
+// It represents the entirety of what a valid declaration can have as its value.
+function declarationValue(token, getNextToken) {
+ if (!token) {
+ return 0;
+ }
+
+ let balanceCloseType = 0;
+ let balanceStash = [];
+ let length = 0;
+
+ // The production matches any sequence of one or more tokens,
+ // so long as the sequence does not contain ...
+ scan:
+ do {
+ switch (token.type) {
+ // ... , ,
+ case types.BadString:
+ case types.BadUrl:
+ break scan;
+
+ // ... unmatched <)-token>, <]-token>, or <}-token>,
+ case types.RightCurlyBracket:
+ case types.RightParenthesis:
+ case types.RightSquareBracket:
+ if (token.type !== balanceCloseType) {
+ break scan;
+ }
+
+ balanceCloseType = balanceStash.pop();
+ break;
+
+ // ... or top-level tokens
+ case types.Semicolon:
+ if (balanceCloseType === 0) {
+ break scan;
+ }
+
+ break;
+
+ // ... or tokens with a value of "!"
+ case types.Delim:
+ if (balanceCloseType === 0 && token.value === '!') {
+ break scan;
+ }
+
+ break;
+
+ case types.Function:
+ case types.LeftParenthesis:
+ case types.LeftSquareBracket:
+ case types.LeftCurlyBracket:
+ balanceStash.push(balanceCloseType);
+ balanceCloseType = balancePair.get(token.type);
+ break;
+ }
+
+ length++;
+ } while (token = getNextToken(length));
+
+ return length;
+}
+
+// https://drafts.csswg.org/css-syntax/#any-value
+// The production is identical to , but also
+// allows top-level tokens and tokens
+// with a value of "!". It represents the entirety of what valid CSS can be in any context.
+function anyValue(token, getNextToken) {
+ if (!token) {
+ return 0;
+ }
+
+ let balanceCloseType = 0;
+ let balanceStash = [];
+ let length = 0;
+
+ // The production matches any sequence of one or more tokens,
+ // so long as the sequence ...
+ scan:
+ do {
+ switch (token.type) {
+ // ... does not contain , ,
+ case types.BadString:
+ case types.BadUrl:
+ break scan;
+
+ // ... unmatched <)-token>, <]-token>, or <}-token>,
+ case types.RightCurlyBracket:
+ case types.RightParenthesis:
+ case types.RightSquareBracket:
+ if (token.type !== balanceCloseType) {
+ break scan;
+ }
+
+ balanceCloseType = balanceStash.pop();
+ break;
+
+ case types.Function:
+ case types.LeftParenthesis:
+ case types.LeftSquareBracket:
+ case types.LeftCurlyBracket:
+ balanceStash.push(balanceCloseType);
+ balanceCloseType = balancePair.get(token.type);
+ break;
+ }
+
+ length++;
+ } while (token = getNextToken(length));
+
+ return length;
+}
+
+// =========================
+// Dimensions
+//
+
+function dimension(type) {
+ if (type) {
+ type = new Set(type);
+ }
+
+ return function(token, getNextToken, opts) {
+ if (token === null || token.type !== types.Dimension) {
+ return 0;
+ }
+
+ const numberEnd = utils.consumeNumber(token.value, 0);
+
+ // check unit
+ if (type !== null) {
+ // check for IE postfix hack, i.e. 123px\0 or 123px\9
+ const reverseSolidusOffset = token.value.indexOf('\\', numberEnd);
+ const unit = reverseSolidusOffset === -1 || !isPostfixIeHack(token.value, reverseSolidusOffset)
+ ? token.value.substr(numberEnd)
+ : token.value.substring(numberEnd, reverseSolidusOffset);
+
+ if (type.has(unit.toLowerCase()) === false) {
+ return 0;
+ }
+ }
+
+ // check range if specified
+ if (outOfRange(opts, token.value, numberEnd)) {
+ return 0;
+ }
+
+ return 1;
+ };
+}
+
+// =========================
+// Percentage
+//
+
+// §5.5. Percentages: the type
+// https://drafts.csswg.org/css-values-4/#percentages
+function percentage(token, getNextToken, opts) {
+ // ... corresponds to the production
+ if (token === null || token.type !== types.Percentage) {
+ return 0;
+ }
+
+ // check range if specified
+ if (outOfRange(opts, token.value, token.value.length - 1)) {
+ return 0;
+ }
+
+ return 1;
+}
+
+// =========================
+// Numeric
+//
+
+// https://drafts.csswg.org/css-values-4/#numbers
+// The value represents a literal number with the value 0. Expressions that merely
+// evaluate to a with the value 0 (for example, calc(0)) do not match ;
+// only literal s do.
+function zero(next) {
+ if (typeof next !== 'function') {
+ next = function() {
+ return 0;
+ };
+ }
+
+ return function(token, getNextToken, opts) {
+ if (token !== null && token.type === types.Number) {
+ if (Number(token.value) === 0) {
+ return 1;
+ }
+ }
+
+ return next(token, getNextToken, opts);
+ };
+}
+
+// § 5.3. Real Numbers: the type
+// https://drafts.csswg.org/css-values-4/#numbers
+// Number values are denoted by , and represent real numbers, possibly with a fractional component.
+// ... It corresponds to the production
+function number(token, getNextToken, opts) {
+ if (token === null) {
+ return 0;
+ }
+
+ const numberEnd = utils.consumeNumber(token.value, 0);
+ const isNumber = numberEnd === token.value.length;
+ if (!isNumber && !isPostfixIeHack(token.value, numberEnd)) {
+ return 0;
+ }
+
+ // check range if specified
+ if (outOfRange(opts, token.value, numberEnd)) {
+ return 0;
+ }
+
+ return 1;
+}
+
+// §5.2. Integers: the type
+// https://drafts.csswg.org/css-values-4/#integers
+function integer(token, getNextToken, opts) {
+ // ... corresponds to a subset of the production
+ if (token === null || token.type !== types.Number) {
+ return 0;
+ }
+
+ // The first digit of an integer may be immediately preceded by `-` or `+` to indicate the integer’s sign.
+ let i = charCodeAt(token.value, 0) === 0x002B || // U+002B PLUS SIGN (+)
+ charCodeAt(token.value, 0) === 0x002D ? 1 : 0; // U+002D HYPHEN-MINUS (-)
+
+ // When written literally, an integer is one or more decimal digits 0 through 9 ...
+ for (; i < token.value.length; i++) {
+ if (!charCodeDefinitions.isDigit(charCodeAt(token.value, i))) {
+ return 0;
+ }
+ }
+
+ // check range if specified
+ if (outOfRange(opts, token.value, i)) {
+ return 0;
+ }
+
+ return 1;
+}
+
+// token types
+const tokenTypes = {
+ 'ident-token': tokenType(types.Ident),
+ 'function-token': tokenType(types.Function),
+ 'at-keyword-token': tokenType(types.AtKeyword),
+ 'hash-token': tokenType(types.Hash),
+ 'string-token': tokenType(types.String),
+ 'bad-string-token': tokenType(types.BadString),
+ 'url-token': tokenType(types.Url),
+ 'bad-url-token': tokenType(types.BadUrl),
+ 'delim-token': tokenType(types.Delim),
+ 'number-token': tokenType(types.Number),
+ 'percentage-token': tokenType(types.Percentage),
+ 'dimension-token': tokenType(types.Dimension),
+ 'whitespace-token': tokenType(types.WhiteSpace),
+ 'CDO-token': tokenType(types.CDO),
+ 'CDC-token': tokenType(types.CDC),
+ 'colon-token': tokenType(types.Colon),
+ 'semicolon-token': tokenType(types.Semicolon),
+ 'comma-token': tokenType(types.Comma),
+ '[-token': tokenType(types.LeftSquareBracket),
+ ']-token': tokenType(types.RightSquareBracket),
+ '(-token': tokenType(types.LeftParenthesis),
+ ')-token': tokenType(types.RightParenthesis),
+ '{-token': tokenType(types.LeftCurlyBracket),
+ '}-token': tokenType(types.RightCurlyBracket)
+};
+
+// token production types
+const productionTypes = {
+ // token type aliases
+ 'string': tokenType(types.String),
+ 'ident': tokenType(types.Ident),
+
+ // percentage
+ 'percentage': calc(percentage),
+
+ // numeric
+ 'zero': zero(),
+ 'number': calc(number),
+ 'integer': calc(integer),
+
+ // complex types
+ 'custom-ident': customIdent,
+ 'custom-property-name': customPropertyName,
+ 'hex-color': hexColor,
+ 'id-selector': idSelector, // element( )
+ 'an-plus-b': genericAnPlusB,
+ 'urange': genericUrange,
+ 'declaration-value': declarationValue,
+ 'any-value': anyValue
+};
+
+// dimensions types depend on units set
+function createDemensionTypes(units) {
+ const {
+ angle,
+ decibel,
+ frequency,
+ flex,
+ length,
+ resolution,
+ semitones,
+ time
+ } = units || {};
+
+ return {
+ 'dimension': calc(dimension(null)),
+ 'angle': calc(dimension(angle)),
+ 'decibel': calc(dimension(decibel)),
+ 'frequency': calc(dimension(frequency)),
+ 'flex': calc(dimension(flex)),
+ 'length': calc(zero(dimension(length))),
+ 'resolution': calc(dimension(resolution)),
+ 'semitones': calc(dimension(semitones)),
+ 'time': calc(dimension(time))
+ };
+}
+
+function createGenericTypes(units) {
+ return {
+ ...tokenTypes,
+ ...productionTypes,
+ ...createDemensionTypes(units)
+ };
+}
+
+exports.createDemensionTypes = createDemensionTypes;
+exports.createGenericTypes = createGenericTypes;
+exports.productionTypes = productionTypes;
+exports.tokenTypes = tokenTypes;
diff --git a/node_modules/css-tree/cjs/lexer/index.cjs b/node_modules/css-tree/cjs/lexer/index.cjs
new file mode 100644
index 0000000..2e3633e
--- /dev/null
+++ b/node_modules/css-tree/cjs/lexer/index.cjs
@@ -0,0 +1,7 @@
+'use strict';
+
+const Lexer = require('./Lexer.cjs');
+
+
+
+exports.Lexer = Lexer.Lexer;
diff --git a/node_modules/css-tree/cjs/lexer/match-graph.cjs b/node_modules/css-tree/cjs/lexer/match-graph.cjs
new file mode 100644
index 0000000..79c9b66
--- /dev/null
+++ b/node_modules/css-tree/cjs/lexer/match-graph.cjs
@@ -0,0 +1,459 @@
+'use strict';
+
+const parse = require('../definition-syntax/parse.cjs');
+
+const MATCH = { type: 'Match' };
+const MISMATCH = { type: 'Mismatch' };
+const DISALLOW_EMPTY = { type: 'DisallowEmpty' };
+
+const LEFTPARENTHESIS = 40; // (
+const RIGHTPARENTHESIS = 41; // )
+
+function createCondition(match, thenBranch, elseBranch) {
+ // reduce node count
+ if (thenBranch === MATCH && elseBranch === MISMATCH) {
+ return match;
+ }
+
+ if (match === MATCH && thenBranch === MATCH && elseBranch === MATCH) {
+ return match;
+ }
+
+ if (match.type === 'If' && match.else === MISMATCH && thenBranch === MATCH) {
+ thenBranch = match.then;
+ match = match.match;
+ }
+
+ return {
+ type: 'If',
+ match,
+ then: thenBranch,
+ else: elseBranch
+ };
+}
+
+function isFunctionType(name) {
+ return (
+ name.length > 2 &&
+ name.charCodeAt(name.length - 2) === LEFTPARENTHESIS &&
+ name.charCodeAt(name.length - 1) === RIGHTPARENTHESIS
+ );
+}
+
+function isEnumCapatible(term) {
+ return (
+ term.type === 'Keyword' ||
+ term.type === 'AtKeyword' ||
+ term.type === 'Function' ||
+ term.type === 'Type' && isFunctionType(term.name)
+ );
+}
+
+function buildGroupMatchGraph(combinator, terms, atLeastOneTermMatched) {
+ switch (combinator) {
+ case ' ': {
+ // Juxtaposing components means that all of them must occur, in the given order.
+ //
+ // a b c
+ // =
+ // match a
+ // then match b
+ // then match c
+ // then MATCH
+ // else MISMATCH
+ // else MISMATCH
+ // else MISMATCH
+ let result = MATCH;
+
+ for (let i = terms.length - 1; i >= 0; i--) {
+ const term = terms[i];
+
+ result = createCondition(
+ term,
+ result,
+ MISMATCH
+ );
+ }
+ return result;
+ }
+
+ case '|': {
+ // A bar (|) separates two or more alternatives: exactly one of them must occur.
+ //
+ // a | b | c
+ // =
+ // match a
+ // then MATCH
+ // else match b
+ // then MATCH
+ // else match c
+ // then MATCH
+ // else MISMATCH
+
+ let result = MISMATCH;
+ let map = null;
+
+ for (let i = terms.length - 1; i >= 0; i--) {
+ let term = terms[i];
+
+ // reduce sequence of keywords into a Enum
+ if (isEnumCapatible(term)) {
+ if (map === null && i > 0 && isEnumCapatible(terms[i - 1])) {
+ map = Object.create(null);
+ result = createCondition(
+ {
+ type: 'Enum',
+ map
+ },
+ MATCH,
+ result
+ );
+ }
+
+ if (map !== null) {
+ const key = (isFunctionType(term.name) ? term.name.slice(0, -1) : term.name).toLowerCase();
+ if (key in map === false) {
+ map[key] = term;
+ continue;
+ }
+ }
+ }
+
+ map = null;
+
+ // create a new conditonal node
+ result = createCondition(
+ term,
+ MATCH,
+ result
+ );
+ }
+ return result;
+ }
+
+ case '&&': {
+ // A double ampersand (&&) separates two or more components,
+ // all of which must occur, in any order.
+
+ // Use MatchOnce for groups with a large number of terms,
+ // since &&-groups produces at least N!-node trees
+ if (terms.length > 5) {
+ return {
+ type: 'MatchOnce',
+ terms,
+ all: true
+ };
+ }
+
+ // Use a combination tree for groups with small number of terms
+ //
+ // a && b && c
+ // =
+ // match a
+ // then [b && c]
+ // else match b
+ // then [a && c]
+ // else match c
+ // then [a && b]
+ // else MISMATCH
+ //
+ // a && b
+ // =
+ // match a
+ // then match b
+ // then MATCH
+ // else MISMATCH
+ // else match b
+ // then match a
+ // then MATCH
+ // else MISMATCH
+ // else MISMATCH
+ let result = MISMATCH;
+
+ for (let i = terms.length - 1; i >= 0; i--) {
+ const term = terms[i];
+ let thenClause;
+
+ if (terms.length > 1) {
+ thenClause = buildGroupMatchGraph(
+ combinator,
+ terms.filter(function(newGroupTerm) {
+ return newGroupTerm !== term;
+ }),
+ false
+ );
+ } else {
+ thenClause = MATCH;
+ }
+
+ result = createCondition(
+ term,
+ thenClause,
+ result
+ );
+ }
+ return result;
+ }
+
+ case '||': {
+ // A double bar (||) separates two or more options:
+ // one or more of them must occur, in any order.
+
+ // Use MatchOnce for groups with a large number of terms,
+ // since ||-groups produces at least N!-node trees
+ if (terms.length > 5) {
+ return {
+ type: 'MatchOnce',
+ terms,
+ all: false
+ };
+ }
+
+ // Use a combination tree for groups with small number of terms
+ //
+ // a || b || c
+ // =
+ // match a
+ // then [b || c]
+ // else match b
+ // then [a || c]
+ // else match c
+ // then [a || b]
+ // else MISMATCH
+ //
+ // a || b
+ // =
+ // match a
+ // then match b
+ // then MATCH
+ // else MATCH
+ // else match b
+ // then match a
+ // then MATCH
+ // else MATCH
+ // else MISMATCH
+ let result = atLeastOneTermMatched ? MATCH : MISMATCH;
+
+ for (let i = terms.length - 1; i >= 0; i--) {
+ const term = terms[i];
+ let thenClause;
+
+ if (terms.length > 1) {
+ thenClause = buildGroupMatchGraph(
+ combinator,
+ terms.filter(function(newGroupTerm) {
+ return newGroupTerm !== term;
+ }),
+ true
+ );
+ } else {
+ thenClause = MATCH;
+ }
+
+ result = createCondition(
+ term,
+ thenClause,
+ result
+ );
+ }
+ return result;
+ }
+ }
+}
+
+function buildMultiplierMatchGraph(node) {
+ let result = MATCH;
+ let matchTerm = buildMatchGraphInternal(node.term);
+
+ if (node.max === 0) {
+ // disable repeating of empty match to prevent infinite loop
+ matchTerm = createCondition(
+ matchTerm,
+ DISALLOW_EMPTY,
+ MISMATCH
+ );
+
+ // an occurrence count is not limited, make a cycle;
+ // to collect more terms on each following matching mismatch
+ result = createCondition(
+ matchTerm,
+ null, // will be a loop
+ MISMATCH
+ );
+
+ result.then = createCondition(
+ MATCH,
+ MATCH,
+ result // make a loop
+ );
+
+ if (node.comma) {
+ result.then.else = createCondition(
+ { type: 'Comma', syntax: node },
+ result,
+ MISMATCH
+ );
+ }
+ } else {
+ // create a match node chain for [min .. max] interval with optional matches
+ for (let i = node.min || 1; i <= node.max; i++) {
+ if (node.comma && result !== MATCH) {
+ result = createCondition(
+ { type: 'Comma', syntax: node },
+ result,
+ MISMATCH
+ );
+ }
+
+ result = createCondition(
+ matchTerm,
+ createCondition(
+ MATCH,
+ MATCH,
+ result
+ ),
+ MISMATCH
+ );
+ }
+ }
+
+ if (node.min === 0) {
+ // allow zero match
+ result = createCondition(
+ MATCH,
+ MATCH,
+ result
+ );
+ } else {
+ // create a match node chain to collect [0 ... min - 1] required matches
+ for (let i = 0; i < node.min - 1; i++) {
+ if (node.comma && result !== MATCH) {
+ result = createCondition(
+ { type: 'Comma', syntax: node },
+ result,
+ MISMATCH
+ );
+ }
+
+ result = createCondition(
+ matchTerm,
+ result,
+ MISMATCH
+ );
+ }
+ }
+
+ return result;
+}
+
+function buildMatchGraphInternal(node) {
+ if (typeof node === 'function') {
+ return {
+ type: 'Generic',
+ fn: node
+ };
+ }
+
+ switch (node.type) {
+ case 'Group': {
+ let result = buildGroupMatchGraph(
+ node.combinator,
+ node.terms.map(buildMatchGraphInternal),
+ false
+ );
+
+ if (node.disallowEmpty) {
+ result = createCondition(
+ result,
+ DISALLOW_EMPTY,
+ MISMATCH
+ );
+ }
+
+ return result;
+ }
+
+ case 'Multiplier':
+ return buildMultiplierMatchGraph(node);
+
+ case 'Type':
+ case 'Property':
+ return {
+ type: node.type,
+ name: node.name,
+ syntax: node
+ };
+
+ case 'Keyword':
+ return {
+ type: node.type,
+ name: node.name.toLowerCase(),
+ syntax: node
+ };
+
+ case 'AtKeyword':
+ return {
+ type: node.type,
+ name: '@' + node.name.toLowerCase(),
+ syntax: node
+ };
+
+ case 'Function':
+ return {
+ type: node.type,
+ name: node.name.toLowerCase() + '(',
+ syntax: node
+ };
+
+ case 'String':
+ // convert a one char length String to a Token
+ if (node.value.length === 3) {
+ return {
+ type: 'Token',
+ value: node.value.charAt(1),
+ syntax: node
+ };
+ }
+
+ // otherwise use it as is
+ return {
+ type: node.type,
+ value: node.value.substr(1, node.value.length - 2).replace(/\\'/g, '\''),
+ syntax: node
+ };
+
+ case 'Token':
+ return {
+ type: node.type,
+ value: node.value,
+ syntax: node
+ };
+
+ case 'Comma':
+ return {
+ type: node.type,
+ syntax: node
+ };
+
+ default:
+ throw new Error('Unknown node type:', node.type);
+ }
+}
+
+function buildMatchGraph(syntaxTree, ref) {
+ if (typeof syntaxTree === 'string') {
+ syntaxTree = parse.parse(syntaxTree);
+ }
+
+ return {
+ type: 'MatchGraph',
+ match: buildMatchGraphInternal(syntaxTree),
+ syntax: ref || null,
+ source: syntaxTree
+ };
+}
+
+exports.DISALLOW_EMPTY = DISALLOW_EMPTY;
+exports.MATCH = MATCH;
+exports.MISMATCH = MISMATCH;
+exports.buildMatchGraph = buildMatchGraph;
diff --git a/node_modules/css-tree/cjs/lexer/match.cjs b/node_modules/css-tree/cjs/lexer/match.cjs
new file mode 100644
index 0000000..903720d
--- /dev/null
+++ b/node_modules/css-tree/cjs/lexer/match.cjs
@@ -0,0 +1,632 @@
+'use strict';
+
+const matchGraph = require('./match-graph.cjs');
+const types = require('../tokenizer/types.cjs');
+
+const { hasOwnProperty } = Object.prototype;
+const STUB = 0;
+const TOKEN = 1;
+const OPEN_SYNTAX = 2;
+const CLOSE_SYNTAX = 3;
+
+const EXIT_REASON_MATCH = 'Match';
+const EXIT_REASON_MISMATCH = 'Mismatch';
+const EXIT_REASON_ITERATION_LIMIT = 'Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)';
+
+const ITERATION_LIMIT = 15000;
+
+function reverseList(list) {
+ let prev = null;
+ let next = null;
+ let item = list;
+
+ while (item !== null) {
+ next = item.prev;
+ item.prev = prev;
+ prev = item;
+ item = next;
+ }
+
+ return prev;
+}
+
+function areStringsEqualCaseInsensitive(testStr, referenceStr) {
+ if (testStr.length !== referenceStr.length) {
+ return false;
+ }
+
+ for (let i = 0; i < testStr.length; i++) {
+ const referenceCode = referenceStr.charCodeAt(i);
+ let testCode = testStr.charCodeAt(i);
+
+ // testCode.toLowerCase() for U+0041 LATIN CAPITAL LETTER A (A) .. U+005A LATIN CAPITAL LETTER Z (Z).
+ if (testCode >= 0x0041 && testCode <= 0x005A) {
+ testCode = testCode | 32;
+ }
+
+ if (testCode !== referenceCode) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+function isContextEdgeDelim(token) {
+ if (token.type !== types.Delim) {
+ return false;
+ }
+
+ // Fix matching for unicode-range: U+30??, U+FF00-FF9F
+ // Probably we need to check out previous match instead
+ return token.value !== '?';
+}
+
+function isCommaContextStart(token) {
+ if (token === null) {
+ return true;
+ }
+
+ return (
+ token.type === types.Comma ||
+ token.type === types.Function ||
+ token.type === types.LeftParenthesis ||
+ token.type === types.LeftSquareBracket ||
+ token.type === types.LeftCurlyBracket ||
+ isContextEdgeDelim(token)
+ );
+}
+
+function isCommaContextEnd(token) {
+ if (token === null) {
+ return true;
+ }
+
+ return (
+ token.type === types.RightParenthesis ||
+ token.type === types.RightSquareBracket ||
+ token.type === types.RightCurlyBracket ||
+ (token.type === types.Delim && token.value === '/')
+ );
+}
+
+function internalMatch(tokens, state, syntaxes) {
+ function moveToNextToken() {
+ do {
+ tokenIndex++;
+ token = tokenIndex < tokens.length ? tokens[tokenIndex] : null;
+ } while (token !== null && (token.type === types.WhiteSpace || token.type === types.Comment));
+ }
+
+ function getNextToken(offset) {
+ const nextIndex = tokenIndex + offset;
+
+ return nextIndex < tokens.length ? tokens[nextIndex] : null;
+ }
+
+ function stateSnapshotFromSyntax(nextState, prev) {
+ return {
+ nextState,
+ matchStack,
+ syntaxStack,
+ thenStack,
+ tokenIndex,
+ prev
+ };
+ }
+
+ function pushThenStack(nextState) {
+ thenStack = {
+ nextState,
+ matchStack,
+ syntaxStack,
+ prev: thenStack
+ };
+ }
+
+ function pushElseStack(nextState) {
+ elseStack = stateSnapshotFromSyntax(nextState, elseStack);
+ }
+
+ function addTokenToMatch() {
+ matchStack = {
+ type: TOKEN,
+ syntax: state.syntax,
+ token,
+ prev: matchStack
+ };
+
+ moveToNextToken();
+ syntaxStash = null;
+
+ if (tokenIndex > longestMatch) {
+ longestMatch = tokenIndex;
+ }
+ }
+
+ function openSyntax() {
+ syntaxStack = {
+ syntax: state.syntax,
+ opts: state.syntax.opts || (syntaxStack !== null && syntaxStack.opts) || null,
+ prev: syntaxStack
+ };
+
+ matchStack = {
+ type: OPEN_SYNTAX,
+ syntax: state.syntax,
+ token: matchStack.token,
+ prev: matchStack
+ };
+ }
+
+ function closeSyntax() {
+ if (matchStack.type === OPEN_SYNTAX) {
+ matchStack = matchStack.prev;
+ } else {
+ matchStack = {
+ type: CLOSE_SYNTAX,
+ syntax: syntaxStack.syntax,
+ token: matchStack.token,
+ prev: matchStack
+ };
+ }
+
+ syntaxStack = syntaxStack.prev;
+ }
+
+ let syntaxStack = null;
+ let thenStack = null;
+ let elseStack = null;
+
+ // null – stashing allowed, nothing stashed
+ // false – stashing disabled, nothing stashed
+ // anithing else – fail stashable syntaxes, some syntax stashed
+ let syntaxStash = null;
+
+ let iterationCount = 0; // count iterations and prevent infinite loop
+ let exitReason = null;
+
+ let token = null;
+ let tokenIndex = -1;
+ let longestMatch = 0;
+ let matchStack = {
+ type: STUB,
+ syntax: null,
+ token: null,
+ prev: null
+ };
+
+ moveToNextToken();
+
+ while (exitReason === null && ++iterationCount < ITERATION_LIMIT) {
+ // function mapList(list, fn) {
+ // const result = [];
+ // while (list) {
+ // result.unshift(fn(list));
+ // list = list.prev;
+ // }
+ // return result;
+ // }
+ // console.log('--\n',
+ // '#' + iterationCount,
+ // require('util').inspect({
+ // match: mapList(matchStack, x => x.type === TOKEN ? x.token && x.token.value : x.syntax ? ({ [OPEN_SYNTAX]: '<', [CLOSE_SYNTAX]: '' }[x.type] || x.type) + '!' + x.syntax.name : null),
+ // token: token && token.value,
+ // tokenIndex,
+ // syntax: syntax.type + (syntax.id ? ' #' + syntax.id : '')
+ // }, { depth: null })
+ // );
+ switch (state.type) {
+ case 'Match':
+ if (thenStack === null) {
+ // turn to MISMATCH when some tokens left unmatched
+ if (token !== null) {
+ // doesn't mismatch if just one token left and it's an IE hack
+ if (tokenIndex !== tokens.length - 1 || (token.value !== '\\0' && token.value !== '\\9')) {
+ state = matchGraph.MISMATCH;
+ break;
+ }
+ }
+
+ // break the main loop, return a result - MATCH
+ exitReason = EXIT_REASON_MATCH;
+ break;
+ }
+
+ // go to next syntax (`then` branch)
+ state = thenStack.nextState;
+
+ // check match is not empty
+ if (state === matchGraph.DISALLOW_EMPTY) {
+ if (thenStack.matchStack === matchStack) {
+ state = matchGraph.MISMATCH;
+ break;
+ } else {
+ state = matchGraph.MATCH;
+ }
+ }
+
+ // close syntax if needed
+ while (thenStack.syntaxStack !== syntaxStack) {
+ closeSyntax();
+ }
+
+ // pop stack
+ thenStack = thenStack.prev;
+ break;
+
+ case 'Mismatch':
+ // when some syntax is stashed
+ if (syntaxStash !== null && syntaxStash !== false) {
+ // there is no else branches or a branch reduce match stack
+ if (elseStack === null || tokenIndex > elseStack.tokenIndex) {
+ // restore state from the stash
+ elseStack = syntaxStash;
+ syntaxStash = false; // disable stashing
+ }
+ } else if (elseStack === null) {
+ // no else branches -> break the main loop
+ // return a result - MISMATCH
+ exitReason = EXIT_REASON_MISMATCH;
+ break;
+ }
+
+ // go to next syntax (`else` branch)
+ state = elseStack.nextState;
+
+ // restore all the rest stack states
+ thenStack = elseStack.thenStack;
+ syntaxStack = elseStack.syntaxStack;
+ matchStack = elseStack.matchStack;
+ tokenIndex = elseStack.tokenIndex;
+ token = tokenIndex < tokens.length ? tokens[tokenIndex] : null;
+
+ // pop stack
+ elseStack = elseStack.prev;
+ break;
+
+ case 'MatchGraph':
+ state = state.match;
+ break;
+
+ case 'If':
+ // IMPORTANT: else stack push must go first,
+ // since it stores the state of thenStack before changes
+ if (state.else !== matchGraph.MISMATCH) {
+ pushElseStack(state.else);
+ }
+
+ if (state.then !== matchGraph.MATCH) {
+ pushThenStack(state.then);
+ }
+
+ state = state.match;
+ break;
+
+ case 'MatchOnce':
+ state = {
+ type: 'MatchOnceBuffer',
+ syntax: state,
+ index: 0,
+ mask: 0
+ };
+ break;
+
+ case 'MatchOnceBuffer': {
+ const terms = state.syntax.terms;
+
+ if (state.index === terms.length) {
+ // no matches at all or it's required all terms to be matched
+ if (state.mask === 0 || state.syntax.all) {
+ state = matchGraph.MISMATCH;
+ break;
+ }
+
+ // a partial match is ok
+ state = matchGraph.MATCH;
+ break;
+ }
+
+ // all terms are matched
+ if (state.mask === (1 << terms.length) - 1) {
+ state = matchGraph.MATCH;
+ break;
+ }
+
+ for (; state.index < terms.length; state.index++) {
+ const matchFlag = 1 << state.index;
+
+ if ((state.mask & matchFlag) === 0) {
+ // IMPORTANT: else stack push must go first,
+ // since it stores the state of thenStack before changes
+ pushElseStack(state);
+ pushThenStack({
+ type: 'AddMatchOnce',
+ syntax: state.syntax,
+ mask: state.mask | matchFlag
+ });
+
+ // match
+ state = terms[state.index++];
+ break;
+ }
+ }
+ break;
+ }
+
+ case 'AddMatchOnce':
+ state = {
+ type: 'MatchOnceBuffer',
+ syntax: state.syntax,
+ index: 0,
+ mask: state.mask
+ };
+ break;
+
+ case 'Enum':
+ if (token !== null) {
+ let name = token.value.toLowerCase();
+
+ // drop \0 and \9 hack from keyword name
+ if (name.indexOf('\\') !== -1) {
+ name = name.replace(/\\[09].*$/, '');
+ }
+
+ if (hasOwnProperty.call(state.map, name)) {
+ state = state.map[name];
+ break;
+ }
+ }
+
+ state = matchGraph.MISMATCH;
+ break;
+
+ case 'Generic': {
+ const opts = syntaxStack !== null ? syntaxStack.opts : null;
+ const lastTokenIndex = tokenIndex + Math.floor(state.fn(token, getNextToken, opts));
+
+ if (!isNaN(lastTokenIndex) && lastTokenIndex > tokenIndex) {
+ while (tokenIndex < lastTokenIndex) {
+ addTokenToMatch();
+ }
+
+ state = matchGraph.MATCH;
+ } else {
+ state = matchGraph.MISMATCH;
+ }
+
+ break;
+ }
+
+ case 'Type':
+ case 'Property': {
+ const syntaxDict = state.type === 'Type' ? 'types' : 'properties';
+ const dictSyntax = hasOwnProperty.call(syntaxes, syntaxDict) ? syntaxes[syntaxDict][state.name] : null;
+
+ if (!dictSyntax || !dictSyntax.match) {
+ throw new Error(
+ 'Bad syntax reference: ' +
+ (state.type === 'Type'
+ ? '<' + state.name + '>'
+ : '<\'' + state.name + '\'>')
+ );
+ }
+
+ // stash a syntax for types with low priority
+ if (syntaxStash !== false && token !== null && state.type === 'Type') {
+ const lowPriorityMatching =
+ // https://drafts.csswg.org/css-values-4/#custom-idents
+ // When parsing positionally-ambiguous keywords in a property value, a production
+ // can only claim the keyword if no other unfulfilled production can claim it.
+ (state.name === 'custom-ident' && token.type === types.Ident) ||
+
+ // https://drafts.csswg.org/css-values-4/#lengths
+ // ... if a `0` could be parsed as either a or a in a property (such as line-height),
+ // it must parse as a
+ (state.name === 'length' && token.value === '0');
+
+ if (lowPriorityMatching) {
+ if (syntaxStash === null) {
+ syntaxStash = stateSnapshotFromSyntax(state, elseStack);
+ }
+
+ state = matchGraph.MISMATCH;
+ break;
+ }
+ }
+
+ openSyntax();
+ state = dictSyntax.match;
+ break;
+ }
+
+ case 'Keyword': {
+ const name = state.name;
+
+ if (token !== null) {
+ let keywordName = token.value;
+
+ // drop \0 and \9 hack from keyword name
+ if (keywordName.indexOf('\\') !== -1) {
+ keywordName = keywordName.replace(/\\[09].*$/, '');
+ }
+
+ if (areStringsEqualCaseInsensitive(keywordName, name)) {
+ addTokenToMatch();
+ state = matchGraph.MATCH;
+ break;
+ }
+ }
+
+ state = matchGraph.MISMATCH;
+ break;
+ }
+
+ case 'AtKeyword':
+ case 'Function':
+ if (token !== null && areStringsEqualCaseInsensitive(token.value, state.name)) {
+ addTokenToMatch();
+ state = matchGraph.MATCH;
+ break;
+ }
+
+ state = matchGraph.MISMATCH;
+ break;
+
+ case 'Token':
+ if (token !== null && token.value === state.value) {
+ addTokenToMatch();
+ state = matchGraph.MATCH;
+ break;
+ }
+
+ state = matchGraph.MISMATCH;
+ break;
+
+ case 'Comma':
+ if (token !== null && token.type === types.Comma) {
+ if (isCommaContextStart(matchStack.token)) {
+ state = matchGraph.MISMATCH;
+ } else {
+ addTokenToMatch();
+ state = isCommaContextEnd(token) ? matchGraph.MISMATCH : matchGraph.MATCH;
+ }
+ } else {
+ state = isCommaContextStart(matchStack.token) || isCommaContextEnd(token) ? matchGraph.MATCH : matchGraph.MISMATCH;
+ }
+
+ break;
+
+ case 'String':
+ let string = '';
+ let lastTokenIndex = tokenIndex;
+
+ for (; lastTokenIndex < tokens.length && string.length < state.value.length; lastTokenIndex++) {
+ string += tokens[lastTokenIndex].value;
+ }
+
+ if (areStringsEqualCaseInsensitive(string, state.value)) {
+ while (tokenIndex < lastTokenIndex) {
+ addTokenToMatch();
+ }
+
+ state = matchGraph.MATCH;
+ } else {
+ state = matchGraph.MISMATCH;
+ }
+
+ break;
+
+ default:
+ throw new Error('Unknown node type: ' + state.type);
+ }
+ }
+
+ switch (exitReason) {
+ case null:
+ console.warn('[csstree-match] BREAK after ' + ITERATION_LIMIT + ' iterations');
+ exitReason = EXIT_REASON_ITERATION_LIMIT;
+ matchStack = null;
+ break;
+
+ case EXIT_REASON_MATCH:
+ while (syntaxStack !== null) {
+ closeSyntax();
+ }
+ break;
+
+ default:
+ matchStack = null;
+ }
+
+ return {
+ tokens,
+ reason: exitReason,
+ iterations: iterationCount,
+ match: matchStack,
+ longestMatch
+ };
+}
+
+function matchAsList(tokens, matchGraph, syntaxes) {
+ const matchResult = internalMatch(tokens, matchGraph, syntaxes || {});
+
+ if (matchResult.match !== null) {
+ let item = reverseList(matchResult.match).prev;
+
+ matchResult.match = [];
+
+ while (item !== null) {
+ switch (item.type) {
+ case OPEN_SYNTAX:
+ case CLOSE_SYNTAX:
+ matchResult.match.push({
+ type: item.type,
+ syntax: item.syntax
+ });
+ break;
+
+ default:
+ matchResult.match.push({
+ token: item.token.value,
+ node: item.token.node
+ });
+ break;
+ }
+
+ item = item.prev;
+ }
+ }
+
+ return matchResult;
+}
+
+function matchAsTree(tokens, matchGraph, syntaxes) {
+ const matchResult = internalMatch(tokens, matchGraph, syntaxes || {});
+
+ if (matchResult.match === null) {
+ return matchResult;
+ }
+
+ let item = matchResult.match;
+ let host = matchResult.match = {
+ syntax: matchGraph.syntax || null,
+ match: []
+ };
+ const hostStack = [host];
+
+ // revert a list and start with 2nd item since 1st is a stub item
+ item = reverseList(item).prev;
+
+ // build a tree
+ while (item !== null) {
+ switch (item.type) {
+ case OPEN_SYNTAX:
+ host.match.push(host = {
+ syntax: item.syntax,
+ match: []
+ });
+ hostStack.push(host);
+ break;
+
+ case CLOSE_SYNTAX:
+ hostStack.pop();
+ host = hostStack[hostStack.length - 1];
+ break;
+
+ default:
+ host.match.push({
+ syntax: item.syntax || null,
+ token: item.token.value,
+ node: item.token.node
+ });
+ }
+
+ item = item.prev;
+ }
+
+ return matchResult;
+}
+
+exports.matchAsList = matchAsList;
+exports.matchAsTree = matchAsTree;
diff --git a/node_modules/css-tree/cjs/lexer/prepare-tokens.cjs b/node_modules/css-tree/cjs/lexer/prepare-tokens.cjs
new file mode 100644
index 0000000..24647a5
--- /dev/null
+++ b/node_modules/css-tree/cjs/lexer/prepare-tokens.cjs
@@ -0,0 +1,54 @@
+'use strict';
+
+const index = require('../tokenizer/index.cjs');
+
+const astToTokens = {
+ decorator(handlers) {
+ const tokens = [];
+ let curNode = null;
+
+ return {
+ ...handlers,
+ node(node) {
+ const tmp = curNode;
+ curNode = node;
+ handlers.node.call(this, node);
+ curNode = tmp;
+ },
+ emit(value, type, auto) {
+ tokens.push({
+ type,
+ value,
+ node: auto ? null : curNode
+ });
+ },
+ result() {
+ return tokens;
+ }
+ };
+ }
+};
+
+function stringToTokens(str) {
+ const tokens = [];
+
+ index.tokenize(str, (type, start, end) =>
+ tokens.push({
+ type,
+ value: str.slice(start, end),
+ node: null
+ })
+ );
+
+ return tokens;
+}
+
+function prepareTokens(value, syntax) {
+ if (typeof value === 'string') {
+ return stringToTokens(value);
+ }
+
+ return syntax.generate(value, astToTokens);
+}
+
+module.exports = prepareTokens;
diff --git a/node_modules/css-tree/cjs/lexer/search.cjs b/node_modules/css-tree/cjs/lexer/search.cjs
new file mode 100644
index 0000000..2b1e12c
--- /dev/null
+++ b/node_modules/css-tree/cjs/lexer/search.cjs
@@ -0,0 +1,65 @@
+'use strict';
+
+const List = require('../utils/List.cjs');
+
+function getFirstMatchNode(matchNode) {
+ if ('node' in matchNode) {
+ return matchNode.node;
+ }
+
+ return getFirstMatchNode(matchNode.match[0]);
+}
+
+function getLastMatchNode(matchNode) {
+ if ('node' in matchNode) {
+ return matchNode.node;
+ }
+
+ return getLastMatchNode(matchNode.match[matchNode.match.length - 1]);
+}
+
+function matchFragments(lexer, ast, match, type, name) {
+ function findFragments(matchNode) {
+ if (matchNode.syntax !== null &&
+ matchNode.syntax.type === type &&
+ matchNode.syntax.name === name) {
+ const start = getFirstMatchNode(matchNode);
+ const end = getLastMatchNode(matchNode);
+
+ lexer.syntax.walk(ast, function(node, item, list) {
+ if (node === start) {
+ const nodes = new List.List();
+
+ do {
+ nodes.appendData(item.data);
+
+ if (item.data === end) {
+ break;
+ }
+
+ item = item.next;
+ } while (item !== null);
+
+ fragments.push({
+ parent: list,
+ nodes
+ });
+ }
+ });
+ }
+
+ if (Array.isArray(matchNode.match)) {
+ matchNode.match.forEach(findFragments);
+ }
+ }
+
+ const fragments = [];
+
+ if (match.matched !== null) {
+ findFragments(match.matched);
+ }
+
+ return fragments;
+}
+
+exports.matchFragments = matchFragments;
diff --git a/node_modules/css-tree/cjs/lexer/structure.cjs b/node_modules/css-tree/cjs/lexer/structure.cjs
new file mode 100644
index 0000000..77bdd35
--- /dev/null
+++ b/node_modules/css-tree/cjs/lexer/structure.cjs
@@ -0,0 +1,168 @@
+'use strict';
+
+const List = require('../utils/List.cjs');
+
+const { hasOwnProperty } = Object.prototype;
+
+function isValidNumber(value) {
+ // Number.isInteger(value) && value >= 0
+ return (
+ typeof value === 'number' &&
+ isFinite(value) &&
+ Math.floor(value) === value &&
+ value >= 0
+ );
+}
+
+function isValidLocation(loc) {
+ return (
+ Boolean(loc) &&
+ isValidNumber(loc.offset) &&
+ isValidNumber(loc.line) &&
+ isValidNumber(loc.column)
+ );
+}
+
+function createNodeStructureChecker(type, fields) {
+ return function checkNode(node, warn) {
+ if (!node || node.constructor !== Object) {
+ return warn(node, 'Type of node should be an Object');
+ }
+
+ for (let key in node) {
+ let valid = true;
+
+ if (hasOwnProperty.call(node, key) === false) {
+ continue;
+ }
+
+ if (key === 'type') {
+ if (node.type !== type) {
+ warn(node, 'Wrong node type `' + node.type + '`, expected `' + type + '`');
+ }
+ } else if (key === 'loc') {
+ if (node.loc === null) {
+ continue;
+ } else if (node.loc && node.loc.constructor === Object) {
+ if (typeof node.loc.source !== 'string') {
+ key += '.source';
+ } else if (!isValidLocation(node.loc.start)) {
+ key += '.start';
+ } else if (!isValidLocation(node.loc.end)) {
+ key += '.end';
+ } else {
+ continue;
+ }
+ }
+
+ valid = false;
+ } else if (fields.hasOwnProperty(key)) {
+ valid = false;
+
+ for (let i = 0; !valid && i < fields[key].length; i++) {
+ const fieldType = fields[key][i];
+
+ switch (fieldType) {
+ case String:
+ valid = typeof node[key] === 'string';
+ break;
+
+ case Boolean:
+ valid = typeof node[key] === 'boolean';
+ break;
+
+ case null:
+ valid = node[key] === null;
+ break;
+
+ default:
+ if (typeof fieldType === 'string') {
+ valid = node[key] && node[key].type === fieldType;
+ } else if (Array.isArray(fieldType)) {
+ valid = node[key] instanceof List.List;
+ }
+ }
+ }
+ } else {
+ warn(node, 'Unknown field `' + key + '` for ' + type + ' node type');
+ }
+
+ if (!valid) {
+ warn(node, 'Bad value for `' + type + '.' + key + '`');
+ }
+ }
+
+ for (const key in fields) {
+ if (hasOwnProperty.call(fields, key) &&
+ hasOwnProperty.call(node, key) === false) {
+ warn(node, 'Field `' + type + '.' + key + '` is missed');
+ }
+ }
+ };
+}
+
+function processStructure(name, nodeType) {
+ const structure = nodeType.structure;
+ const fields = {
+ type: String,
+ loc: true
+ };
+ const docs = {
+ type: '"' + name + '"'
+ };
+
+ for (const key in structure) {
+ if (hasOwnProperty.call(structure, key) === false) {
+ continue;
+ }
+
+ const docsTypes = [];
+ const fieldTypes = fields[key] = Array.isArray(structure[key])
+ ? structure[key].slice()
+ : [structure[key]];
+
+ for (let i = 0; i < fieldTypes.length; i++) {
+ const fieldType = fieldTypes[i];
+ if (fieldType === String || fieldType === Boolean) {
+ docsTypes.push(fieldType.name);
+ } else if (fieldType === null) {
+ docsTypes.push('null');
+ } else if (typeof fieldType === 'string') {
+ docsTypes.push('<' + fieldType + '>');
+ } else if (Array.isArray(fieldType)) {
+ docsTypes.push('List'); // TODO: use type enum
+ } else {
+ throw new Error('Wrong value `' + fieldType + '` in `' + name + '.' + key + '` structure definition');
+ }
+ }
+
+ docs[key] = docsTypes.join(' | ');
+ }
+
+ return {
+ docs,
+ check: createNodeStructureChecker(name, fields)
+ };
+}
+
+function getStructureFromConfig(config) {
+ const structure = {};
+
+ if (config.node) {
+ for (const name in config.node) {
+ if (hasOwnProperty.call(config.node, name)) {
+ const nodeType = config.node[name];
+
+ if (nodeType.structure) {
+ structure[name] = processStructure(name, nodeType);
+ } else {
+ throw new Error('Missed `structure` field in `' + name + '` node type definition');
+ }
+ }
+ }
+ }
+
+ return structure;
+}
+
+exports.getStructureFromConfig = getStructureFromConfig;
diff --git a/node_modules/css-tree/cjs/lexer/trace.cjs b/node_modules/css-tree/cjs/lexer/trace.cjs
new file mode 100644
index 0000000..13753f2
--- /dev/null
+++ b/node_modules/css-tree/cjs/lexer/trace.cjs
@@ -0,0 +1,73 @@
+'use strict';
+
+function getTrace(node) {
+ function shouldPutToTrace(syntax) {
+ if (syntax === null) {
+ return false;
+ }
+
+ return (
+ syntax.type === 'Type' ||
+ syntax.type === 'Property' ||
+ syntax.type === 'Keyword'
+ );
+ }
+
+ function hasMatch(matchNode) {
+ if (Array.isArray(matchNode.match)) {
+ // use for-loop for better perfomance
+ for (let i = 0; i < matchNode.match.length; i++) {
+ if (hasMatch(matchNode.match[i])) {
+ if (shouldPutToTrace(matchNode.syntax)) {
+ result.unshift(matchNode.syntax);
+ }
+
+ return true;
+ }
+ }
+ } else if (matchNode.node === node) {
+ result = shouldPutToTrace(matchNode.syntax)
+ ? [matchNode.syntax]
+ : [];
+
+ return true;
+ }
+
+ return false;
+ }
+
+ let result = null;
+
+ if (this.matched !== null) {
+ hasMatch(this.matched);
+ }
+
+ return result;
+}
+
+function isType(node, type) {
+ return testNode(this, node, match => match.type === 'Type' && match.name === type);
+}
+
+function isProperty(node, property) {
+ return testNode(this, node, match => match.type === 'Property' && match.name === property);
+}
+
+function isKeyword(node) {
+ return testNode(this, node, match => match.type === 'Keyword');
+}
+
+function testNode(match, node, fn) {
+ const trace = getTrace.call(match, node);
+
+ if (trace === null) {
+ return false;
+ }
+
+ return trace.some(fn);
+}
+
+exports.getTrace = getTrace;
+exports.isKeyword = isKeyword;
+exports.isProperty = isProperty;
+exports.isType = isType;
diff --git a/node_modules/css-tree/cjs/lexer/units.cjs b/node_modules/css-tree/cjs/lexer/units.cjs
new file mode 100644
index 0000000..13f4e97
--- /dev/null
+++ b/node_modules/css-tree/cjs/lexer/units.cjs
@@ -0,0 +1,38 @@
+'use strict';
+
+const length = [
+ // absolute length units https://www.w3.org/TR/css-values-3/#lengths
+ 'cm', 'mm', 'q', 'in', 'pt', 'pc', 'px',
+ // font-relative length units https://drafts.csswg.org/css-values-4/#font-relative-lengths
+ 'em', 'rem',
+ 'ex', 'rex',
+ 'cap', 'rcap',
+ 'ch', 'rch',
+ 'ic', 'ric',
+ 'lh', 'rlh',
+ // viewport-percentage lengths https://drafts.csswg.org/css-values-4/#viewport-relative-lengths
+ 'vw', 'svw', 'lvw', 'dvw',
+ 'vh', 'svh', 'lvh', 'dvh',
+ 'vi', 'svi', 'lvi', 'dvi',
+ 'vb', 'svb', 'lvb', 'dvb',
+ 'vmin', 'svmin', 'lvmin', 'dvmin',
+ 'vmax', 'svmax', 'lvmax', 'dvmax',
+ // container relative lengths https://drafts.csswg.org/css-contain-3/#container-lengths
+ 'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax'
+];
+const angle = ['deg', 'grad', 'rad', 'turn']; // https://www.w3.org/TR/css-values-3/#angles
+const time = ['s', 'ms']; // https://www.w3.org/TR/css-values-3/#time
+const frequency = ['hz', 'khz']; // https://www.w3.org/TR/css-values-3/#frequency
+const resolution = ['dpi', 'dpcm', 'dppx', 'x']; // https://www.w3.org/TR/css-values-3/#resolution
+const flex = ['fr']; // https://drafts.csswg.org/css-grid/#fr-unit
+const decibel = ['db']; // https://www.w3.org/TR/css3-speech/#mixing-props-voice-volume
+const semitones = ['st']; // https://www.w3.org/TR/css3-speech/#voice-props-voice-pitch
+
+exports.angle = angle;
+exports.decibel = decibel;
+exports.flex = flex;
+exports.frequency = frequency;
+exports.length = length;
+exports.resolution = resolution;
+exports.semitones = semitones;
+exports.time = time;
diff --git a/node_modules/css-tree/cjs/parser/SyntaxError.cjs b/node_modules/css-tree/cjs/parser/SyntaxError.cjs
new file mode 100644
index 0000000..63dd44b
--- /dev/null
+++ b/node_modules/css-tree/cjs/parser/SyntaxError.cjs
@@ -0,0 +1,69 @@
+'use strict';
+
+const createCustomError = require('../utils/create-custom-error.cjs');
+
+const MAX_LINE_LENGTH = 100;
+const OFFSET_CORRECTION = 60;
+const TAB_REPLACEMENT = ' ';
+
+function sourceFragment({ source, line, column }, extraLines) {
+ function processLines(start, end) {
+ return lines
+ .slice(start, end)
+ .map((line, idx) =>
+ String(start + idx + 1).padStart(maxNumLength) + ' |' + line
+ ).join('\n');
+ }
+
+ const lines = source.split(/\r\n?|\n|\f/);
+ const startLine = Math.max(1, line - extraLines) - 1;
+ const endLine = Math.min(line + extraLines, lines.length + 1);
+ const maxNumLength = Math.max(4, String(endLine).length) + 1;
+ let cutLeft = 0;
+
+ // column correction according to replaced tab before column
+ column += (TAB_REPLACEMENT.length - 1) * (lines[line - 1].substr(0, column - 1).match(/\t/g) || []).length;
+
+ if (column > MAX_LINE_LENGTH) {
+ cutLeft = column - OFFSET_CORRECTION + 3;
+ column = OFFSET_CORRECTION - 2;
+ }
+
+ for (let i = startLine; i <= endLine; i++) {
+ if (i >= 0 && i < lines.length) {
+ lines[i] = lines[i].replace(/\t/g, TAB_REPLACEMENT);
+ lines[i] =
+ (cutLeft > 0 && lines[i].length > cutLeft ? '\u2026' : '') +
+ lines[i].substr(cutLeft, MAX_LINE_LENGTH - 2) +
+ (lines[i].length > cutLeft + MAX_LINE_LENGTH - 1 ? '\u2026' : '');
+ }
+ }
+
+ return [
+ processLines(startLine, line),
+ new Array(column + maxNumLength + 2).join('-') + '^',
+ processLines(line, endLine)
+ ].filter(Boolean).join('\n');
+}
+
+function SyntaxError(message, source, offset, line, column) {
+ const error = Object.assign(createCustomError.createCustomError('SyntaxError', message), {
+ source,
+ offset,
+ line,
+ column,
+ sourceFragment(extraLines) {
+ return sourceFragment({ source, line, column }, isNaN(extraLines) ? 0 : extraLines);
+ },
+ get formattedMessage() {
+ return (
+ `Parse error: ${message}\n` +
+ sourceFragment({ source, line, column }, 2)
+ );
+ }
+ });
+
+ return error;
+}
+
+exports.SyntaxError = SyntaxError;
diff --git a/node_modules/css-tree/cjs/parser/create.cjs b/node_modules/css-tree/cjs/parser/create.cjs
new file mode 100644
index 0000000..f83d3bd
--- /dev/null
+++ b/node_modules/css-tree/cjs/parser/create.cjs
@@ -0,0 +1,336 @@
+'use strict';
+
+const List = require('../utils/List.cjs');
+const SyntaxError = require('./SyntaxError.cjs');
+const index = require('../tokenizer/index.cjs');
+const sequence = require('./sequence.cjs');
+const OffsetToLocation = require('../tokenizer/OffsetToLocation.cjs');
+const TokenStream = require('../tokenizer/TokenStream.cjs');
+const utils = require('../tokenizer/utils.cjs');
+const types = require('../tokenizer/types.cjs');
+const names = require('../tokenizer/names.cjs');
+
+const NOOP = () => {};
+const EXCLAMATIONMARK = 0x0021; // U+0021 EXCLAMATION MARK (!)
+const NUMBERSIGN = 0x0023; // U+0023 NUMBER SIGN (#)
+const SEMICOLON = 0x003B; // U+003B SEMICOLON (;)
+const LEFTCURLYBRACKET = 0x007B; // U+007B LEFT CURLY BRACKET ({)
+const NULL = 0;
+
+function createParseContext(name) {
+ return function() {
+ return this[name]();
+ };
+}
+
+function fetchParseValues(dict) {
+ const result = Object.create(null);
+
+ for (const name in dict) {
+ const item = dict[name];
+ const fn = item.parse || item;
+
+ if (fn) {
+ result[name] = fn;
+ }
+ }
+
+ return result;
+}
+
+function processConfig(config) {
+ const parseConfig = {
+ context: Object.create(null),
+ scope: Object.assign(Object.create(null), config.scope),
+ atrule: fetchParseValues(config.atrule),
+ pseudo: fetchParseValues(config.pseudo),
+ node: fetchParseValues(config.node)
+ };
+
+ for (const name in config.parseContext) {
+ switch (typeof config.parseContext[name]) {
+ case 'function':
+ parseConfig.context[name] = config.parseContext[name];
+ break;
+
+ case 'string':
+ parseConfig.context[name] = createParseContext(config.parseContext[name]);
+ break;
+ }
+ }
+
+ return {
+ config: parseConfig,
+ ...parseConfig,
+ ...parseConfig.node
+ };
+}
+
+function createParser(config) {
+ let source = '';
+ let filename = '';
+ let needPositions = false;
+ let onParseError = NOOP;
+ let onParseErrorThrow = false;
+
+ const locationMap = new OffsetToLocation.OffsetToLocation();
+ const parser = Object.assign(new TokenStream.TokenStream(), processConfig(config || {}), {
+ parseAtrulePrelude: true,
+ parseRulePrelude: true,
+ parseValue: true,
+ parseCustomProperty: false,
+
+ readSequence: sequence.readSequence,
+
+ consumeUntilBalanceEnd: () => 0,
+ consumeUntilLeftCurlyBracket(code) {
+ return code === LEFTCURLYBRACKET ? 1 : 0;
+ },
+ consumeUntilLeftCurlyBracketOrSemicolon(code) {
+ return code === LEFTCURLYBRACKET || code === SEMICOLON ? 1 : 0;
+ },
+ consumeUntilExclamationMarkOrSemicolon(code) {
+ return code === EXCLAMATIONMARK || code === SEMICOLON ? 1 : 0;
+ },
+ consumeUntilSemicolonIncluded(code) {
+ return code === SEMICOLON ? 2 : 0;
+ },
+
+ createList() {
+ return new List.List();
+ },
+ createSingleNodeList(node) {
+ return new List.List().appendData(node);
+ },
+ getFirstListNode(list) {
+ return list && list.first;
+ },
+ getLastListNode(list) {
+ return list && list.last;
+ },
+
+ parseWithFallback(consumer, fallback) {
+ const startToken = this.tokenIndex;
+
+ try {
+ return consumer.call(this);
+ } catch (e) {
+ if (onParseErrorThrow) {
+ throw e;
+ }
+
+ const fallbackNode = fallback.call(this, startToken);
+
+ onParseErrorThrow = true;
+ onParseError(e, fallbackNode);
+ onParseErrorThrow = false;
+
+ return fallbackNode;
+ }
+ },
+
+ lookupNonWSType(offset) {
+ let type;
+
+ do {
+ type = this.lookupType(offset++);
+ if (type !== types.WhiteSpace) {
+ return type;
+ }
+ } while (type !== NULL);
+
+ return NULL;
+ },
+
+ charCodeAt(offset) {
+ return offset >= 0 && offset < source.length ? source.charCodeAt(offset) : 0;
+ },
+ substring(offsetStart, offsetEnd) {
+ return source.substring(offsetStart, offsetEnd);
+ },
+ substrToCursor(start) {
+ return this.source.substring(start, this.tokenStart);
+ },
+
+ cmpChar(offset, charCode) {
+ return utils.cmpChar(source, offset, charCode);
+ },
+ cmpStr(offsetStart, offsetEnd, str) {
+ return utils.cmpStr(source, offsetStart, offsetEnd, str);
+ },
+
+ consume(tokenType) {
+ const start = this.tokenStart;
+
+ this.eat(tokenType);
+
+ return this.substrToCursor(start);
+ },
+ consumeFunctionName() {
+ const name = source.substring(this.tokenStart, this.tokenEnd - 1);
+
+ this.eat(types.Function);
+
+ return name;
+ },
+ consumeNumber(type) {
+ const number = source.substring(this.tokenStart, utils.consumeNumber(source, this.tokenStart));
+
+ this.eat(type);
+
+ return number;
+ },
+
+ eat(tokenType) {
+ if (this.tokenType !== tokenType) {
+ const tokenName = names[tokenType].slice(0, -6).replace(/-/g, ' ').replace(/^./, m => m.toUpperCase());
+ let message = `${/[[\](){}]/.test(tokenName) ? `"${tokenName}"` : tokenName} is expected`;
+ let offset = this.tokenStart;
+
+ // tweak message and offset
+ switch (tokenType) {
+ case types.Ident:
+ // when identifier is expected but there is a function or url
+ if (this.tokenType === types.Function || this.tokenType === types.Url) {
+ offset = this.tokenEnd - 1;
+ message = 'Identifier is expected but function found';
+ } else {
+ message = 'Identifier is expected';
+ }
+ break;
+
+ case types.Hash:
+ if (this.isDelim(NUMBERSIGN)) {
+ this.next();
+ offset++;
+ message = 'Name is expected';
+ }
+ break;
+
+ case types.Percentage:
+ if (this.tokenType === types.Number) {
+ offset = this.tokenEnd;
+ message = 'Percent sign is expected';
+ }
+ break;
+ }
+
+ this.error(message, offset);
+ }
+
+ this.next();
+ },
+ eatIdent(name) {
+ if (this.tokenType !== types.Ident || this.lookupValue(0, name) === false) {
+ this.error(`Identifier "${name}" is expected`);
+ }
+
+ this.next();
+ },
+ eatDelim(code) {
+ if (!this.isDelim(code)) {
+ this.error(`Delim "${String.fromCharCode(code)}" is expected`);
+ }
+
+ this.next();
+ },
+
+ getLocation(start, end) {
+ if (needPositions) {
+ return locationMap.getLocationRange(
+ start,
+ end,
+ filename
+ );
+ }
+
+ return null;
+ },
+ getLocationFromList(list) {
+ if (needPositions) {
+ const head = this.getFirstListNode(list);
+ const tail = this.getLastListNode(list);
+ return locationMap.getLocationRange(
+ head !== null ? head.loc.start.offset - locationMap.startOffset : this.tokenStart,
+ tail !== null ? tail.loc.end.offset - locationMap.startOffset : this.tokenStart,
+ filename
+ );
+ }
+
+ return null;
+ },
+
+ error(message, offset) {
+ const location = typeof offset !== 'undefined' && offset < source.length
+ ? locationMap.getLocation(offset)
+ : this.eof
+ ? locationMap.getLocation(utils.findWhiteSpaceStart(source, source.length - 1))
+ : locationMap.getLocation(this.tokenStart);
+
+ throw new SyntaxError.SyntaxError(
+ message || 'Unexpected input',
+ source,
+ location.offset,
+ location.line,
+ location.column
+ );
+ }
+ });
+
+ const parse = function(source_, options) {
+ source = source_;
+ options = options || {};
+
+ parser.setSource(source, index.tokenize);
+ locationMap.setSource(
+ source,
+ options.offset,
+ options.line,
+ options.column
+ );
+
+ filename = options.filename || '';
+ needPositions = Boolean(options.positions);
+ onParseError = typeof options.onParseError === 'function' ? options.onParseError : NOOP;
+ onParseErrorThrow = false;
+
+ parser.parseAtrulePrelude = 'parseAtrulePrelude' in options ? Boolean(options.parseAtrulePrelude) : true;
+ parser.parseRulePrelude = 'parseRulePrelude' in options ? Boolean(options.parseRulePrelude) : true;
+ parser.parseValue = 'parseValue' in options ? Boolean(options.parseValue) : true;
+ parser.parseCustomProperty = 'parseCustomProperty' in options ? Boolean(options.parseCustomProperty) : false;
+
+ const { context = 'default', onComment } = options;
+
+ if (context in parser.context === false) {
+ throw new Error('Unknown context `' + context + '`');
+ }
+
+ if (typeof onComment === 'function') {
+ parser.forEachToken((type, start, end) => {
+ if (type === types.Comment) {
+ const loc = parser.getLocation(start, end);
+ const value = utils.cmpStr(source, end - 2, end, '*/')
+ ? source.slice(start + 2, end - 2)
+ : source.slice(start + 2, end);
+
+ onComment(value, loc);
+ }
+ });
+ }
+
+ const ast = parser.context[context].call(parser, options);
+
+ if (!parser.eof) {
+ parser.error();
+ }
+
+ return ast;
+ };
+
+ return Object.assign(parse, {
+ SyntaxError: SyntaxError.SyntaxError,
+ config: parser.config
+ });
+}
+
+exports.createParser = createParser;
diff --git a/node_modules/css-tree/cjs/parser/index.cjs b/node_modules/css-tree/cjs/parser/index.cjs
new file mode 100644
index 0000000..9450cb0
--- /dev/null
+++ b/node_modules/css-tree/cjs/parser/index.cjs
@@ -0,0 +1,8 @@
+'use strict';
+
+const create = require('./create.cjs');
+const parser = require('../syntax/config/parser.cjs');
+
+const index = create.createParser(parser);
+
+module.exports = index;
diff --git a/node_modules/css-tree/cjs/parser/parse-selector.cjs b/node_modules/css-tree/cjs/parser/parse-selector.cjs
new file mode 100644
index 0000000..8ea8d0d
--- /dev/null
+++ b/node_modules/css-tree/cjs/parser/parse-selector.cjs
@@ -0,0 +1,8 @@
+'use strict';
+
+const create = require('./create.cjs');
+const parserSelector = require('../syntax/config/parser-selector.cjs');
+
+const parseSelector = create.createParser(parserSelector);
+
+module.exports = parseSelector;
diff --git a/node_modules/css-tree/cjs/parser/sequence.cjs b/node_modules/css-tree/cjs/parser/sequence.cjs
new file mode 100644
index 0000000..b7d7d29
--- /dev/null
+++ b/node_modules/css-tree/cjs/parser/sequence.cjs
@@ -0,0 +1,47 @@
+'use strict';
+
+const types = require('../tokenizer/types.cjs');
+
+function readSequence(recognizer) {
+ const children = this.createList();
+ let space = false;
+ const context = {
+ recognizer
+ };
+
+ while (!this.eof) {
+ switch (this.tokenType) {
+ case types.Comment:
+ this.next();
+ continue;
+
+ case types.WhiteSpace:
+ space = true;
+ this.next();
+ continue;
+ }
+
+ let child = recognizer.getNode.call(this, context);
+
+ if (child === undefined) {
+ break;
+ }
+
+ if (space) {
+ if (recognizer.onWhiteSpace) {
+ recognizer.onWhiteSpace.call(this, child, children, context);
+ }
+ space = false;
+ }
+
+ children.push(child);
+ }
+
+ if (space && recognizer.onWhiteSpace) {
+ recognizer.onWhiteSpace.call(this, null, children, context);
+ }
+
+ return children;
+}
+
+exports.readSequence = readSequence;
diff --git a/node_modules/css-tree/cjs/syntax/atrule/font-face.cjs b/node_modules/css-tree/cjs/syntax/atrule/font-face.cjs
new file mode 100644
index 0000000..fc7f64a
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/atrule/font-face.cjs
@@ -0,0 +1,12 @@
+'use strict';
+
+const fontFace = {
+ parse: {
+ prelude: null,
+ block() {
+ return this.Block(true);
+ }
+ }
+};
+
+module.exports = fontFace;
diff --git a/node_modules/css-tree/cjs/syntax/atrule/import.cjs b/node_modules/css-tree/cjs/syntax/atrule/import.cjs
new file mode 100644
index 0000000..bb4402b
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/atrule/import.cjs
@@ -0,0 +1,37 @@
+'use strict';
+
+const types = require('../../tokenizer/types.cjs');
+
+const importAtrule = {
+ parse: {
+ prelude() {
+ const children = this.createList();
+
+ this.skipSC();
+
+ switch (this.tokenType) {
+ case types.String:
+ children.push(this.String());
+ break;
+
+ case types.Url:
+ case types.Function:
+ children.push(this.Url());
+ break;
+
+ default:
+ this.error('String or url() is expected');
+ }
+
+ if (this.lookupNonWSType(0) === types.Ident ||
+ this.lookupNonWSType(0) === types.LeftParenthesis) {
+ children.push(this.MediaQueryList());
+ }
+
+ return children;
+ },
+ block: null
+ }
+};
+
+module.exports = importAtrule;
diff --git a/node_modules/css-tree/cjs/syntax/atrule/index.cjs b/node_modules/css-tree/cjs/syntax/atrule/index.cjs
new file mode 100644
index 0000000..0cfe83d
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/atrule/index.cjs
@@ -0,0 +1,19 @@
+'use strict';
+
+const fontFace = require('./font-face.cjs');
+const _import = require('./import.cjs');
+const media = require('./media.cjs');
+const nest = require('./nest.cjs');
+const page = require('./page.cjs');
+const supports = require('./supports.cjs');
+
+const atrule = {
+ 'font-face': fontFace,
+ 'import': _import,
+ media,
+ nest,
+ page,
+ supports
+};
+
+module.exports = atrule;
diff --git a/node_modules/css-tree/cjs/syntax/atrule/media.cjs b/node_modules/css-tree/cjs/syntax/atrule/media.cjs
new file mode 100644
index 0000000..77214d1
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/atrule/media.cjs
@@ -0,0 +1,16 @@
+'use strict';
+
+const media = {
+ parse: {
+ prelude() {
+ return this.createSingleNodeList(
+ this.MediaQueryList()
+ );
+ },
+ block(isStyleBlock = false) {
+ return this.Block(isStyleBlock);
+ }
+ }
+};
+
+module.exports = media;
diff --git a/node_modules/css-tree/cjs/syntax/atrule/nest.cjs b/node_modules/css-tree/cjs/syntax/atrule/nest.cjs
new file mode 100644
index 0000000..5cd6672
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/atrule/nest.cjs
@@ -0,0 +1,16 @@
+'use strict';
+
+const nest = {
+ parse: {
+ prelude() {
+ return this.createSingleNodeList(
+ this.SelectorList()
+ );
+ },
+ block() {
+ return this.Block(true);
+ }
+ }
+};
+
+module.exports = nest;
diff --git a/node_modules/css-tree/cjs/syntax/atrule/page.cjs b/node_modules/css-tree/cjs/syntax/atrule/page.cjs
new file mode 100644
index 0000000..ffef0d1
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/atrule/page.cjs
@@ -0,0 +1,16 @@
+'use strict';
+
+const page = {
+ parse: {
+ prelude() {
+ return this.createSingleNodeList(
+ this.SelectorList()
+ );
+ },
+ block() {
+ return this.Block(true);
+ }
+ }
+};
+
+module.exports = page;
diff --git a/node_modules/css-tree/cjs/syntax/atrule/supports.cjs b/node_modules/css-tree/cjs/syntax/atrule/supports.cjs
new file mode 100644
index 0000000..bf30f03
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/atrule/supports.cjs
@@ -0,0 +1,77 @@
+'use strict';
+
+const types = require('../../tokenizer/types.cjs');
+
+function consumeRaw() {
+ return this.createSingleNodeList(
+ this.Raw(this.tokenIndex, null, false)
+ );
+}
+
+function parentheses() {
+ this.skipSC();
+
+ if (this.tokenType === types.Ident &&
+ this.lookupNonWSType(1) === types.Colon) {
+ return this.createSingleNodeList(
+ this.Declaration()
+ );
+ }
+
+ return readSequence.call(this);
+}
+
+function readSequence() {
+ const children = this.createList();
+ let child;
+
+ this.skipSC();
+
+ scan:
+ while (!this.eof) {
+ switch (this.tokenType) {
+ case types.Comment:
+ case types.WhiteSpace:
+ this.next();
+ continue;
+
+ case types.Function:
+ child = this.Function(consumeRaw, this.scope.AtrulePrelude);
+ break;
+
+ case types.Ident:
+ child = this.Identifier();
+ break;
+
+ case types.LeftParenthesis:
+ child = this.Parentheses(parentheses, this.scope.AtrulePrelude);
+ break;
+
+ default:
+ break scan;
+ }
+
+ children.push(child);
+ }
+
+ return children;
+}
+
+const supports = {
+ parse: {
+ prelude() {
+ const children = readSequence.call(this);
+
+ if (this.getFirstListNode(children) === null) {
+ this.error('Condition is expected');
+ }
+
+ return children;
+ },
+ block(isStyleBlock = false) {
+ return this.Block(isStyleBlock);
+ }
+ }
+};
+
+module.exports = supports;
diff --git a/node_modules/css-tree/cjs/syntax/config/generator.cjs b/node_modules/css-tree/cjs/syntax/config/generator.cjs
new file mode 100644
index 0000000..c092458
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/config/generator.cjs
@@ -0,0 +1,9 @@
+'use strict';
+
+const indexGenerate = require('../node/index-generate.cjs');
+
+const config = {
+ node: indexGenerate
+};
+
+module.exports = config;
diff --git a/node_modules/css-tree/cjs/syntax/config/lexer.cjs b/node_modules/css-tree/cjs/syntax/config/lexer.cjs
new file mode 100644
index 0000000..083c74c
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/config/lexer.cjs
@@ -0,0 +1,12 @@
+'use strict';
+
+const data = require('../../data.cjs');
+const index = require('../node/index.cjs');
+
+const lexerConfig = {
+ generic: true,
+ ...data,
+ node: index
+};
+
+module.exports = lexerConfig;
diff --git a/node_modules/css-tree/cjs/syntax/config/mix.cjs b/node_modules/css-tree/cjs/syntax/config/mix.cjs
new file mode 100644
index 0000000..2d03af7
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/config/mix.cjs
@@ -0,0 +1,119 @@
+'use strict';
+
+function appendOrSet(a, b) {
+ if (typeof b === 'string' && /^\s*\|/.test(b)) {
+ return typeof a === 'string'
+ ? a + b
+ : b.replace(/^\s*\|\s*/, '');
+ }
+
+ return b || null;
+}
+
+function sliceProps(obj, props) {
+ const result = Object.create(null);
+
+ for (const [key, value] of Object.entries(obj)) {
+ if (value) {
+ result[key] = {};
+ for (const prop of Object.keys(value)) {
+ if (props.includes(prop)) {
+ result[key][prop] = value[prop];
+ }
+ }
+ }
+ }
+
+ return result;
+}
+
+function mix(dest, src) {
+ const result = { ...dest };
+
+ for (const [prop, value] of Object.entries(src)) {
+ switch (prop) {
+ case 'generic':
+ result[prop] = Boolean(value);
+ break;
+
+ case 'units':
+ result[prop] = { ...dest[prop] };
+ for (const [name, patch] of Object.entries(value)) {
+ result[prop][name] = Array.isArray(patch) ? patch : [];
+ }
+ break;
+
+ case 'atrules':
+ result[prop] = { ...dest[prop] };
+
+ for (const [name, atrule] of Object.entries(value)) {
+ const exists = result[prop][name] || {};
+ const current = result[prop][name] = {
+ prelude: exists.prelude || null,
+ descriptors: {
+ ...exists.descriptors
+ }
+ };
+
+ if (!atrule) {
+ continue;
+ }
+
+ current.prelude = atrule.prelude
+ ? appendOrSet(current.prelude, atrule.prelude)
+ : current.prelude || null;
+
+ for (const [descriptorName, descriptorValue] of Object.entries(atrule.descriptors || {})) {
+ current.descriptors[descriptorName] = descriptorValue
+ ? appendOrSet(current.descriptors[descriptorName], descriptorValue)
+ : null;
+ }
+
+ if (!Object.keys(current.descriptors).length) {
+ current.descriptors = null;
+ }
+ }
+ break;
+
+ case 'types':
+ case 'properties':
+ result[prop] = { ...dest[prop] };
+ for (const [name, syntax] of Object.entries(value)) {
+ result[prop][name] = appendOrSet(result[prop][name], syntax);
+ }
+ break;
+
+ case 'scope':
+ result[prop] = { ...dest[prop] };
+ for (const [name, props] of Object.entries(value)) {
+ result[prop][name] = { ...result[prop][name], ...props };
+ }
+ break;
+
+ case 'parseContext':
+ result[prop] = {
+ ...dest[prop],
+ ...value
+ };
+ break;
+
+ case 'atrule':
+ case 'pseudo':
+ result[prop] = {
+ ...dest[prop],
+ ...sliceProps(value, ['parse']) };
+ break;
+
+ case 'node':
+ result[prop] = {
+ ...dest[prop],
+ ...sliceProps(value, ['name', 'structure', 'parse', 'generate', 'walkContext'])
+ };
+ break;
+ }
+ }
+
+ return result;
+}
+
+module.exports = mix;
diff --git a/node_modules/css-tree/cjs/syntax/config/parser-selector.cjs b/node_modules/css-tree/cjs/syntax/config/parser-selector.cjs
new file mode 100644
index 0000000..03b1683
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/config/parser-selector.cjs
@@ -0,0 +1,19 @@
+'use strict';
+
+const index = require('../pseudo/index.cjs');
+const indexParseSelector = require('../node/index-parse-selector.cjs');
+const selector = require('../scope/selector.cjs');
+
+const config = {
+ parseContext: {
+ default: 'SelectorList',
+ selectorList: 'SelectorList',
+ selector: 'Selector'
+ },
+ scope: { Selector: selector },
+ atrule: {},
+ pseudo: index,
+ node: indexParseSelector
+};
+
+module.exports = config;
diff --git a/node_modules/css-tree/cjs/syntax/config/parser.cjs b/node_modules/css-tree/cjs/syntax/config/parser.cjs
new file mode 100644
index 0000000..af65e80
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/config/parser.cjs
@@ -0,0 +1,34 @@
+'use strict';
+
+const index = require('../scope/index.cjs');
+const index$1 = require('../atrule/index.cjs');
+const index$2 = require('../pseudo/index.cjs');
+const indexParse = require('../node/index-parse.cjs');
+
+const config = {
+ parseContext: {
+ default: 'StyleSheet',
+ stylesheet: 'StyleSheet',
+ atrule: 'Atrule',
+ atrulePrelude(options) {
+ return this.AtrulePrelude(options.atrule ? String(options.atrule) : null);
+ },
+ mediaQueryList: 'MediaQueryList',
+ mediaQuery: 'MediaQuery',
+ rule: 'Rule',
+ selectorList: 'SelectorList',
+ selector: 'Selector',
+ block() {
+ return this.Block(true);
+ },
+ declarationList: 'DeclarationList',
+ declaration: 'Declaration',
+ value: 'Value'
+ },
+ scope: index,
+ atrule: index$1,
+ pseudo: index$2,
+ node: indexParse
+};
+
+module.exports = config;
diff --git a/node_modules/css-tree/cjs/syntax/config/walker.cjs b/node_modules/css-tree/cjs/syntax/config/walker.cjs
new file mode 100644
index 0000000..95c8f7d
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/config/walker.cjs
@@ -0,0 +1,9 @@
+'use strict';
+
+const index = require('../node/index.cjs');
+
+const config = {
+ node: index
+};
+
+module.exports = config;
diff --git a/node_modules/css-tree/cjs/syntax/create.cjs b/node_modules/css-tree/cjs/syntax/create.cjs
new file mode 100644
index 0000000..aee487f
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/create.cjs
@@ -0,0 +1,57 @@
+'use strict';
+
+const index = require('../tokenizer/index.cjs');
+const create = require('../parser/create.cjs');
+const create$2 = require('../generator/create.cjs');
+const create$3 = require('../convertor/create.cjs');
+const create$1 = require('../walker/create.cjs');
+const Lexer = require('../lexer/Lexer.cjs');
+const mix = require('./config/mix.cjs');
+
+function createSyntax(config) {
+ const parse = create.createParser(config);
+ const walk = create$1.createWalker(config);
+ const generate = create$2.createGenerator(config);
+ const { fromPlainObject, toPlainObject } = create$3.createConvertor(walk);
+
+ const syntax = {
+ lexer: null,
+ createLexer: config => new Lexer.Lexer(config, syntax, syntax.lexer.structure),
+
+ tokenize: index.tokenize,
+ parse,
+ generate,
+
+ walk,
+ find: walk.find,
+ findLast: walk.findLast,
+ findAll: walk.findAll,
+
+ fromPlainObject,
+ toPlainObject,
+
+ fork(extension) {
+ const base = mix({}, config); // copy of config
+
+ return createSyntax(
+ typeof extension === 'function'
+ ? extension(base, Object.assign)
+ : mix(base, extension)
+ );
+ }
+ };
+
+ syntax.lexer = new Lexer.Lexer({
+ generic: true,
+ units: config.units,
+ types: config.types,
+ atrules: config.atrules,
+ properties: config.properties,
+ node: config.node
+ }, syntax);
+
+ return syntax;
+}
+const createSyntax$1 = config => createSyntax(mix({}, config));
+
+module.exports = createSyntax$1;
diff --git a/node_modules/css-tree/cjs/syntax/function/expression.cjs b/node_modules/css-tree/cjs/syntax/function/expression.cjs
new file mode 100644
index 0000000..43d8137
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/function/expression.cjs
@@ -0,0 +1,11 @@
+'use strict';
+
+// legacy IE function
+// expression( )
+function expressionFn() {
+ return this.createSingleNodeList(
+ this.Raw(this.tokenIndex, null, false)
+ );
+}
+
+module.exports = expressionFn;
diff --git a/node_modules/css-tree/cjs/syntax/function/var.cjs b/node_modules/css-tree/cjs/syntax/function/var.cjs
new file mode 100644
index 0000000..9672970
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/function/var.cjs
@@ -0,0 +1,43 @@
+'use strict';
+
+const types = require('../../tokenizer/types.cjs');
+
+// var( , ? )
+function varFn() {
+ const children = this.createList();
+
+ this.skipSC();
+
+ // NOTE: Don't check more than a first argument is an ident, rest checks are for lexer
+ children.push(this.Identifier());
+
+ this.skipSC();
+
+ if (this.tokenType === types.Comma) {
+ children.push(this.Operator());
+
+ const startIndex = this.tokenIndex;
+ const value = this.parseCustomProperty
+ ? this.Value(null)
+ : this.Raw(this.tokenIndex, this.consumeUntilExclamationMarkOrSemicolon, false);
+
+ if (value.type === 'Value' && value.children.isEmpty) {
+ for (let offset = startIndex - this.tokenIndex; offset <= 0; offset++) {
+ if (this.lookupType(offset) === types.WhiteSpace) {
+ value.children.appendData({
+ type: 'WhiteSpace',
+ loc: null,
+ value: ' '
+ });
+ break;
+ }
+ }
+ }
+
+ children.push(value);
+ }
+
+ return children;
+}
+
+module.exports = varFn;
diff --git a/node_modules/css-tree/cjs/syntax/index.cjs b/node_modules/css-tree/cjs/syntax/index.cjs
new file mode 100644
index 0000000..24de495
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/index.cjs
@@ -0,0 +1,14 @@
+'use strict';
+
+const create = require('./create.cjs');
+const lexer = require('./config/lexer.cjs');
+const parser = require('./config/parser.cjs');
+const walker = require('./config/walker.cjs');
+
+const syntax = create({
+ ...lexer,
+ ...parser,
+ ...walker
+});
+
+module.exports = syntax;
diff --git a/node_modules/css-tree/cjs/syntax/node/AnPlusB.cjs b/node_modules/css-tree/cjs/syntax/node/AnPlusB.cjs
new file mode 100644
index 0000000..cd59927
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/node/AnPlusB.cjs
@@ -0,0 +1,293 @@
+'use strict';
+
+const types = require('../../tokenizer/types.cjs');
+const charCodeDefinitions = require('../../tokenizer/char-code-definitions.cjs');
+
+const PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)
+const HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)
+const N = 0x006E; // U+006E LATIN SMALL LETTER N (n)
+const DISALLOW_SIGN = true;
+const ALLOW_SIGN = false;
+
+function checkInteger(offset, disallowSign) {
+ let pos = this.tokenStart + offset;
+ const code = this.charCodeAt(pos);
+
+ if (code === PLUSSIGN || code === HYPHENMINUS) {
+ if (disallowSign) {
+ this.error('Number sign is not allowed');
+ }
+ pos++;
+ }
+
+ for (; pos < this.tokenEnd; pos++) {
+ if (!charCodeDefinitions.isDigit(this.charCodeAt(pos))) {
+ this.error('Integer is expected', pos);
+ }
+ }
+}
+
+function checkTokenIsInteger(disallowSign) {
+ return checkInteger.call(this, 0, disallowSign);
+}
+
+function expectCharCode(offset, code) {
+ if (!this.cmpChar(this.tokenStart + offset, code)) {
+ let msg = '';
+
+ switch (code) {
+ case N:
+ msg = 'N is expected';
+ break;
+ case HYPHENMINUS:
+ msg = 'HyphenMinus is expected';
+ break;
+ }
+
+ this.error(msg, this.tokenStart + offset);
+ }
+}
+
+// ...
+// ... ['+' | '-']
+function consumeB() {
+ let offset = 0;
+ let sign = 0;
+ let type = this.tokenType;
+
+ while (type === types.WhiteSpace || type === types.Comment) {
+ type = this.lookupType(++offset);
+ }
+
+ if (type !== types.Number) {
+ if (this.isDelim(PLUSSIGN, offset) ||
+ this.isDelim(HYPHENMINUS, offset)) {
+ sign = this.isDelim(PLUSSIGN, offset) ? PLUSSIGN : HYPHENMINUS;
+
+ do {
+ type = this.lookupType(++offset);
+ } while (type === types.WhiteSpace || type === types.Comment);
+
+ if (type !== types.Number) {
+ this.skip(offset);
+ checkTokenIsInteger.call(this, DISALLOW_SIGN);
+ }
+ } else {
+ return null;
+ }
+ }
+
+ if (offset > 0) {
+ this.skip(offset);
+ }
+
+ if (sign === 0) {
+ type = this.charCodeAt(this.tokenStart);
+ if (type !== PLUSSIGN && type !== HYPHENMINUS) {
+ this.error('Number sign is expected');
+ }
+ }
+
+ checkTokenIsInteger.call(this, sign !== 0);
+ return sign === HYPHENMINUS ? '-' + this.consume(types.Number) : this.consume(types.Number);
+}
+
+// An+B microsyntax https://www.w3.org/TR/css-syntax-3/#anb
+const name = 'AnPlusB';
+const structure = {
+ a: [String, null],
+ b: [String, null]
+};
+
+function parse() {
+ /* eslint-disable brace-style*/
+ const start = this.tokenStart;
+ let a = null;
+ let b = null;
+
+ //
+ if (this.tokenType === types.Number) {
+ checkTokenIsInteger.call(this, ALLOW_SIGN);
+ b = this.consume(types.Number);
+ }
+
+ // -n
+ // -n
+ // -n ['+' | '-']
+ // -n-
+ //
+ else if (this.tokenType === types.Ident && this.cmpChar(this.tokenStart, HYPHENMINUS)) {
+ a = '-1';
+
+ expectCharCode.call(this, 1, N);
+
+ switch (this.tokenEnd - this.tokenStart) {
+ // -n
+ // -n
+ // -n ['+' | '-']
+ case 2:
+ this.next();
+ b = consumeB.call(this);
+ break;
+
+ // -n-
+ case 3:
+ expectCharCode.call(this, 2, HYPHENMINUS);
+
+ this.next();
+ this.skipSC();
+
+ checkTokenIsInteger.call(this, DISALLOW_SIGN);
+
+ b = '-' + this.consume(types.Number);
+ break;
+
+ //
+ default:
+ expectCharCode.call(this, 2, HYPHENMINUS);
+ checkInteger.call(this, 3, DISALLOW_SIGN);
+ this.next();
+
+ b = this.substrToCursor(start + 2);
+ }
+ }
+
+ // '+'? n
+ // '+'? n
+ // '+'? n ['+' | '-']
+ // '+'? n-
+ // '+'?
+ else if (this.tokenType === types.Ident || (this.isDelim(PLUSSIGN) && this.lookupType(1) === types.Ident)) {
+ let sign = 0;
+ a = '1';
+
+ // just ignore a plus
+ if (this.isDelim(PLUSSIGN)) {
+ sign = 1;
+ this.next();
+ }
+
+ expectCharCode.call(this, 0, N);
+
+ switch (this.tokenEnd - this.tokenStart) {
+ // '+'? n
+ // '+'? n
+ // '+'? n ['+' | '-']
+ case 1:
+ this.next();
+ b = consumeB.call(this);
+ break;
+
+ // '+'? n-
+ case 2:
+ expectCharCode.call(this, 1, HYPHENMINUS);
+
+ this.next();
+ this.skipSC();
+
+ checkTokenIsInteger.call(this, DISALLOW_SIGN);
+
+ b = '-' + this.consume(types.Number);
+ break;
+
+ // '+'?
+ default:
+ expectCharCode.call(this, 1, HYPHENMINUS);
+ checkInteger.call(this, 2, DISALLOW_SIGN);
+ this.next();
+
+ b = this.substrToCursor(start + sign + 1);
+ }
+ }
+
+ //
+ //
+ //
+ //
+ // ['+' | '-']
+ else if (this.tokenType === types.Dimension) {
+ const code = this.charCodeAt(this.tokenStart);
+ const sign = code === PLUSSIGN || code === HYPHENMINUS;
+ let i = this.tokenStart + sign;
+
+ for (; i < this.tokenEnd; i++) {
+ if (!charCodeDefinitions.isDigit(this.charCodeAt(i))) {
+ break;
+ }
+ }
+
+ if (i === this.tokenStart + sign) {
+ this.error('Integer is expected', this.tokenStart + sign);
+ }
+
+ expectCharCode.call(this, i - this.tokenStart, N);
+ a = this.substring(start, i);
+
+ //
+ //
+ // ['+' | '-']
+ if (i + 1 === this.tokenEnd) {
+ this.next();
+ b = consumeB.call(this);
+ } else {
+ expectCharCode.call(this, i - this.tokenStart + 1, HYPHENMINUS);
+
+ //
+ if (i + 2 === this.tokenEnd) {
+ this.next();
+ this.skipSC();
+ checkTokenIsInteger.call(this, DISALLOW_SIGN);
+ b = '-' + this.consume(types.Number);
+ }
+ //
+ else {
+ checkInteger.call(this, i - this.tokenStart + 2, DISALLOW_SIGN);
+ this.next();
+ b = this.substrToCursor(i + 1);
+ }
+ }
+ } else {
+ this.error();
+ }
+
+ if (a !== null && a.charCodeAt(0) === PLUSSIGN) {
+ a = a.substr(1);
+ }
+
+ if (b !== null && b.charCodeAt(0) === PLUSSIGN) {
+ b = b.substr(1);
+ }
+
+ return {
+ type: 'AnPlusB',
+ loc: this.getLocation(start, this.tokenStart),
+ a,
+ b
+ };
+}
+
+function generate(node) {
+ if (node.a) {
+ const a =
+ node.a === '+1' && 'n' ||
+ node.a === '1' && 'n' ||
+ node.a === '-1' && '-n' ||
+ node.a + 'n';
+
+ if (node.b) {
+ const b = node.b[0] === '-' || node.b[0] === '+'
+ ? node.b
+ : '+' + node.b;
+ this.tokenize(a + b);
+ } else {
+ this.tokenize(a);
+ }
+ } else {
+ this.tokenize(node.b);
+ }
+}
+
+exports.generate = generate;
+exports.name = name;
+exports.parse = parse;
+exports.structure = structure;
diff --git a/node_modules/css-tree/cjs/syntax/node/Atrule.cjs b/node_modules/css-tree/cjs/syntax/node/Atrule.cjs
new file mode 100644
index 0000000..4474630
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/node/Atrule.cjs
@@ -0,0 +1,103 @@
+'use strict';
+
+const types = require('../../tokenizer/types.cjs');
+
+function consumeRaw(startToken) {
+ return this.Raw(startToken, this.consumeUntilLeftCurlyBracketOrSemicolon, true);
+}
+
+function isDeclarationBlockAtrule() {
+ for (let offset = 1, type; type = this.lookupType(offset); offset++) {
+ if (type === types.RightCurlyBracket) {
+ return true;
+ }
+
+ if (type === types.LeftCurlyBracket ||
+ type === types.AtKeyword) {
+ return false;
+ }
+ }
+
+ return false;
+}
+
+
+const name = 'Atrule';
+const walkContext = 'atrule';
+const structure = {
+ name: String,
+ prelude: ['AtrulePrelude', 'Raw', null],
+ block: ['Block', null]
+};
+
+function parse(isDeclaration = false) {
+ const start = this.tokenStart;
+ let name;
+ let nameLowerCase;
+ let prelude = null;
+ let block = null;
+
+ this.eat(types.AtKeyword);
+
+ name = this.substrToCursor(start + 1);
+ nameLowerCase = name.toLowerCase();
+ this.skipSC();
+
+ // parse prelude
+ if (this.eof === false &&
+ this.tokenType !== types.LeftCurlyBracket &&
+ this.tokenType !== types.Semicolon) {
+ if (this.parseAtrulePrelude) {
+ prelude = this.parseWithFallback(this.AtrulePrelude.bind(this, name, isDeclaration), consumeRaw);
+ } else {
+ prelude = consumeRaw.call(this, this.tokenIndex);
+ }
+
+ this.skipSC();
+ }
+
+ switch (this.tokenType) {
+ case types.Semicolon:
+ this.next();
+ break;
+
+ case types.LeftCurlyBracket:
+ if (hasOwnProperty.call(this.atrule, nameLowerCase) &&
+ typeof this.atrule[nameLowerCase].block === 'function') {
+ block = this.atrule[nameLowerCase].block.call(this, isDeclaration);
+ } else {
+ // TODO: should consume block content as Raw?
+ block = this.Block(isDeclarationBlockAtrule.call(this));
+ }
+
+ break;
+ }
+
+ return {
+ type: 'Atrule',
+ loc: this.getLocation(start, this.tokenStart),
+ name,
+ prelude,
+ block
+ };
+}
+
+function generate(node) {
+ this.token(types.AtKeyword, '@' + node.name);
+
+ if (node.prelude !== null) {
+ this.node(node.prelude);
+ }
+
+ if (node.block) {
+ this.node(node.block);
+ } else {
+ this.token(types.Semicolon, ';');
+ }
+}
+
+exports.generate = generate;
+exports.name = name;
+exports.parse = parse;
+exports.structure = structure;
+exports.walkContext = walkContext;
diff --git a/node_modules/css-tree/cjs/syntax/node/AtrulePrelude.cjs b/node_modules/css-tree/cjs/syntax/node/AtrulePrelude.cjs
new file mode 100644
index 0000000..0db69b6
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/node/AtrulePrelude.cjs
@@ -0,0 +1,52 @@
+'use strict';
+
+const types = require('../../tokenizer/types.cjs');
+
+const name = 'AtrulePrelude';
+const walkContext = 'atrulePrelude';
+const structure = {
+ children: [[]]
+};
+
+function parse(name) {
+ let children = null;
+
+ if (name !== null) {
+ name = name.toLowerCase();
+ }
+
+ this.skipSC();
+
+ if (hasOwnProperty.call(this.atrule, name) &&
+ typeof this.atrule[name].prelude === 'function') {
+ // custom consumer
+ children = this.atrule[name].prelude.call(this);
+ } else {
+ // default consumer
+ children = this.readSequence(this.scope.AtrulePrelude);
+ }
+
+ this.skipSC();
+
+ if (this.eof !== true &&
+ this.tokenType !== types.LeftCurlyBracket &&
+ this.tokenType !== types.Semicolon) {
+ this.error('Semicolon or block is expected');
+ }
+
+ return {
+ type: 'AtrulePrelude',
+ loc: this.getLocationFromList(children),
+ children
+ };
+}
+
+function generate(node) {
+ this.children(node);
+}
+
+exports.generate = generate;
+exports.name = name;
+exports.parse = parse;
+exports.structure = structure;
+exports.walkContext = walkContext;
diff --git a/node_modules/css-tree/cjs/syntax/node/AttributeSelector.cjs b/node_modules/css-tree/cjs/syntax/node/AttributeSelector.cjs
new file mode 100644
index 0000000..757d4eb
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/node/AttributeSelector.cjs
@@ -0,0 +1,148 @@
+'use strict';
+
+const types = require('../../tokenizer/types.cjs');
+
+const DOLLARSIGN = 0x0024; // U+0024 DOLLAR SIGN ($)
+const ASTERISK = 0x002A; // U+002A ASTERISK (*)
+const EQUALSSIGN = 0x003D; // U+003D EQUALS SIGN (=)
+const CIRCUMFLEXACCENT = 0x005E; // U+005E (^)
+const VERTICALLINE = 0x007C; // U+007C VERTICAL LINE (|)
+const TILDE = 0x007E; // U+007E TILDE (~)
+
+function getAttributeName() {
+ if (this.eof) {
+ this.error('Unexpected end of input');
+ }
+
+ const start = this.tokenStart;
+ let expectIdent = false;
+
+ if (this.isDelim(ASTERISK)) {
+ expectIdent = true;
+ this.next();
+ } else if (!this.isDelim(VERTICALLINE)) {
+ this.eat(types.Ident);
+ }
+
+ if (this.isDelim(VERTICALLINE)) {
+ if (this.charCodeAt(this.tokenStart + 1) !== EQUALSSIGN) {
+ this.next();
+ this.eat(types.Ident);
+ } else if (expectIdent) {
+ this.error('Identifier is expected', this.tokenEnd);
+ }
+ } else if (expectIdent) {
+ this.error('Vertical line is expected');
+ }
+
+ return {
+ type: 'Identifier',
+ loc: this.getLocation(start, this.tokenStart),
+ name: this.substrToCursor(start)
+ };
+}
+
+function getOperator() {
+ const start = this.tokenStart;
+ const code = this.charCodeAt(start);
+
+ if (code !== EQUALSSIGN && // =
+ code !== TILDE && // ~=
+ code !== CIRCUMFLEXACCENT && // ^=
+ code !== DOLLARSIGN && // $=
+ code !== ASTERISK && // *=
+ code !== VERTICALLINE // |=
+ ) {
+ this.error('Attribute selector (=, ~=, ^=, $=, *=, |=) is expected');
+ }
+
+ this.next();
+
+ if (code !== EQUALSSIGN) {
+ if (!this.isDelim(EQUALSSIGN)) {
+ this.error('Equal sign is expected');
+ }
+
+ this.next();
+ }
+
+ return this.substrToCursor(start);
+}
+
+// '[' ']'
+// '[' [ | ] ? ']'
+const name = 'AttributeSelector';
+const structure = {
+ name: 'Identifier',
+ matcher: [String, null],
+ value: ['String', 'Identifier', null],
+ flags: [String, null]
+};
+
+function parse() {
+ const start = this.tokenStart;
+ let name;
+ let matcher = null;
+ let value = null;
+ let flags = null;
+
+ this.eat(types.LeftSquareBracket);
+ this.skipSC();
+
+ name = getAttributeName.call(this);
+ this.skipSC();
+
+ if (this.tokenType !== types.RightSquareBracket) {
+ // avoid case `[name i]`
+ if (this.tokenType !== types.Ident) {
+ matcher = getOperator.call(this);
+
+ this.skipSC();
+
+ value = this.tokenType === types.String
+ ? this.String()
+ : this.Identifier();
+
+ this.skipSC();
+ }
+
+ // attribute flags
+ if (this.tokenType === types.Ident) {
+ flags = this.consume(types.Ident);
+
+ this.skipSC();
+ }
+ }
+
+ this.eat(types.RightSquareBracket);
+
+ return {
+ type: 'AttributeSelector',
+ loc: this.getLocation(start, this.tokenStart),
+ name,
+ matcher,
+ value,
+ flags
+ };
+}
+
+function generate(node) {
+ this.token(types.Delim, '[');
+ this.node(node.name);
+
+ if (node.matcher !== null) {
+ this.tokenize(node.matcher);
+ this.node(node.value);
+ }
+
+ if (node.flags !== null) {
+ this.token(types.Ident, node.flags);
+ }
+
+ this.token(types.Delim, ']');
+}
+
+exports.generate = generate;
+exports.name = name;
+exports.parse = parse;
+exports.structure = structure;
diff --git a/node_modules/css-tree/cjs/syntax/node/Block.cjs b/node_modules/css-tree/cjs/syntax/node/Block.cjs
new file mode 100644
index 0000000..ce1058f
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/node/Block.cjs
@@ -0,0 +1,96 @@
+'use strict';
+
+const types = require('../../tokenizer/types.cjs');
+
+const AMPERSAND = 0x0026; // U+0026 AMPERSAND (&)
+
+function consumeRaw(startToken) {
+ return this.Raw(startToken, null, true);
+}
+function consumeRule() {
+ return this.parseWithFallback(this.Rule, consumeRaw);
+}
+function consumeRawDeclaration(startToken) {
+ return this.Raw(startToken, this.consumeUntilSemicolonIncluded, true);
+}
+function consumeDeclaration() {
+ if (this.tokenType === types.Semicolon) {
+ return consumeRawDeclaration.call(this, this.tokenIndex);
+ }
+
+ const node = this.parseWithFallback(this.Declaration, consumeRawDeclaration);
+
+ if (this.tokenType === types.Semicolon) {
+ this.next();
+ }
+
+ return node;
+}
+
+const name = 'Block';
+const walkContext = 'block';
+const structure = {
+ children: [[
+ 'Atrule',
+ 'Rule',
+ 'Declaration'
+ ]]
+};
+
+function parse(isStyleBlock) {
+ const consumer = isStyleBlock ? consumeDeclaration : consumeRule;
+ const start = this.tokenStart;
+ let children = this.createList();
+
+ this.eat(types.LeftCurlyBracket);
+
+ scan:
+ while (!this.eof) {
+ switch (this.tokenType) {
+ case types.RightCurlyBracket:
+ break scan;
+
+ case types.WhiteSpace:
+ case types.Comment:
+ this.next();
+ break;
+
+ case types.AtKeyword:
+ children.push(this.parseWithFallback(this.Atrule.bind(this, isStyleBlock), consumeRaw));
+ break;
+
+ default:
+ if (isStyleBlock && this.isDelim(AMPERSAND)) {
+ children.push(consumeRule.call(this));
+ } else {
+ children.push(consumer.call(this));
+ }
+ }
+ }
+
+ if (!this.eof) {
+ this.eat(types.RightCurlyBracket);
+ }
+
+ return {
+ type: 'Block',
+ loc: this.getLocation(start, this.tokenStart),
+ children
+ };
+}
+
+function generate(node) {
+ this.token(types.LeftCurlyBracket, '{');
+ this.children(node, prev => {
+ if (prev.type === 'Declaration') {
+ this.token(types.Semicolon, ';');
+ }
+ });
+ this.token(types.RightCurlyBracket, '}');
+}
+
+exports.generate = generate;
+exports.name = name;
+exports.parse = parse;
+exports.structure = structure;
+exports.walkContext = walkContext;
diff --git a/node_modules/css-tree/cjs/syntax/node/Brackets.cjs b/node_modules/css-tree/cjs/syntax/node/Brackets.cjs
new file mode 100644
index 0000000..eb18131
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/node/Brackets.cjs
@@ -0,0 +1,38 @@
+'use strict';
+
+const types = require('../../tokenizer/types.cjs');
+
+const name = 'Brackets';
+const structure = {
+ children: [[]]
+};
+
+function parse(readSequence, recognizer) {
+ const start = this.tokenStart;
+ let children = null;
+
+ this.eat(types.LeftSquareBracket);
+
+ children = readSequence.call(this, recognizer);
+
+ if (!this.eof) {
+ this.eat(types.RightSquareBracket);
+ }
+
+ return {
+ type: 'Brackets',
+ loc: this.getLocation(start, this.tokenStart),
+ children
+ };
+}
+
+function generate(node) {
+ this.token(types.Delim, '[');
+ this.children(node);
+ this.token(types.Delim, ']');
+}
+
+exports.generate = generate;
+exports.name = name;
+exports.parse = parse;
+exports.structure = structure;
diff --git a/node_modules/css-tree/cjs/syntax/node/CDC.cjs b/node_modules/css-tree/cjs/syntax/node/CDC.cjs
new file mode 100644
index 0000000..aadf3ad
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/node/CDC.cjs
@@ -0,0 +1,26 @@
+'use strict';
+
+const types = require('../../tokenizer/types.cjs');
+
+const name = 'CDC';
+const structure = [];
+
+function parse() {
+ const start = this.tokenStart;
+
+ this.eat(types.CDC); // -->
+
+ return {
+ type: 'CDC',
+ loc: this.getLocation(start, this.tokenStart)
+ };
+}
+
+function generate() {
+ this.token(types.CDC, '-->');
+}
+
+exports.generate = generate;
+exports.name = name;
+exports.parse = parse;
+exports.structure = structure;
diff --git a/node_modules/css-tree/cjs/syntax/node/CDO.cjs b/node_modules/css-tree/cjs/syntax/node/CDO.cjs
new file mode 100644
index 0000000..0e98217
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/node/CDO.cjs
@@ -0,0 +1,26 @@
+'use strict';
+
+const types = require('../../tokenizer/types.cjs');
+
+const name = 'CDO';
+const structure = [];
+
+function parse() {
+ const start = this.tokenStart;
+
+ this.eat(types.CDO); //
+ child = this.CDC();
+ break;
+
+ // CSS Syntax Module Level 3
+ // §2.2 Error handling
+ // At the "top level" of a stylesheet, an starts an at-rule.
+ case types.AtKeyword:
+ child = this.parseWithFallback(this.Atrule, consumeRaw);
+ break;
+
+ // Anything else starts a qualified rule ...
+ default:
+ child = this.parseWithFallback(this.Rule, consumeRaw);
+ }
+
+ children.push(child);
+ }
+
+ return {
+ type: 'StyleSheet',
+ loc: this.getLocation(start, this.tokenStart),
+ children
+ };
+}
+
+function generate(node) {
+ this.children(node);
+}
+
+exports.generate = generate;
+exports.name = name;
+exports.parse = parse;
+exports.structure = structure;
+exports.walkContext = walkContext;
diff --git a/node_modules/css-tree/cjs/syntax/node/TypeSelector.cjs b/node_modules/css-tree/cjs/syntax/node/TypeSelector.cjs
new file mode 100644
index 0000000..1d15270
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/node/TypeSelector.cjs
@@ -0,0 +1,59 @@
+'use strict';
+
+const types = require('../../tokenizer/types.cjs');
+
+const ASTERISK = 0x002A; // U+002A ASTERISK (*)
+const VERTICALLINE = 0x007C; // U+007C VERTICAL LINE (|)
+
+function eatIdentifierOrAsterisk() {
+ if (this.tokenType !== types.Ident &&
+ this.isDelim(ASTERISK) === false) {
+ this.error('Identifier or asterisk is expected');
+ }
+
+ this.next();
+}
+
+const name = 'TypeSelector';
+const structure = {
+ name: String
+};
+
+// ident
+// ident|ident
+// ident|*
+// *
+// *|ident
+// *|*
+// |ident
+// |*
+function parse() {
+ const start = this.tokenStart;
+
+ if (this.isDelim(VERTICALLINE)) {
+ this.next();
+ eatIdentifierOrAsterisk.call(this);
+ } else {
+ eatIdentifierOrAsterisk.call(this);
+
+ if (this.isDelim(VERTICALLINE)) {
+ this.next();
+ eatIdentifierOrAsterisk.call(this);
+ }
+ }
+
+ return {
+ type: 'TypeSelector',
+ loc: this.getLocation(start, this.tokenStart),
+ name: this.substrToCursor(start)
+ };
+}
+
+function generate(node) {
+ this.tokenize(node.name);
+}
+
+exports.generate = generate;
+exports.name = name;
+exports.parse = parse;
+exports.structure = structure;
diff --git a/node_modules/css-tree/cjs/syntax/node/UnicodeRange.cjs b/node_modules/css-tree/cjs/syntax/node/UnicodeRange.cjs
new file mode 100644
index 0000000..5585e8f
--- /dev/null
+++ b/node_modules/css-tree/cjs/syntax/node/UnicodeRange.cjs
@@ -0,0 +1,158 @@
+'use strict';
+
+const types = require('../../tokenizer/types.cjs');
+const charCodeDefinitions = require('../../tokenizer/char-code-definitions.cjs');
+
+const PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)
+const HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)
+const QUESTIONMARK = 0x003F; // U+003F QUESTION MARK (?)
+
+function eatHexSequence(offset, allowDash) {
+ let len = 0;
+
+ for (let pos = this.tokenStart + offset; pos < this.tokenEnd; pos++) {
+ const code = this.charCodeAt(pos);
+
+ if (code === HYPHENMINUS && allowDash && len !== 0) {
+ eatHexSequence.call(this, offset + len + 1, false);
+ return -1;
+ }
+
+ if (!charCodeDefinitions.isHexDigit(code)) {
+ this.error(
+ allowDash && len !== 0
+ ? 'Hyphen minus' + (len < 6 ? ' or hex digit' : '') + ' is expected'
+ : (len < 6 ? 'Hex digit is expected' : 'Unexpected input'),
+ pos
+ );
+ }
+
+ if (++len > 6) {
+ this.error('Too many hex digits', pos);
+ } }
+
+ this.next();
+ return len;
+}
+
+function eatQuestionMarkSequence(max) {
+ let count = 0;
+
+ while (this.isDelim(QUESTIONMARK)) {
+ if (++count > max) {
+ this.error('Too many question marks');
+ }
+
+ this.next();
+ }
+}
+
+function startsWith(code) {
+ if (this.charCodeAt(this.tokenStart) !== code) {
+ this.error((code === PLUSSIGN ? 'Plus sign' : 'Hyphen minus') + ' is expected');
+ }
+}
+
+// https://drafts.csswg.org/css-syntax/#urange
+// Informally, the production has three forms:
+// U+0001
+// Defines a range consisting of a single code point, in this case the code point "1".
+// U+0001-00ff
+// Defines a range of codepoints between the first and the second value, in this case
+// the range between "1" and "ff" (255 in decimal) inclusive.
+// U+00??
+// Defines a range of codepoints where the "?" characters range over all hex digits,
+// in this case defining the same as the value U+0000-00ff.
+// In each form, a maximum of 6 digits is allowed for each hexadecimal number (if you treat "?" as a hexadecimal digit).
+//
+// =
+// u '+' '?'* |
+// u '?'* |
+// u '?'* |
+// u |
+// u |
+// u '+' '?'+
+function scanUnicodeRange() {
+ let hexLength = 0;
+
+ switch (this.tokenType) {
+ case types.Number:
+ // u '?'*
+ // u