From d55263193a6c9f03fa64435969dd80b822eaf5aa Mon Sep 17 00:00:00 2001 From: d3ller Date: Wed, 11 Mar 2026 23:03:59 +0100 Subject: [PATCH 01/10] refactor(build): drastically simplify the build process --- vite.config.ts | 124 ++++--------------------------------------------- 1 file changed, 9 insertions(+), 115 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index 828668e..dffb9b5 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,119 +1,13 @@ -import { defineConfig } from 'vite' -import path from 'path' -import fs from 'fs' -import banner from 'vite-plugin-banner' - -const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf-8')) - -const currentYear = new Date().getFullYear() -const version = pkg.version - -const builds = [ - { - entry: 'src/browser-entry.js', - fileName: 'blapy2.js', - name: 'Blapy2', - description: - 'Blapy2 runtime for browser usage, including Blapy V1 compatibility.', - }, - { - entry: 'src/modules/Blapymotion.js', - fileName: 'Blapymotion.js', - name: 'Blapymotion', - description: 'Blapy2 Animation module for browser usage.', - }, - { - entry: 'src/modules/BlapySocket.js', - fileName: 'BlapySocket.js', - name: 'BlapySocket', - description: 'Blapy2 Socket module for browser usage.', - }, -] - -const createBanner = (config) => - ` -/** - * ----------------------------------------------------------------------------------------- - * INTERSEL - 4 cité d'Hauteville - 75010 PARIS - * RCS PARIS 488 379 660 - NAF 721Z - * - * File : ${config.fileName} - * ${config.description} - * - * ----------------------------------------------------------------------------------------- - * @copyright Intersel 2015-${currentYear} - * @fileoverview ${config.description} - * @see {@link https://github.com/intersel/blapy2} - * @author E.Podvin - emmanuel.podvin@intersel.fr - * @version ${version} - * @license DonationWare - see https://github.com/intersel/blapy2/blob/master/LICENSE - * ----------------------------------------------------------------------------------------- - */ -`.trim() - -const defaultBuild = builds[0] +import { defineConfig } from 'vite'; +import { resolve } from 'node:path'; export default defineConfig({ build: { lib: { - entry: path.resolve(__dirname, defaultBuild.entry), - name: defaultBuild.name, - fileName: () => defaultBuild.fileName, - formats: ['iife'], - }, - outDir: 'dist', - emptyOutDir: true, - minify: 'terser', - terserOptions: { - format: { - comments: false, - }, - }, - rollupOptions: { - external: [], - }, - }, - test: { - environment: 'jsdom', - exclude: ['tests/e2e/**'], - }, - plugins: [ - banner(createBanner(defaultBuild)), - { - name: 'multiple-builds', - closeBundle: async () => { - if (process.env.NODE_ENV === 'production') { - const { build } = await import('vite') - - for (let i = 1; i < builds.length; i++) { - const buildConfig = builds[i] - - await build({ - configFile: false, - build: { - lib: { - entry: path.resolve(process.cwd(), buildConfig.entry), - name: buildConfig.name, - fileName: () => buildConfig.fileName, - formats: ['iife'], - }, - outDir: 'dist', - emptyOutDir: false, - minify: 'terser', - terserOptions: { - format: { - comments: false, - }, - }, - rollupOptions: { - external: [], - }, - }, - plugins: [banner(createBanner(buildConfig))], - }) - } - } - }, - }, - ], -}) + entry: resolve(__dirname, 'src/test.ts'), + name: 'Klapy', + fileName: 'blapy', + formats: ['es', 'umd'] + } + } +}); \ No newline at end of file From ab61a33032da6b6b98670fc3be7ff207d5d69fec Mon Sep 17 00:00:00 2001 From: d3ller Date: Wed, 11 Mar 2026 23:09:50 +0100 Subject: [PATCH 02/10] chore!: modernize stack with TypeScript and vanilla TS --- Blapy.js | 1 - src/core/AjaxService.ts | 110 ++++ src/core/Blapy.ts | 895 +++++++++++++++++++++++++++ src/core/BlapyBlock.ts | 88 +++ src/core/Logger.ts | 57 ++ src/core/Router.ts | 264 ++++++++ src/core/TemplateManager.ts | 636 +++++++++++++++++++ src/core/Utils.ts | 16 + src/index.js | 4 +- src/modules/Compatibility.js | 2 +- src/modules/HTMLCompatibility.ts | 13 + src/{core => old}/AjaxService.js | 0 src/{core => old}/Blapy2.js | 14 +- src/{core => old}/BlapyBlock.js | 0 src/{core => old}/Logger.js | 0 src/{core => old}/Router.js | 0 src/{core => old}/TemplateManager.js | 0 src/{core => old}/Utils.js | 0 src/types/html-extension.d.ts | 9 + 19 files changed, 2098 insertions(+), 11 deletions(-) delete mode 120000 Blapy.js create mode 100644 src/core/AjaxService.ts create mode 100644 src/core/Blapy.ts create mode 100644 src/core/BlapyBlock.ts create mode 100644 src/core/Logger.ts create mode 100644 src/core/Router.ts create mode 100644 src/core/TemplateManager.ts create mode 100644 src/core/Utils.ts create mode 100644 src/modules/HTMLCompatibility.ts rename src/{core => old}/AjaxService.js (100%) rename src/{core => old}/Blapy2.js (99%) rename src/{core => old}/BlapyBlock.js (100%) rename src/{core => old}/Logger.js (100%) rename src/{core => old}/Router.js (100%) rename src/{core => old}/TemplateManager.js (100%) rename src/{core => old}/Utils.js (100%) create mode 100644 src/types/html-extension.d.ts diff --git a/Blapy.js b/Blapy.js deleted file mode 120000 index 2bc84d0..0000000 --- a/Blapy.js +++ /dev/null @@ -1 +0,0 @@ -dist/blapy2.js \ No newline at end of file diff --git a/src/core/AjaxService.ts b/src/core/AjaxService.ts new file mode 100644 index 0000000..9a9980a --- /dev/null +++ b/src/core/AjaxService.ts @@ -0,0 +1,110 @@ +import { Logger } from './Logger' +import { AjaxOptions } from '../types/types' +import JSON5 from 'json5' + +export class AjaxService { + + constructor(private readonly logger: Logger) { + } + + async request(url: string, options: AjaxOptions = {}): Promise { + + if (!url) { + throw new Error('URL is required') + } + + const { + method = 'GET', + body = null, + headers = {}, + params = null, + timeout = 30000, + ...fetchOptions + } = options + + let finalUrl = url + + if (method.toUpperCase() === 'GET' && params) { + const urlParams = new URLSearchParams(params) + finalUrl += (url.includes('?') ? '&' : '?') + urlParams.toString() + } + + const controller = new AbortController() + const id = setTimeout(() => controller.abort(), timeout) + + try { + + let processedBody: BodyInit | null = null + + if (method.toUpperCase() !== 'GET' && body) { + if (body instanceof FormData || typeof body === 'string') { + processedBody = body + } else if (typeof body === 'object') { + const params = new URLSearchParams() + Object.entries(body).forEach(([k, v]) => { + if (v != null) params.append(k, String(v)) + }) + processedBody = params + } + } + + const request = new Request(finalUrl, { + ...fetchOptions, + method, + body: processedBody, + signal: controller.signal, + }) + + request.headers.set('X-Requested-With', 'XMLHttpRequest') + + Object.entries(headers).forEach(([k, v]) => { + request.headers.set(k, v) + }) + + const response = await fetch(request) + clearTimeout(id) + + if (!response.ok) { + throw new Error(`HTTP ${response.status}`) + } + + const contentType = response.headers.get('content-type') + + if (contentType?.includes('application/json')) { + const json = await response.json() + this.logger?.info(`AJAX Success (JSON): ${method} ${finalUrl}`, "AjaxService") + return json + } + + const text = await response.text() + this.logger?.info(`AJAX Success (Text): ${method} ${finalUrl}`, JSON5.stringify({ status: response.status, responseLength: text.length })) + return text as T + + } catch (err) { + clearTimeout(id) + + if (err.name === 'AbortError') { + this.logger?.error(`AJAX Timeout: ${method} ${finalUrl}`) + throw new Error(`Request timeout after ${timeout}ms`) + } + + this.logger?.error(`AJAX Error: ${method} ${finalUrl}`) + throw err + } + } + + async get(url: string, options: AjaxOptions = {}) { + return this.request(url, { + ...options, + method: "GET" + }) + } + + async post(url: string, data: BodyInit, options: AjaxOptions = {}) { + return this.request(url, { + ...options, + method: "POST", + body: data + }) + } +} \ No newline at end of file diff --git a/src/core/Blapy.ts b/src/core/Blapy.ts new file mode 100644 index 0000000..40eb354 --- /dev/null +++ b/src/core/Blapy.ts @@ -0,0 +1,895 @@ +import { Logger } from './Logger' +import { AjaxOptions, BlapyOptions, NavigationOptions, StateData } from '../types/types' +import { AjaxService } from './AjaxService' +import { Utils } from './Utils' +import { TemplateManager } from './TemplateManager' +import { Router } from './Router' +import { BlapyBlock } from './BlapyBlock' +import { createFSM, FSMManager, type StateDefinition } from '../../lib/kFSM' +import JSON5 from 'json5' + +export class Blapy { + + public container: HTMLElement | null = null + public myUIObject: HTMLElement | null + public myUIObjectID: string | null = null + public readonly logger: Logger + private readonly defaults: BlapyOptions = {} + private readonly opts: BlapyOptions + private readonly utils: Utils + public readonly ajaxService: AjaxService + private readonly templateManager: TemplateManager + private readonly router: Router + public readonly blapyBlocks: BlapyBlock + myFSM: FSMManager | null = null + private readonly optsIfsm: BlapyOptions + + + constructor(element: string | HTMLElement, options: BlapyOptions = {}) { + + if (!element) { + throw new Error('Blapy needs a valid DOM element') + } + + if (typeof element === 'string') { + const foundElement = document.querySelector(element) + if (!foundElement) { + throw new Error(`Element not found: ${element}`) + } + element = foundElement + } + + if (!(element instanceof HTMLElement)) { + throw new TypeError('Blapy needs a valid DOM element') + } + + if (!element.id) { + throw new Error('Blapy needs an element with an ID') + } + + this.container = element + + this.defaults = { + debug: false, + logLevel: 1, + alertError: false, + enableRouter: false, + routerRoot: '/', + routerHash: false, + pageLoadedFunction: null, + pageReadyFunction: null, + beforePageLoad: null, + beforeContentChange: null, + afterContentChange: null, + afterPageChange: null, + onErrorOnPageChange: null, + doCustomChange: null, + fsmExtension: null, + LogLevelIfsm: 1, + debugIfsm: false, + theBlapy: this, + } + + this.opts = { ...this.defaults, ...options } + + this.optsIfsm = { + ...this.opts, + debug: this.opts.debugIfsm ?? false, + logLevel: this.opts.LogLevelIfsm ?? 1, + } + + this.myUIObject = this.container + this.myUIObjectID = this.container.id + + this.myFSM = null + + //For IFSM + this.opts.theBlapy = this + + this.utils = new Utils() + this.logger = new Logger(this.opts) + this.ajaxService = new AjaxService(this.logger) + this.templateManager = new TemplateManager(this.logger, this.ajaxService, this.utils) + this.router = new Router(this.logger, this, { + enableRouter: this.opts.enableRouter, + root: this.opts.routerRoot, + hash: this.opts.routerHash, + strategy: 'ONE', + noMatchWarning: false, + linksSelector: '[data-blapy-link]', + }) + this.blapyBlocks = new BlapyBlock(this.logger) + + this.blapyBlocks.initializeBlocks(this.container) + this.blapyBlocks.setBlapyInstance(this) + + this.logger.info(`Blapy instance (#${this.myUIObjectID}) created`, 'Blapy2 constructor') + } + + public trigger(eventName: string, data: Object = null) { + this.logger.info(`[Sending event] ${eventName} - Diffused`) + const event = new CustomEvent(eventName, { + detail: data, + bubbles: true, + }) + this.myUIObject.dispatchEvent(event) + } + + public createBlapyBlock(aJsonObject) { + + if (!aJsonObject['blapy-container-name']) { + this.logger.info('createBlapyBlock: Error on received json where blapy-container-name is not defined!\nPerhaps it\'s pure json not defined as such in Blapy block configuration (cf. data-blapy-template-init-purejson)...\n' + JSON.stringify(aJsonObject)) + } + + const htmlBlapyBlock = document.createElement('div') + htmlBlapyBlock.dataset.blapyContainer = 'true' + htmlBlapyBlock.dataset.blapyContainerName = aJsonObject['blapy-container-name'] + htmlBlapyBlock.dataset.blapyContainerContent = aJsonObject['blapy-container-content'] + htmlBlapyBlock.dataset.blapyUpdate = 'json' + htmlBlapyBlock.innerHTML = JSON.stringify(aJsonObject['blapy-data']) + + return htmlBlapyBlock + } + + public initApplication() { + this.logger.info('InitApplication', 'core') + + try { + const states: StateDefinition = { + PageLoaded: { + enterState: { + init_function: function(this) { + const blapy = this.opts.theBlapy as Blapy + blapy.myFSM = this + blapy.logger.info('Page loaded', 'fsm') + blapy.blapyBlocks.setBlapyUpdateIntervals() + if (blapy.opts.pageLoadedFunction) blapy.opts.pageLoadedFunction() + blapy.trigger('Blapy_PageLoaded') + }, + next_state: 'PreparePage', + }, + }, + + PreparePage: { + enterState: { + init_function: function() {}, + propagate_event: 'setBlapyUrl', + }, + setBlapyUrl: { + init_function: function(this) { + const blapy = this.opts.theBlapy as Blapy + blapy.setBlapyURL() + }, + next_state: 'PreparePage_setBlapyJsonTemplates', + }, + }, + + PreparePage_setBlapyJsonTemplates: { + enterState: { + init_function: function(this) { + const blapy = this.opts.theBlapy as Blapy + blapy.setBlapyJsonTemplates() + }, + next_state: 'PreparePage_setBlapyUpdateOnDisplay', + }, + }, + + PreparePage_setBlapyUpdateOnDisplay: { + blapyJsonTemplatesIsSet: { + init_function: function(this) { + const blapy = this.opts.theBlapy as Blapy + blapy.setBlapyUpdateOnDisplay() + }, + next_state: 'PageReady', + }, + reloadBlock: 'loadUrl', + updateBlock: 'loadUrl', + postData: 'loadUrl', + loadUrl: { + how_process_event: { + delay: 50, + preventcancel: true, + }, + propagate_event: true, + }, + }, + + PageReady: { + enterState: { + init_function: function(this) { + const blapy = this.opts.theBlapy as Blapy + if (blapy.opts.pageReadyFunction) blapy.opts.pageReadyFunction() + blapy.trigger('Blapy_PageReady') + }, + }, + loadUrl: { + init_function: function(this, p, e, data : StateData) { + data.method = 'GET' + this.trigger('postData', data) + }, + }, + postData: { + init_function: function(this, p, e, data: StateData) { + const blapy = this.opts.theBlapy as Blapy + if (blapy.opts.beforePageLoad) blapy.opts.beforePageLoad(data) + blapy.trigger('Blapy_beforePageLoad', data) + }, + out_function: function(this, p, e, data: StateData) { + const blapy = this.opts.theBlapy as Blapy + + let aURL = data.aUrl + + // @ts-ignore + let aObjectId = data.aObjectId ? data.aObjectId : e?.currentTarget?.id! + + if (!data.params) data.params = {} + let params = JSON5.parse(JSON5.stringify(data.params)) + + if (!params) { + params = { blapyaction: 'update' } + } else if (!params.blapyaction) { + params['blapyaction'] = 'update' + } + + if (('embeddingBlockId' in params) && (!params.embeddingBlockId)) { + blapy.logger.error('[postData on ' + blapy.myUIObjectID + '] embeddingBlockId has been set but is undefined!') + } + + let aembeddingBlockId = params.embeddingBlockId + + if (aembeddingBlockId && params.templateId) { + blapy.myUIObject.querySelectorAll('[data-blapy-container-name="' + aembeddingBlockId + '"]') + .forEach(el => { el.dataset.blapyTemplateDefaultId = params.templateId }) + } + + let method = data.method ?? 'POST' + + params = Object.assign(params, { + blapycall: '1', + blapyaction: params.blapyaction, + blapyobjectid: aObjectId, + }) + + const requestOptions: Partial = { method } + if (method.toUpperCase() === 'GET') { + requestOptions.params = params + } else { + requestOptions.body = params + } + + blapy.ajaxService.request(aURL, requestOptions) + .then((response: string | Element) => { + if (response) { + if (typeof response === 'object') response = JSON.stringify(response) + if (aembeddingBlockId) response = blapy.embedHTMLPage(response, aembeddingBlockId) + this.trigger('pageLoaded', { htmlPage: response, params }) + } + }) + .catch((error) => { + this.trigger('errorOnLoadingPage', aURL + ': ' + error.toString()) + }) + }, + next_state: 'ProcessPageChange', + }, + updateBlock: { + init_function: function(this, p, e, data: Partial) { + const blapy = this.opts.theBlapy as Blapy + if (blapy.opts.beforePageLoad) blapy.opts.beforePageLoad(data) + blapy.trigger('Blapy_beforePageLoad', data) + if (!data?.html) { + blapy.logger.info('updateBlock: no html property found') + this.trigger('errorOnLoadingPage', 'updateBlock: no html property found') + } + }, + out_function: function(this, p, e, data: Partial) { + const blapy = this.opts.theBlapy as Blapy + if (!data) return + if (!data.params) data.params = {} + + if (('embeddingBlockId' in data.params) && (!data.params.embeddingBlockId)) { + blapy.logger.info(`[updateBlock on ${blapy.myUIObjectID}] embeddingBlockId is undefined!`) + } + + let aembeddingBlockId = data.params.embeddingBlockId + if (typeof data.html === 'object') data.html = JSON.stringify(data.html) + + if (aembeddingBlockId && data.params.templateId) { + const container = blapy.myUIObject.querySelector( + `[data-blapy-container-name="${aembeddingBlockId}"]` + ) + if (container) container.dataset.blapyTemplateDefaultId = data.params.templateId + } + + if (aembeddingBlockId) data.html = blapy.embedHTMLPage(data.html, aembeddingBlockId) + + this.trigger('pageLoaded', { htmlPage: data.html, params: data.params }) + }, + next_state: 'ProcessPageChange', + }, + reloadBlock: { + init_function: function(this, p, e, data: Partial) { + const blapy = this.opts.theBlapy as Blapy + let params: any = {} + if (data) params = data.params + + if (('embeddingBlockId' in params) && (!params.embeddingBlockId)) { + blapy.logger.info('[reloadBlock on ' + blapy.myUIObjectID + '] embeddingBlockId is undefined!') + } + + blapy.setBlapyJsonTemplates(true, params.embeddingBlockId, params.templateId) + blapy.setBlapyUpdateOnDisplay() + }, + }, + }, + + ProcessPageChange: { + enterState: {}, + pageLoaded: { + init_function: async function(this, p, e, data: Partial) { + const blapy = this.opts.theBlapy as Blapy + + let pageContent: any = data.htmlPage + const params = data.params + const aObjectId = params.blapyobjectid + const jsonFeatures = JSON5 + + // Tenter de parser en JSON + try { + pageContent = jsonFeatures.parse(pageContent) + + if (Array.isArray(pageContent)) { + const fragment = document.createDocumentFragment() + for (const element of pageContent) { + fragment.appendChild(blapy.createBlapyBlock(element)) + } + pageContent = fragment + } else if (typeof pageContent === 'object') { + pageContent = blapy.createBlapyBlock(pageContent) + } else { + blapy.logger.info('downloaded content is neither html nor json: ' + pageContent) + } + } catch { + // C'est du HTML, on le parse en DOM + const template = document.createElement('template') + template.innerHTML = pageContent + pageContent = template.content + } + + switch (params['blapyaction']) { + case 'update': + default: + for (const containerElement of blapy.myUIObject.querySelectorAll('[data-blapy-container]')) { + let myContainer = containerElement + const containerName = myContainer.dataset.blapyContainerName + + if (!params['force-update']) params['force-update'] = 0 + + let aBlapyContainer: HTMLElement | null = null + try { + // Chercher le container correspondant dans la réponse + const root = pageContent instanceof DocumentFragment + ? pageContent + : (pageContent as HTMLElement) + + if ((root as HTMLElement).matches?.(`[data-blapy-container-name="${containerName}"]`)) { + aBlapyContainer = root as HTMLElement + } else { + aBlapyContainer = (root).querySelector?.(`[data-blapy-container-name="${containerName}"]`) ?? null + + // Pour DocumentFragment, querySelector est disponible nativement + if (!aBlapyContainer && root instanceof DocumentFragment) { + aBlapyContainer = root.querySelector(`[data-blapy-container-name="${containerName}"]`) + } + } + } catch (err) { + blapy.logger.error(err) + continue + } + + if (!aBlapyContainer) continue + + // Vérifier data-blapy-applyon + const applyOn = aBlapyContainer.dataset.blapyApplyon + if (applyOn) { + const aListOfApplications = applyOn.split(',') + if (aListOfApplications.length > 0 && !aListOfApplications.includes(aObjectId)) continue + } + + if (!myContainer.id) { + blapy.logger.warn('A blapy block has no id: ' + myContainer.outerHTML.substring(0, 250)) + } + if (!aBlapyContainer.id) { + aBlapyContainer.id = myContainer.id + } + + let dataBlapyUpdate = aBlapyContainer.dataset.blapyUpdate + let dataBlapyUpdateRuleIsLocal = false + + if ( + myContainer.dataset.blapyUpdateRule === 'local' || + (dataBlapyUpdate === 'json' && myContainer.dataset.blapyUpdate !== 'json') + ) { + dataBlapyUpdate = myContainer.dataset.blapyUpdate + dataBlapyUpdateRuleIsLocal = true + } + + const tmpContainer = aBlapyContainer.querySelector('xmp.blapybin') + + if (dataBlapyUpdate !== 'json' && tmpContainer) { + aBlapyContainer.innerHTML = blapy.utils.atou(tmpContainer.innerHTML) + } + + if (blapy.opts.beforeContentChange) blapy.opts.beforeContentChange(myContainer) + myContainer.dispatchEvent(new CustomEvent('Blapy_beforeContentChange', { + detail: blapy.myUIObject, + })) + + // --- Tous les cas de mise à jour --- + if (!dataBlapyUpdate || dataBlapyUpdate === 'update') { + if ( + aBlapyContainer.dataset.blapyContainerContent !== myContainer.dataset.blapyContainerContent || + params['force-update'] == 1 + ) { + if (dataBlapyUpdateRuleIsLocal) { + myContainer.innerHTML = aBlapyContainer.innerHTML + } else { + myContainer.outerHTML = aBlapyContainer.outerHTML + myContainer = aBlapyContainer + } + } + } else if (dataBlapyUpdate === 'force-update') { + if (dataBlapyUpdateRuleIsLocal) { + myContainer.innerHTML = aBlapyContainer.innerHTML + } else { + myContainer.outerHTML = aBlapyContainer.outerHTML + myContainer = aBlapyContainer + } + } else if (dataBlapyUpdate === 'append') { + aBlapyContainer.insertAdjacentHTML('afterbegin', myContainer.innerHTML) + if (dataBlapyUpdateRuleIsLocal) { + myContainer.innerHTML = aBlapyContainer.innerHTML + } else { + myContainer.outerHTML = aBlapyContainer.outerHTML + myContainer = aBlapyContainer + } + } else if (dataBlapyUpdate === 'prepend') { + aBlapyContainer.insertAdjacentHTML('beforeend', myContainer.innerHTML) + if (dataBlapyUpdateRuleIsLocal) { + myContainer.innerHTML = aBlapyContainer.innerHTML + } else { + myContainer.outerHTML = aBlapyContainer.outerHTML + myContainer = aBlapyContainer + } + } else if (dataBlapyUpdate === 'json-append') { + const currentJsonData = myContainer.dataset.blapyJsonData + let currentData: any[] = [] + + if (currentJsonData) { + try { + currentData = jsonFeatures.parse(currentJsonData) + if (!Array.isArray(currentData)) currentData = [currentData] + } catch { + currentData = [] + } + } + + let newJsonData: any = null + + if (tmpContainer) { + try { + newJsonData = jsonFeatures.parse(blapy.utils.atou(tmpContainer.innerHTML)) + } catch { + blapy.logger.error('Failed to decode/parse new JSON data', 'json-append') + continue + } + } else { + try { + newJsonData = jsonFeatures.parse(aBlapyContainer.innerHTML) + } catch { + blapy.logger.error('Failed to parse new JSON data', 'json-append') + continue + } + } + + if (newJsonData?.['blapy-data']) newJsonData = newJsonData['blapy-data'] + + const appendStrategy = myContainer.dataset.blapyJsonAppendStrategy ?? 'end' + let mergedData: any[] = [] + + if (appendStrategy === 'start') { + mergedData = Array.isArray(newJsonData) + ? [...newJsonData, ...currentData] + : [newJsonData, ...currentData] + } else if (appendStrategy === 'unique') { + const uniqueKey = myContainer.dataset.blapyJsonUniqueKey ?? 'id' + mergedData = [...currentData] + const newItems = Array.isArray(newJsonData) ? newJsonData : [newJsonData] + for (const newItem of newItems) { + const exists = mergedData.some( + item => item[uniqueKey] && newItem[uniqueKey] && item[uniqueKey] === newItem[uniqueKey] + ) + if (!exists) mergedData.push(newItem) + } + } else { + mergedData = Array.isArray(newJsonData) + ? [...currentData, ...newJsonData] + : [...currentData, newJsonData] + } + + const maxItems = Number.parseInt(myContainer.dataset.blapyJsonMaxItems) + if (maxItems > 0 && mergedData.length > maxItems) { + mergedData = appendStrategy === 'start' + ? mergedData.slice(0, maxItems) + : mergedData.slice(-maxItems) + } + + myContainer.dataset.blapyJsonData = JSON.stringify(mergedData) + + const tempBlapyContainer = aBlapyContainer.cloneNode(true) as HTMLElement + tempBlapyContainer.innerHTML = JSON.stringify(mergedData) + + await blapy.templateManager.processJsonUpdate(null, myContainer, tempBlapyContainer, blapy) + + myContainer.dispatchEvent(new CustomEvent('Blapy_jsonAppended', { + detail: { + newItems: Array.isArray(newJsonData) ? newJsonData.length : 1, + totalItems: mergedData.length, + data: mergedData, + }, + })) + + blapy.logger.info( + `JSON Append: added ${Array.isArray(newJsonData) ? newJsonData.length : 1} items, total: ${mergedData.length}`, + 'json-append' + ) + + } else if (dataBlapyUpdate === 'replace') { + myContainer.innerHTML = aBlapyContainer.innerHTML + myContainer = aBlapyContainer + + } else if (dataBlapyUpdate === 'custom') { + if ( + aBlapyContainer.dataset.blapyContainerContent !== myContainer.dataset.blapyContainerContent || + params['force-update'] == 1 + ) { + if (blapy.opts.doCustomChange) blapy.opts.doCustomChange(myContainer, aBlapyContainer) + myContainer.dispatchEvent(new CustomEvent('Blapy_doCustomChange', { + detail: aBlapyContainer, + })) + } + } else if (dataBlapyUpdate === 'remove') { + const parent = myContainer.parentNode + myContainer.remove() + myContainer = parent as HTMLElement + + } else if (dataBlapyUpdate === 'json') { + await blapy.templateManager.processJsonUpdate(tmpContainer, myContainer, aBlapyContainer, blapy) + + } else { + // Plugin custom (animation) + const animation = (blapy as any).animation + const pluginUpdateFunction = animation?.[dataBlapyUpdate] + if (pluginUpdateFunction && typeof pluginUpdateFunction === 'function') { + if ( + aBlapyContainer.dataset.blapyContainerContent !== myContainer.dataset.blapyContainerContent || + params['force-update'] == 1 || + aBlapyContainer.dataset.blapyContainerForceUpdate === 'true' + ) { + pluginUpdateFunction(myContainer, aBlapyContainer) + } + } else { + blapy.logger.error(`${dataBlapyUpdate} does not exist`) + } + } + + // Post-update + blapy.blapyBlocks.setBlapyUpdateIntervals() + await blapy.setBlapyUpdateOnDisplay() + blapy.setBlapyURL() + + if (blapy.opts.afterContentChange) blapy.opts.afterContentChange(myContainer) + if (myContainer.id) { + const updatedElement = document.getElementById(myContainer.id) + if (updatedElement) { + updatedElement.dispatchEvent(new CustomEvent('Blapy_afterContentChange', { + detail: myContainer, + })) + } + } + } + break + } + }, + out_function: function(this, p, e, data) { + const blapy = this.opts.theBlapy as Blapy + if (blapy.opts.afterPageChange) blapy.opts.afterPageChange() + blapy.trigger('Blapy_afterPageChange', data) + }, + next_state: 'PageReady', + }, + errorOnLoadingPage: { + init_function: function(this, p, e, data) { + const blapy = this.opts.theBlapy as Blapy + if (blapy.opts.onErrorOnPageChange) blapy.opts.onErrorOnPageChange(data) + blapy.trigger('Blapy_ErrorOnPageChange', data) + }, + next_state: 'PageReady', + }, + reloadBlock: 'loadUrl', + updateBlock: 'loadUrl', + postData: 'loadUrl', + loadUrl: { + how_process_event: { + delay: 50, + preventcancel: true, + }, + propagate_event: true, + }, + }, + + DefaultState: { + start: { + next_state: 'PageLoaded', + }, + }, + } + + if (this.opts.fsmExtension) { + this.deepMerge(states, this.opts.fsmExtension) + } + + this.myFSM = createFSM(this.myUIObject, states, { + ...this.optsIfsm, + theBlapy: this, + }) + + if (!this.router.init()) { + this.logger.error('Failed to initialize router', 'core') + return false + } + + return true + + } catch (error) { + this.logger.error(`Failed to initialize application: ${error.toString()}`, 'core') + return false + } + } + public setBlapyURL() { + this.logger.info('Set blapyURL', 'router') + + const blapyLinks = this.container.querySelectorAll('[data-blapy-link]') + + blapyLinks.forEach((bL) => { + if (this.shouldSkipLink(bL)) return + + let aHref = this.getHref(bL) + if (!aHref) return + + aHref = this.normalizeHref(aHref, bL) + + this.updateHref(bL, aHref) + }) + } + + private shouldSkipLink(bL: HTMLElement) { + const activeIdAttr = bL.dataset.blapyActiveBlapyid + return activeIdAttr && activeIdAttr !== this.myUIObjectID + } + + private getHref(bL: HTMLElement) { + switch (bL.tagName) { + case 'A': + return bL.getAttribute('href') + case 'FORM': + return bL.getAttribute('action') + default: + return bL.dataset.blapyHref + } + } + + private normalizeHref(href: string, bL: HTMLElement) { + if (!href.includes('#blapylink')) { + href += '#blapylink' + + const blockId = bL.dataset.blapyEmbeddingBlockid + if (blockId) { + href += `#${blockId}` + } + } + + const isCustom = bL.tagName !== 'A' && bL.tagName !== 'FORM' + if (isCustom && !href.startsWith('/') && !/^https?:\/\//i.test(href)) { + const baseHref = document.querySelector('base')?.getAttribute('href') + href = baseHref + ? baseHref + href + : globalThis.location.pathname.replace(/[^/]*$/, '') + href + } + + return href + } + + private updateHref(bL: HTMLElement, href: string) { + switch (bL.tagName) { + case 'A': + bL.setAttribute('href', href) + break + case 'FORM': + bL.setAttribute('action', href) + break + default: + bL.dataset.blapyHref = href + bL.addEventListener('click', () => { + this.myFSM.trigger('loadUrl', { + aUrl: href, + params: {}, + aObjectId: this.myUIObjectID, + }) + }) + } + } + + public navigate(url: string, options : NavigationOptions = {}) { + if (this.opts.enableRouter && this.router.isInitialized) { + this.router.navigate(url, options) + } else { + // Standard navigation without router - using the FSM + this.myFSM.trigger('loadUrl', { + aUrl: url, + params: options.params || {}, + aObjectId: this.myUIObjectID, + noBlapyData: options.noBlapyData, + }) + } + } + + async setBlapyJsonTemplates(forceReload?: boolean, aEmbeddingBlock?: string, aTemplateId?) { + + this.logger.info('setBlapyJsonTemplates', 'core') + + forceReload ??= false + + if (aEmbeddingBlock) { + aEmbeddingBlock = `[data-blapy-container-name='${aEmbeddingBlock}']` + } else { + aEmbeddingBlock = '' + } + + if (aTemplateId) { + const selector = '[data-blapy-update="json"]' + aEmbeddingBlock + const targets = this.container.querySelectorAll(selector) // ← SOLUTION + + + targets.forEach(target => { + target.dataset.blapyTemplateDefaultId = aTemplateId + }) + } + + let jsonBlocks = this.container.querySelectorAll('[data-blapy-update="json"]' + aEmbeddingBlock) + if (jsonBlocks.length > 0) { + + for (const c of jsonBlocks) { + await this.templateManager.setBlapyContainerJsonTemplate(c, this, forceReload) + } + + this.myFSM.trigger('blapyJsonTemplatesIsSet') + } else { + this.myFSM.trigger('blapyJsonTemplatesIsSet') + } + + } + + public async setBlapyUpdateOnDisplay() { + this.logger.info('setBlapyUpdateOnDisplay', 'core') + + const elements = this.myUIObject.querySelectorAll('[data-blapy-updateblock-ondisplay]') + if (elements.length === 0) return + + if (!('IntersectionObserver' in globalThis)) { + alert('Blapy: IntersectionObserver is not supported. Need it to process data-blapy-updateblock-ondisplay option') + return + } + + const observerCallback = (entries, observer) => { + entries.forEach(entry => { + if (entry.isIntersecting) { + const el = entry.target + if (!Object.hasOwn(el.dataset, 'blapyAppear')) { + el.dataset.blapyAppear = 'done' + + this.logger.info(`Element became visible: ${el.dataset.blapyContainerName}`, 'setBlapyUpdateOnDisplay') + + if (Object.hasOwn(el.dataset, 'blapyHref')) { + this.myFSM.trigger('loadUrl', { + aUrl: el.dataset.blapyHref, + params: {}, + aObjectId: this.myUIObjectID, + noBlapyData: el.dataset.blapyNoblapydata, + }) + } else if (Object.hasOwn(el.dataset, 'blapyTemplateInit')) { + const myContainerName = el.dataset.blapyContainerName + this.myFSM.trigger('reloadBlock', { + params: { embeddingBlockId: myContainerName }, + }) + } + } + observer.unobserve(el) + } + }) + } + + // Création de l'observer + const observer = new IntersectionObserver(observerCallback, { + root: null, // viewport + rootMargin: '0px', + threshold: 0.1, // déclenche quand 10% de l'élément est visible + }) + + // Observer chaque élément + elements.forEach(el => { + this.logger.info(`Observing element: ${el.dataset.blapyContainerName}`, 'setBlapyUpdateOnDisplay') + observer.observe(el) + }) + } + + embedHTMLPage(aHtmlSource: Element | string, aBlapyBlockIdName: string) { + this.logger.info('embedHTML', 'core') + + const htmlBlapyBlock = this.myUIObject.querySelector('[data-blapy-container-name=\'' + aBlapyBlockIdName + '\']') + + if (!htmlBlapyBlock) { + this.logger.error(`embedHtmlPage: Error on blapy-container-name... ${aBlapyBlockIdName} does not exist!`) + return '' + } + + if (htmlBlapyBlock.dataset.blapyUpdate === 'json' && + htmlBlapyBlock.dataset.blapyTemplateInitPurejson === '0') { + try { + if (aHtmlSource instanceof Element) { + aHtmlSource = aHtmlSource.innerHTML + } + } catch (e) { + + this.logger.warn(`embedHtmlPage: aHtmlSource is perhaps a pure json after all...?\n${aHtmlSource.toString()} ${e.toString()}`) + } + } + + const encodedSource = '' + this.utils.utoa(aHtmlSource) + '' + + const tempElement = document.createElement('div') + tempElement.innerHTML = htmlBlapyBlock.outerHTML; + + const newBlock = tempElement.firstElementChild as HTMLElement | null + if (!newBlock) return + + newBlock.innerHTML = encodedSource + + const currentContent = newBlock.dataset.blapyContainerContent || '' + newBlock.dataset.blapyContainerContent = currentContent + '-' + Date.now() + + newBlock.removeAttribute('id') + + return newBlock.outerHTML + } + + private deepMerge(target, source) { + for (const key in source) { + if ( + source.hasOwnProperty(key) && + typeof source[key] === 'object' && + source[key] !== null && + !Array.isArray(source[key]) + ) { + if (!target[key] || typeof target[key] !== 'object') { + target[key] = {} + } + this.deepMerge(target[key], source[key]) + } else { + target[key] = source[key] + } + } + return target + } + + +} \ No newline at end of file diff --git a/src/core/BlapyBlock.ts b/src/core/BlapyBlock.ts new file mode 100644 index 0000000..3336a9e --- /dev/null +++ b/src/core/BlapyBlock.ts @@ -0,0 +1,88 @@ +import { Logger } from './Logger' +import { Blapy } from './Blapy' + +export class BlapyBlock { + + private readonly blocks = new Map(); + private readonly intervalsSet = new Map(); + private blapy : Blapy | null = null; + + constructor(private readonly logger: Logger) { + this.logger.info('BlapyBlocks initialized', 'blocks'); + } + + public setBlapyInstance(blapyInstance : Blapy) { + this.blapy = blapyInstance; + } + + public initializeBlocks(container : HTMLElement) { + this.logger.info('Initializing Blapy blocks', 'blocks'); + + const blapyContainers = container.querySelectorAll('[data-blapy-container="true"]'); + + blapyContainers.forEach(block => { + const blockName = block.dataset.blapyContainerName; + if (blockName) { + // Only the element is cached + this.blocks.set(blockName, { + element: block, + name: blockName + }); + this.logger.info(`Block registered: ${blockName}`, 'blocks'); + } else { + this.logger.warn('Block without container name found', 'blocks'); + } + }); + } + + public setBlapyUpdateIntervals() { + this.logger.info('Setting up update intervals', 'blocks'); + + this.intervalsSet.forEach(interval => clearInterval(interval)); + this.intervalsSet.clear(); + + const blocksWithInterval = this.blapy.myUIObject.querySelectorAll('[data-blapy-updateblock-time]'); + + let intervalIndex = 0; + + blocksWithInterval.forEach(block => { + const updateTime = Number.parseInt(block.dataset.blapyUpdateblockTime); + const href = block.dataset.blapyHref; + const containerName = block.dataset.blapyContainerName; + const noBlapyData = block.dataset.blapyNoblapydata; + + if (updateTime && href) { + this.logger.info(`Setting interval for ${containerName}: ${updateTime}ms`, 'blocks'); + + const finalUrl = href + '?blapyContainerName=' + containerName; + + const intervalId = setInterval(() => { + this.logger.info(`Interval triggered for ${containerName}`, 'blocks'); + + this.blapy.myFSM.trigger('loadUrl', { + aUrl: finalUrl, + params: {}, + aObjectId: this.blapy.myUIObjectID, + noBlapyData: noBlapyData + }); + }, updateTime); + + this.intervalsSet.set(intervalIndex, intervalId); + intervalIndex++; + + this.logger.info(`✅ Interval set for ${containerName}: ${updateTime}ms (index: ${intervalIndex - 1})`, 'blocks'); + } else { + if (!updateTime) { + this.logger.warn(`Block ${containerName} has no update time`, 'blocks'); + } + if (!href) { + this.logger.warn(`Block ${containerName} has no href`, 'blocks'); + } + } + }); + + this.logger.info(`Total intervals set: ${this.intervalsSet.size}`, 'blocks'); + } + + +} \ No newline at end of file diff --git a/src/core/Logger.ts b/src/core/Logger.ts new file mode 100644 index 0000000..d34ae42 --- /dev/null +++ b/src/core/Logger.ts @@ -0,0 +1,57 @@ +import { LoggerOptions } from '../types/types' + +export class Logger { + + private readonly debug: boolean + private readonly logLevel: number + private readonly alertError: boolean + + constructor(options: LoggerOptions = {}) { + const { + debug = false, + logLevel = 1, + alertError = false, + } = options + + this.debug = debug + this.logLevel = logLevel + this.alertError = alertError + } + + public error(message: string, service: string = 'blapy') { + this.log(message, service, 1) + } + + public warn(message: string, service: string = 'blapy') { + this.log(message, service, 2) + } + + public info(message: string, service: string = 'blapy') { + this.log(message, service, 3) + } + + private log(message: string, service: string, errorLevel: number = 3) { + if (errorLevel > this.logLevel) return + + if (errorLevel >= 2 && !this.debug) return + + if ((globalThis.window !== undefined && globalThis.console?.log) || typeof console !== 'undefined') { + switch (errorLevel) { + case 1: + console.log(`%c[Klapy] %c${message} from ${service}`, 'background: red; padding: 2px 8px; margin-right: 10px;', 'black') + break + case 2: + console.log(`%c[Klapy] %c${message} from ${service}`, 'background: orange; padding: 2px 8px; margin-right: 10px;', 'black') + break + case 3: + console.log(`[Klapy] ${message} from ${service}`) + break + default: + console.log(`[Klapy] ${message} from ${service}`) + break + } + } + } + + +} \ No newline at end of file diff --git a/src/core/Router.ts b/src/core/Router.ts new file mode 100644 index 0000000..e3c6665 --- /dev/null +++ b/src/core/Router.ts @@ -0,0 +1,264 @@ +import { Logger } from './Logger' +import { Blapy } from './Blapy' +import { BlapyRouterOptions, NavigationOptions, Primitive } from '../types/types' +import Navigo from 'navigo' +import JSON5 from 'json5' + +export class Router { + + private readonly router: Navigo | null = null + public isInitialized: boolean = false + private readonly opts: BlapyRouterOptions + + constructor(private readonly logger: Logger, private readonly blapy: Blapy, opts: Partial = {}) { + this.opts = { + enableRouter: false, + root: '/', + hash: false, + strategy: 'ONE', + noMatchWarning: false, + linksSelector: '[data-blapy-link]', + ...opts, + } + } + + public init(): boolean { + this.logger.info('Router initialization starting...', 'router') + + if (!this.opts.enableRouter) { + this.logger.info('Router disabled, using standard event handlers', 'router') + this.initStandardHandlers() + return true + } + + if (typeof Navigo !== 'function') { + this.logger.error('Navigo is not loaded... can not continue', 'router') + alert('Navigo is not loaded... can not continue') + return false + } + + this.initNavigoRouter() + return true + + } + + public navigate(url: string, options: NavigationOptions = {}) { + if (!this.isInitialized || !this.router) { + this.logger.warn('Router not initialized, cannot navigate', 'router') + return + } + + this.logger.info(`Navigating to: ${url}`, 'router') + + const navigateOptions = { + title: options.title, + stateObj: options.stateObj, + historyAPIMethod: options.historyAPIMethod || 'pushState', + updateBrowserURL: options.updateBrowserURL !== false, + callHandler: options.callHandler !== false, + callHooks: options.callHooks !== false, + updateState: options.updateState !== false, + force: options.force || false, + } + + this.router.navigate(url, navigateOptions) + } + + + private initStandardHandlers() { + this.logger.info( + 'Initializing standard event handlers (no routing)', + 'router', + ) + + const container = this.blapy.container + container.addEventListener('click', (ev) => { + const link = (ev.target as Element).closest('a[data-blapy-link]') + if (!link) return + + const activeId = link.dataset.blapyActiveBlapyid + if (activeId && activeId !== this.blapy.myUIObjectID) { + return + } + + ev.preventDefault() + + const params = this.extractLinkParams(link) + const embeddingBlockId = link.dataset.blapyEmbeddingBlockid + + if (embeddingBlockId) { + params.embeddingBlockId = embeddingBlockId + } + + this.logger.info(`Standard link clicked: ${link.href}`, 'router') + + this.blapy.myFSM.trigger('postData', { + aUrl: this.extractUrl(link.href), + params: params, + method: link.getAttribute('method') || 'GET', + aObjectId: this.blapy.myUIObjectID, + noBlapyData: link.dataset.blapyNoblapydata, + }) + + }) + + container.addEventListener('submit', (ev) => { + + const form = (ev.target as HTMLFormElement) + + if (!form.matches('form[data-blapy-link]')) return + + const activeId = form.dataset.blapyActiveBlapyid + if (activeId && activeId !== this.blapy.myUIObjectID) { + return + } + + ev.preventDefault() + + this.logger.info(`Form submitted: ${form.action}`, 'router') + + const formData = this.extractFormData(form, ev) + const embeddingBlockId = form.dataset.blapyEmbeddingBlockid + if (embeddingBlockId) { + formData.embeddingBlockId = embeddingBlockId + } + + this.blapy.myFSM.trigger('postData', { + aUrl: this.extractUrl(form.action), + params: formData, + method: form.getAttribute('method') || 'POST', + aObjectId: this.blapy.myUIObjectID, + noBlapyData: form.dataset.blapyNoblapydata, + }) + + + }) + } + + private initNavigoRouter() { + this.logger.info( + 'Initializing simple router (manual history management)', + 'router', + ) + + this.interceptBlapyLinks() + + globalThis.addEventListener('popstate', () => { + this.logger.info('Popstate event detected', 'router') + + this.blapy.myFSM.trigger('loadUrl', { + aUrl: globalThis.location.pathname + globalThis.location.search, + params: {}, + aObjectId: this.blapy.myUIObjectID, + }) + + }) + + this.isInitialized = true + this.logger.info('Simple router initialized', 'router') + + } + + private extractLinkParams(link: HTMLAnchorElement) { + const paramsAttr = link.dataset.blapyParams + if (!paramsAttr) return {} + + try { + return JSON5.parse(paramsAttr) + } catch { + this.logger.warn(`Failed to parse link params: ${paramsAttr}`, 'router') + return {} + } + } + + private extractFormData(form: HTMLFormElement, event: SubmitEvent) { + const formData = new FormData(form) + const data: Record = {} + + for (const [key, value] of formData.entries()) { + data[key] = value + } + + if (event.submitter) { + const submitter = event.submitter as HTMLInputElement | HTMLButtonElement + if (submitter.name) { + data[submitter.name] = submitter.value || '' + } + } + + return data + } + + private interceptBlapyLinks() { + const container = this.blapy.container + + console.log(container) + + container.addEventListener('click', (ev) => { + const link = (ev.target as Element).closest('a[data-blapy-link]') + if (!link) return + + const href = link.getAttribute('href') + if (!href?.includes('#blapylink')) return + + console.log(link) + + const activeId = link.dataset.blapyActiveBlapyid + if (activeId && activeId !== this.blapy.myUIObjectID) return + + ev.preventDefault() + + const params = this.extractLinkParams(link) + const embeddingBlockId = this.extractEmbeddingBlockId(href) + + if (embeddingBlockId) { + params.embeddingBlockId = embeddingBlockId + } + + const cleanUrl = this.cleanBlapyUrl(href) + + globalThis.history.pushState({ blapy: true }, '', cleanUrl) + + this.logger.info(`Navigating to: ${cleanUrl}`, 'router'); + + this.blapy.myFSM.trigger('loadUrl', { + aUrl: cleanUrl, + params: this.filterAttributes(params), + aObjectId: this.blapy.myUIObjectID, + noBlapyData: link.dataset.blapyNoblapydata, + }) + + }) + } + + private extractEmbeddingBlockId(url: string): string { + const regex = /#blapylink#(.*)/i + const match = regex.exec(url) + return match?.[1] ? match[1] : '' + } + + private cleanBlapyUrl(url: string): string { + return url.replace(/#blapylink.*$/, '') + } + + private filterAttributes(params: Record): Record { + const filtered: Record = {} + + for (const [key, value] of Object.entries(params)) { + if (typeof value !== 'function' && typeof value !== 'object') { + filtered[key] = value as Primitive + } + } + + return filtered + } + + private extractUrl(fullUrl: string) { + if (!fullUrl) return globalThis.location.href + + const hashIndex = fullUrl.indexOf('#') + return hashIndex === -1 ? fullUrl : fullUrl.substring(0, hashIndex) + } + + +} \ No newline at end of file diff --git a/src/core/TemplateManager.ts b/src/core/TemplateManager.ts new file mode 100644 index 0000000..c52ae15 --- /dev/null +++ b/src/core/TemplateManager.ts @@ -0,0 +1,636 @@ +import { Logger } from './Logger' +import { AjaxService } from './AjaxService' +import { Utils } from './Utils' +import { Blapy } from './Blapy' +import JSON5 from 'json5' +import Mustache from 'mustache' +import * as json2html from 'json2html' + +export class TemplateManager { + + private templates = new Map() + + constructor(private readonly logger: Logger, private readonly ajaxService: AjaxService, private readonly utils: Utils) { + } + + public async setBlapyContainerJsonTemplate(container: HTMLElement, blapy: Blapy, forceReload: boolean = false) { + this.logger.info('setBlapyContainerJsonTemplate', 'template manager') + container.dataset.blapyUpdateRule = 'local' + + let htmlTpl = Array.from(container.children).filter((child : HTMLElement) => + Object.hasOwn(child.dataset, 'blapyContainerTpl'), + ); + + let htmlTplContent : string = container.innerHTML + + if (htmlTpl.length === 0) { + try { + const tempElement = document.createElement('div') + tempElement.innerHTML = htmlTplContent.trim(); + const firstChild = tempElement.firstElementChild + + if (firstChild?.tagName === 'XMP') { + htmlTplContent = firstChild.innerHTML + } + } catch { + this.logger.error( + 'htmlTplContent from ' + + container.id + + ' is not html template...?\n' + + htmlTplContent, + ) + } + + if ( + htmlTplContent + .replaceAll(/()|()|(/gm, '') + .replaceAll('\n\n', '\n') + .replaceAll('\t\t', '\t') + + const tempDiv = document.createElement('div') + tempDiv.innerHTML = htmlTplContent.trim() + + if (tempDiv.firstElementChild?.tagName.toLowerCase() === 'xmp') { + container.innerHTML = htmlTplContent + } else { + htmlTplContent = + '' + + htmlTplContent + + '' + container.innerHTML = htmlTplContent + } + + this.templates.set(tplFile, htmlTplContent) + + this.initializeJsonBlock(container, blapy, false) + } else if (tplFile && this.templates.has(tplFile)) { + this.logger.info('The templates use cache memory') + container.innerHTML = this.templates.get(tplFile) + this.initializeJsonBlock(container, blapy, false) + } else { + this.initializeJsonBlock(container, blapy, false) + } + } else { + let tmpHtmlContent = htmlTplContent + .replaceAll(/{{(.*?)}}/gm, '') + .split('script') + .join('scriptblapy') + .split('img') + .join('imgblapy') + + if (tmpHtmlContent.trim().toLowerCase().startsWith('' + + htmlTplContent + + '' + container.innerHTML = htmlTplContent + } + this.initializeJsonBlock(container, blapy, false) + } + } else if (forceReload) { + this.initializeJsonBlock(container, blapy, true) + } + + } + + private initializeJsonBlock(container : HTMLElement, blapy: Blapy, forceReload = false, ) { + this.logger.info('initializeJsonBlock', 'template manager') + + const containerName = container.dataset.blapyContainerName + const initURL = container.dataset.blapyTemplateInit + + //do we have to get the data only when block is displayed? + if ( + !forceReload && + container.dataset.blapyUpdateblockOndisplay && + container.dataset.blapyAppear !== 'done' + ) { + return; + } + + let aInitURL = container.dataset.blapyTemplateInit + if (aInitURL) { + + let aInitURL_Param: {} = container.dataset.blapyTemplateInitParams + if (aInitURL_Param == undefined) { + aInitURL_Param = {} + } else if (typeof aInitURL_Param === 'string') { + aInitURL_Param = JSON5.parse(aInitURL_Param) + } + + let aInitURL_EmbeddingBlockId = container.dataset.blapyTemplateInitPurejson + + if (aInitURL_EmbeddingBlockId !== '0') { + aInitURL_Param = { + ...aInitURL_Param, + embeddingBlockId: container.dataset.blapyContainerName, + } + } + + let noBlapyData = container.dataset.blapyNoblapydata + noBlapyData ??= '0' + + let aInitURL_Method = container.dataset.blapyTemplateInitMethod + aInitURL_Method ??= 'GET' + + blapy.myFSM.trigger('postData', { + aUrl: aInitURL, + params: aInitURL_Param, + method: aInitURL_Method, + noBlapyData: noBlapyData, + }) + + } + + if (container.id) { + blapy.trigger('Blapy_templateReady', { detail: container }) + } + } + + + public getObjects(obj, key, val) { + let objects = [] + for (let i in obj) { + if (!obj.hasOwnProperty(i)) continue + if (typeof obj[i] == 'object') { + objects = objects.concat(this.getObjects(obj[i], key, val)) + } else + //if key matches and value matches or if key matches and value is not passed (eliminating the case where key matches but passed value does not) + if (i == key && obj[i] == val || i == key && val == '') { // + objects.push(obj) + } else if (obj[i] == val && key == '') { + //only add if the object is not already in the array + if (!objects.includes(obj)) { + objects.push(obj) + } + } + } + return objects + } + + async processJsonUpdate( + tmpContainer, + myContainer : HTMLElement, + aBlapyContainer, + Blapy: Blapy, + ) { + + try { + const jsonDataObj = await this.extractAndParseJsonData( + tmpContainer, + aBlapyContainer, + ) + + const containerName = myContainer.dataset.blapyContainerName + + if (!jsonDataObj) return + + const processedData = this.applyDataTransformations( + jsonDataObj, + myContainer, + ) + + + const template = this.getTemplate(myContainer) + + + if (!template) return + + const generatedHtml = this.generateHtml( + processedData, + template, + myContainer, + ) + + + + this.injectFinalHtml(generatedHtml, myContainer, Blapy, template) + + } catch (error) { + this.logger.error( + `Erreur dans processJsonUpdate: ${error.message}`, + 'templateManager', + ) + } + } + + private async extractAndParseJsonData(tmpContainer : HTMLElement, aBlapyContainer: HTMLElement) { + this.logger.info('_extractAndParseJsonData', 'templateManager') + + let jsonData = tmpContainer + ? this.utils.atou(tmpContainer.innerHTML) + : aBlapyContainer.innerHTML + + jsonData = jsonData.trim().replaceAll(/(\r\n|\n|\r)/g, '') + + try { + const jsonDataObj = JSON5.parse(jsonData) + return this.extractBlapyData(jsonDataObj, aBlapyContainer) + } catch { + this.logger.warn('Premier parsing échoué, tentative d\'extraction HTML', 'templateManager') + + try { + jsonData = jsonData.innerHTML + + const cleanedData = jsonData.replaceAll(/(\r\n|\n|\r)/g, '') + const jsonDataObj = JSON5.parse(cleanedData) + + return this.extractBlapyData(jsonDataObj, aBlapyContainer) + } catch { + + this.logger.error('Parsing impossible même après extraction HTML' + jsonData, 'templateManager') + throw new Error('Parsing JSON impossible') + } + } + } + + private extractBlapyData(jsonDataObj: Object, container = null) { + this.logger.info('_extractBlapyData', 'templateManager') + + if (jsonDataObj['blapy-data'] && jsonDataObj['blapy-container-name']) { + const containerName = container?.getAttribute?.('data-blapy-container-name') + + if (containerName && jsonDataObj['blapy-container-name'] != containerName) { + this.logger.warn( + 'blapy-data set: ' + + JSON.stringify(jsonDataObj) + + '\n but not match with containerName ' + + containerName, + ) + return null + } + return jsonDataObj['blapy-data'] + } + return jsonDataObj + } + + private applyDataTransformations(jsonDataObj: [], myContainer: HTMLElement) { + this.logger.info('_applyDataTransformations', 'templateManager') + let processedData = jsonDataObj + + processedData = this.applyInitFromProperty(processedData, myContainer) + processedData = this.applyInitSearch(processedData, myContainer) + + processedData = this.applyProcessDataFunctions( + processedData, + myContainer + ) + + return this.addBlapyIndices(processedData) + } + + private getTemplate(myContainer : HTMLElement) { + + + let htmlTpl: NodeListOf; + let htmlAllTpl = myContainer.querySelectorAll('[data-blapy-container-tpl]') + + let htmlTplContent = '' + + let tplId = myContainer.dataset.blapyTemplateDefaultId + + if (tplId != undefined && tplId != '') { + + let selector = `:scope > [data-blapy-container-tpl][data-blapy-container-tpl-id='${tplId}']` + htmlTpl = myContainer.querySelectorAll(selector) + + if (htmlTpl.length == 0) { + this.logger.error( + 'The json template of id ' + + tplId + + ' was not found for the block ' + + myContainer.dataset.blapyContainerName + + '!', + 'templateManager', + ) + } + } + + if (htmlTpl.length == 0) htmlTpl = htmlAllTpl + + if (htmlTpl.length == 0) { + htmlTplContent = '' + this.logger.error( + 'can not find any json template for the block: ' + + myContainer.dataset.blapyContainerName, + 'templateManager', + ) + return null + } else { + htmlTplContent = htmlTpl[0].innerHTML + } + + if (htmlTplContent.length < 3) { + this.logger.error( + 'Template is void... ? ' + + myContainer.dataset.blapyContainerName, + 'templateManager', + ) + return null + } + + return { + content: htmlTplContent, + allTemplates: htmlAllTpl, + } + } + + private generateHtml(jsonDataObj : Object, template, myContainer : HTMLElement) { + let htmlTplContent = this.prepareTemplateContent(template.content); + let newHtml = ''; + let parsed = false; + + if (Mustache !== undefined) { + let mustacheStartDelimiter = '{{'; + let mustacheEndDelimiter = '}}'; + let newDelimiters = ''; + + if ( + Object.hasOwn(myContainer.dataset, 'blapyTemplateMustacheDelimiterstart') && + myContainer.dataset.blapyTemplateMustacheDelimiterstart !== '' + ) { + mustacheStartDelimiter = myContainer.dataset.blapyTemplateMustacheDelimiterstart; + mustacheEndDelimiter = myContainer.dataset.blapyTemplateMustacheDelimiterend; + newDelimiters = + '{{=' + mustacheStartDelimiter + ' ' + mustacheEndDelimiter + '=}}'; + } + + // if (newDelimiters != '' || htmlTplContent.includes('{{')) { + newHtml = Mustache.render( + newDelimiters + mustacheStartDelimiter + '#.' + mustacheEndDelimiter + + htmlTplContent + + mustacheStartDelimiter + '/.' + mustacheEndDelimiter, + jsonDataObj, + ); + // } + parsed = true; + + } + + if (!parsed && json2html !== undefined) { + const jsonData = JSON.stringify(jsonDataObj); + + newHtml = json2html.transform(jsonData, { + 'tag': 'void', + 'html': htmlTplContent, + }); + newHtml = newHtml.replaceAll(/<.?void>/g, ''); + parsed = true; + } + + if (!parsed) { + this.logger.error( + 'no json parser loaded... need to include json2html or Mustache library! ', + 'templateManager', + ); + alert( + 'no json parser loaded... need to include "json2html" or "Mustache" library!', + ); + return '' + } + + return newHtml; + } + + private injectFinalHtml(generatedHtml : string, myContainer : HTMLElement, blapy : Blapy, template) { + let newHtml = generatedHtml + + if (Object.hasOwn(myContainer.dataset, 'blapyTemplateHeader')) { + this.logger.info('Apply data-blapy-template-header') + newHtml = + myContainer.dataset.blapyTemplateHeader + newHtml + } + + if (Object.hasOwn(myContainer.dataset, 'blapyTemplateFooter')) { + this.logger.info('Apply data-blapy-template-footer') + newHtml = + newHtml + myContainer.dataset.blapyTemplateFooter + } + + if (Object.hasOwn(myContainer.dataset, 'blapyTemplateWrap')) { + this.logger.info('Apply data-blapy-template-wrap') + + const wrapTemplate = myContainer.dataset.blapyTemplateWrap + const wrapperTemplate = document.createElement('div') + + wrapperTemplate.innerHTML = wrapTemplate + wrapperTemplate.firstElementChild.innerHTML = newHtml + newHtml = wrapperTemplate.firstElementChild.outerHTML + } + + let tplList = '' + if (template?.allTemplates) { + template.allTemplates.forEach((el) => { + tplList += el.outerHTML + }) + } + + myContainer.innerHTML = tplList + newHtml + + const scripts = myContainer.querySelectorAll('script') + scripts.forEach(oldScript => { + const newScript = document.createElement('script') + if (oldScript.src) { + newScript.src = oldScript.src + } else { + newScript.textContent = oldScript.textContent + } + oldScript.parentNode.replaceChild(newScript, oldScript) + }) + + setTimeout(() => { + + const subJsonBlocks = myContainer.querySelectorAll('[data-blapy-update="json"]') + + if (subJsonBlocks.length > 0) { + + blapy.myFSM.trigger('blapyJsonTemplatesToSet') + + let templateManager = this; + + (async function() { + for (const subContainer of subJsonBlocks) { + await templateManager.setBlapyContainerJsonTemplate(subContainer as HTMLElement, blapy) + } + blapy.myFSM.trigger('blapyJsonTemplatesIsSet') + })() + } else { + blapy.myFSM.trigger('blapyJsonTemplatesIsSet') + } + }, 0) + } + + private applyInitFromProperty(jsonDataObj : Object, myContainer : HTMLElement) { + this.logger.info('_applyInitFromProperty', 'templateManager') + if ( + !Object.hasOwn(myContainer.dataset, 'blapyTemplateInitFromproperty') || + myContainer.dataset.blapyTemplateInitFromproperty === '' + ) { + return jsonDataObj + } + + try { + this.logger.info( + 'Apply data-blapy-template-init-fromproperty: ' + + myContainer.dataset.blapyTemplateInitFromproperty, + ) + + const initFromProp = myContainer.dataset.blapyTemplateInitFromproperty + + if (initFromProp) { + const keys = initFromProp.split('.') + return keys.reduce((acc, key) => { + return acc[key] === undefined ? acc : acc[key] + }, jsonDataObj) + } + + return jsonDataObj + } catch { + this.logger.error( + 'init-search or init-property does not work well on json data of container: ' + + myContainer.id, + 'templateManager', + ) + return jsonDataObj + } + } + + private applyInitSearch(jsonDataObj : [], myContainer : HTMLElement) { + this.logger.info('_applyInitSearch', 'templateMnager') + const initSearch = myContainer.dataset.blapyTemplateInitSearch + + if (!initSearch || initSearch === '') { + return jsonDataObj + } + + try { + this.logger.info( + 'Apply data-blapy-template-init-search: ' + + myContainer.dataset.blapyTemplateInitSearch, + ) + + let jsonData = JSON.stringify(jsonDataObj) + + jsonDataObj = initSearch + .split(',') + .map((item) => item.split('==')) + .reduce((acc, item) => { + const founds = this.getObjects(jsonDataObj, item[0], item[1]) + if (founds.length) + return acc.concat(founds) + else + return acc + }, []) + + jsonDataObj = jsonDataObj.filter((thing, index) => { + return index === jsonDataObj.findIndex(obj => { + return JSON.stringify(obj) === JSON.stringify(thing) + }) + }) + + return jsonDataObj + } catch { + this.logger.error( + 'init-search or init-property does not work well on json data of container: ' + + myContainer.id, + 'templateManager', + ) + return jsonDataObj + } + } + + private applyProcessDataFunctions(jsonDataObj : [], myContainer: HTMLElement) { + this.logger.info('_applyProcessDataFunctions', 'templateManager') + if ( + !Object.hasOwn(myContainer.dataset, 'blapyTemplateInitProcessdata') || + myContainer.dataset.blapyTemplateInitProcessdata === '' + ) { + return jsonDataObj + } + + let aJsonDataFunction = myContainer.dataset.blapyTemplateInitProcessdata + if (aJsonDataFunction) { + this.logger.info( + 'Apply data-blapy-template-init-processdata: ' + aJsonDataFunction, + ) + + aJsonDataFunction.split(',').forEach((aFunctionName) => { + let previousJsonDataObj = JSON5; + eval( + 'if (typeof ' + + aFunctionName + + ' === "function") ' + + ' jsonDataObj=' + + aFunctionName + + '(jsonDataObj);' + + 'else ' + + ' this.logger.error("' + + aFunctionName + + ' does not exist :(! ' + + 'Have a look on the : data-blapy-template-init-processdata of container ' + + myContainer.id + + '", "templateManager");', + ) + + if (typeof jsonDataObj !== 'object') { + this.logger.error( + 'returned Json Data was not a json structure :(! Perhaps it is due to the processing of this function on them: ' + + aJsonDataFunction, + 'templateManager', + ) + jsonDataObj = previousJsonDataObj + } + }) + } + + return jsonDataObj + } + + private addBlapyIndices(jsonDataObj : []) { + if (jsonDataObj.length) { + for (let i = 0; i < jsonDataObj.length; i++) { + if (jsonDataObj[i].blapyIndex == undefined) { + jsonDataObj[i].blapyIndex = i + 1 + } + if (i == 0) jsonDataObj[i].blapyFirst = true + if (i == jsonDataObj.length - 1) jsonDataObj[i].blapyLast = true + } + } else { + jsonDataObj.blapyIndex = 0 + } + + return jsonDataObj + } + + private prepareTemplateContent(content: string): string { + return content + .replaceAll(/\|xmp/gi, 'xmp') + .replaceAll(/\|\/xmp/gi, '/xmp') + .replaceAll(/blapyScriptJS/gi, 'script') + } + + + +} \ No newline at end of file diff --git a/src/core/Utils.ts b/src/core/Utils.ts new file mode 100644 index 0000000..f522a91 --- /dev/null +++ b/src/core/Utils.ts @@ -0,0 +1,16 @@ +export class Utils { + public atou(b64: string) : string { + return decodeURIComponent( + atob(b64).split('').map(c => '%' + c.codePointAt(0).toString(16).padStart(2, '0')).join('') + ) + } + + public utoa(data: string): string { + return btoa( + encodeURIComponent(data).replace(/%([0-9A-F]{2})/gi, (_, hex) => + String.fromCharCode(parseInt(hex, 16)) + ) + ) + } + +} \ No newline at end of file diff --git a/src/index.js b/src/index.js index fc7451e..bea86a5 100644 --- a/src/index.js +++ b/src/index.js @@ -16,7 +16,7 @@ * ----------------------------------------------------------------------------------------- */ -export { Blapy, createBlapy } from './core/Blapy2.js'; +export { Blapy, createBlapy } from './old/Blapy2.js'; export { Logger } from './core/Logger.js'; export { Utils } from './core/Utils.js'; export { AjaxService } from './core/AjaxService.js'; @@ -26,5 +26,5 @@ export { BlapyBlock } from './core/BlapyBlock.js'; export * from './modules/Compatibility.js'; -import Blapy from './core/Blapy2.js'; +import Blapy from './old/Blapy2.js'; export default Blapy; \ No newline at end of file diff --git a/src/modules/Compatibility.js b/src/modules/Compatibility.js index 18d2584..53436b9 100644 --- a/src/modules/Compatibility.js +++ b/src/modules/Compatibility.js @@ -16,7 +16,7 @@ * ----------------------------------------------------------------------------------------- */ -import { Blapy } from '../core/Blapy2.js'; +import { Blapy } from '../old/Blapy2.js'; /** * HTMLElement extension. diff --git a/src/modules/HTMLCompatibility.ts b/src/modules/HTMLCompatibility.ts new file mode 100644 index 0000000..ebdcc6e --- /dev/null +++ b/src/modules/HTMLCompatibility.ts @@ -0,0 +1,13 @@ +import { Blapy } from '../core/Blapy'; +import { BlapyOptions } from '../types'; + +HTMLElement.prototype.Blapy = function (this: HTMLElement, options: BlapyOptions = {}): Blapy { + if (this._blapyInstance) { + return this._blapyInstance; + } + + const instance = new Blapy(this, options); + instance.initApplication(); + this._blapyInstance = instance; + return instance; +}; \ No newline at end of file diff --git a/src/core/AjaxService.js b/src/old/AjaxService.js similarity index 100% rename from src/core/AjaxService.js rename to src/old/AjaxService.js diff --git a/src/core/Blapy2.js b/src/old/Blapy2.js similarity index 99% rename from src/core/Blapy2.js rename to src/old/Blapy2.js index c13255d..d76e518 100644 --- a/src/core/Blapy2.js +++ b/src/old/Blapy2.js @@ -34,12 +34,12 @@ * - 30/07/25 - C.NELHOMME - V1.0 - Creation of the base version */ -import { Logger } from './Logger.js' -import { Utils } from './Utils.js' -import { TemplateManager } from './TemplateManager.js' -import { Router } from './Router.js' -import { BlapyBlock } from './BlapyBlock.js' -import { AjaxService } from './AjaxService.js' +import { Logger } from '../core/Logger.js' +import { Utils } from '../core/Utils.js' +import { TemplateManager } from '../core/TemplateManager.js' +import { Router } from '../core/Router.js' +import { BlapyBlock } from '../core/BlapyBlock.js' +import { AjaxService } from '../core/AjaxService.ts' /** @@ -178,7 +178,7 @@ export class Blapy { noMatchWarning: false, linksSelector: '[data-blapy-link]', }) - this.blapyBlocks = new BlapyBlock(this.logger, this.templateManager, this.ajaxService) + this.blapyBlocks = new BlapyBlock(this.logger, this.ajaxService) this.blapyBlocks.initializeBlocks(this.container) this.blapyBlocks.setBlapyInstance(this) diff --git a/src/core/BlapyBlock.js b/src/old/BlapyBlock.js similarity index 100% rename from src/core/BlapyBlock.js rename to src/old/BlapyBlock.js diff --git a/src/core/Logger.js b/src/old/Logger.js similarity index 100% rename from src/core/Logger.js rename to src/old/Logger.js diff --git a/src/core/Router.js b/src/old/Router.js similarity index 100% rename from src/core/Router.js rename to src/old/Router.js diff --git a/src/core/TemplateManager.js b/src/old/TemplateManager.js similarity index 100% rename from src/core/TemplateManager.js rename to src/old/TemplateManager.js diff --git a/src/core/Utils.js b/src/old/Utils.js similarity index 100% rename from src/core/Utils.js rename to src/old/Utils.js diff --git a/src/types/html-extension.d.ts b/src/types/html-extension.d.ts new file mode 100644 index 0000000..044e262 --- /dev/null +++ b/src/types/html-extension.d.ts @@ -0,0 +1,9 @@ +import { Blapy } from '../core/Blapy'; +import { BlapyOptions } from './types'; + +declare global { + interface HTMLElement { + Blapy(options?: BlapyOptions): Blapy; + _blapyInstance?: Blapy; + } +} \ No newline at end of file From 1df13d44b795d118b54cd7becc1568707a1ffecc Mon Sep 17 00:00:00 2001 From: d3ller Date: Wed, 1 Jul 2026 14:38:23 +0200 Subject: [PATCH 03/10] feat: optional Blapymotion/BlapySocket modules, template fix, demo migration Core: - Make animation (Blapymotion) and websocket (BlapySocket) optional and auto-detected from separate standalone builds (dist/BlapyMotion.js, dist/BlapySocket.js) instead of being bundled in the core. Convert BlapySocket to TypeScript. - TemplateManager: scope template resolution to direct-child templates (:scope >) so nested sub-block templates no longer leak/accumulate into parents; add null guards in generateHtml/addBlapyIndices; align with upstream Blapy v2.1.2. - Move html-extension.d.ts and shared types under src/shared/types. Build/dev: - Add per-module vite configs and chain them in the build script. - Add docker-compose dev env; fix websocket container crash-loop by installing ws from the demo's own package.json. Demos: - Fix helloworld (animation), demo_json_nested_blocks (jQuery .attr leftover), demo_json_init_with_mustache; migrate demos to the modern dist/blapy.umd.js; drop bundled lib/ vendor copies. --- .github/workflows/release.yml | 30 +- .gitignore | 6 +- .prettierrc | 2 +- LICENSE | 2 +- .../bootstrap-four-column-gallery/index.html | 11 +- demos/demo-json-append/index.html | 12 +- demos/demo1/index.html | 8 +- demos/demo1/test2.html | 7 +- demos/demo1/test3.html | 7 +- demos/demo2/footer.php | 2 +- demos/demo2/header.php | 8 +- demos/demo2b/footer.php | 2 +- demos/demo2b/header.php | 6 +- demos/demo2b/index.php | 12 +- demos/demo3-posted-input/footer.php | 2 +- demos/demo3-posted-input/header.php | 7 +- demos/demo_json_init/index-jsonfromform.html | 11 +- demos/demo_json_init/index-purejson.html | 41 +- demos/demo_json_init/index.html | 11 +- .../index-jsonfromform.html | 11 +- .../index-purejson.html | 43 +- demos/demo_json_init_with_mustache/index.html | 11 +- demos/demo_json_nested_blocks/index.html | 13 +- demos/dynamicSearch/index.html | 11 +- demos/helloworld/footer.php | 2 +- demos/helloworld/header.php | 9 +- demos/index.php | 51 + .../startbootstrap-sb-admin-2/pages/index.php | 12 +- demos/todomvc/index.php | 55 +- demos/todomvc/php/allCompleted.php | 2 +- demos/todomvc/php/getTodo.php | 6 +- demos/verifyEmails/footer.php | 16 +- demos/verifyEmails/header.php | 11 +- demos/websocket/index.html | 11 +- demos/websocket/package.json | 2 +- dist/BlapySocket.js | 30 +- dist/Blapymotion.js | 29 +- dist/blapy2.js | 18 - docker-compose.yml | 38 + lib/jquery.appear/.gitignore | 1 - lib/jquery.appear/AUTHORS.txt | 6 - lib/jquery.appear/CHANGELOG | 3 - lib/jquery.appear/LICENSE | 23 - lib/jquery.appear/README.md | 55 - lib/jquery.appear/bower.json | 25 - lib/jquery.appear/jquery.appear.js | 117 - lib/jquery.appear/package.json | 35 - lib/jquery/jquery-3.7.1.js | 10716 ---------------- lib/jquery/jquery-3.7.1.min.js | 2 - lib/jquery/jquery-3.7.1.min.map | 1 - lib/json2html/README.md | 49 - lib/json2html/examples/bar-chart.html | 62 - lib/json2html/examples/basic.html | 54 - lib/json2html/examples/events.html | 116 - lib/json2html/jquery.json2html.js | 136 - lib/json2html/json2html.js | 447 - lib/json2html/package.json | 27 - lib/json2html/test/index.html | 116 - lib/json5/index.min.js | 1 - lib/json5/v2.1.0/CHANGELOG.md | 315 - lib/json5/v2.1.0/LICENSE.md | 23 - lib/json5/v2.1.0/README.md | 234 - lib/json5/v2.1.0/dist/index.js | 1688 --- lib/json5/v2.1.0/dist/index.min.js | 1 - lib/json5/v2.1.0/dist/index.min.mjs | 1 - lib/json5/v2.1.0/dist/index.mjs | 1392 -- lib/json5/v2.1.0/lib/cli.js | 112 - lib/json5/v2.1.0/lib/index.js | 9 - lib/json5/v2.1.0/lib/parse.js | 1087 -- lib/json5/v2.1.0/lib/register.js | 13 - lib/json5/v2.1.0/lib/require.js | 4 - lib/json5/v2.1.0/lib/stringify.js | 254 - lib/json5/v2.1.0/lib/unicode.js | 4 - lib/json5/v2.1.0/lib/util.js | 35 - lib/json5/v2.1.0/package.json | 110 - lib/kFSM/index.ts | 1167 ++ lib/mustache/3.0.1/CHANGELOG.md | 427 - lib/mustache/3.0.1/LICENSE | 11 - lib/mustache/3.0.1/MIGRATING.md | 50 - lib/mustache/3.0.1/README.md | 645 - lib/mustache/3.0.1/mustache.js | 682 - lib/mustache/3.0.1/mustache.min.js | 1 - .../3.0.1/wrappers/jquery/mustache.js.post | 13 - .../3.0.1/wrappers/jquery/mustache.js.pre | 9 - lib/mustache/mustache.js | 682 - lib/navigo/index.js | 1350 -- package-lock.json | 4525 ------- package.json | 35 +- pnpm-lock.yaml | 92 +- readme.md | 43 +- src/blapymotion-entry.ts | 8 + src/blapysocket-entry.ts | 8 + src/browser-entry.js | 37 - src/browser-entry.ts | 25 + src/core/AjaxService.ts | 4 +- src/core/Blapy.ts | 122 +- src/core/BlapyBlock.ts | 11 +- src/core/Logger.ts | 15 +- src/core/Router.ts | 23 +- src/core/TemplateManager.ts | 113 +- src/core/Utils.ts | 2 +- src/index.js | 30 - src/main.ts | 5 + .../{Blapymotion.js => BlapyMotion.ts} | 34 +- .../{BlapySocket.js => BlapySocket.ts} | 160 +- src/modules/Compatibility.js | 40 - src/modules/HTMLCompatibility.ts | 2 +- src/old/AjaxService.js | 196 - src/old/Blapy2.js | 1181 -- src/old/BlapyBlock.js | 157 - src/old/Logger.js | 107 - src/old/Router.js | 537 - src/old/TemplateManager.js | 892 -- src/old/Utils.js | 55 - src/shared/constant/index.ts | 1 + src/shared/types/html-extension.d.ts | 35 + src/shared/types/index.ts | 131 + src/types/html-extension.d.ts | 9 - .../e2e/bootstrap-four-column-gallery.spec.js | 2 +- tests/e2e/demo-json-append.spec.js | 2 +- tests/e2e/demo1.spec.js | 2 +- tests/units/BlapyBlock.test.js | 2 +- tsconfig.json | 15 + vite.blapymotion.config.ts | 43 + vite.blapysocket.config.ts | 43 + vite.config.ts | 40 +- 126 files changed, 2219 insertions(+), 29444 deletions(-) create mode 100644 demos/index.php delete mode 100644 dist/blapy2.js create mode 100644 docker-compose.yml delete mode 100644 lib/jquery.appear/.gitignore delete mode 100644 lib/jquery.appear/AUTHORS.txt delete mode 100644 lib/jquery.appear/CHANGELOG delete mode 100644 lib/jquery.appear/LICENSE delete mode 100644 lib/jquery.appear/README.md delete mode 100644 lib/jquery.appear/bower.json delete mode 100644 lib/jquery.appear/jquery.appear.js delete mode 100644 lib/jquery.appear/package.json delete mode 100644 lib/jquery/jquery-3.7.1.js delete mode 100644 lib/jquery/jquery-3.7.1.min.js delete mode 100644 lib/jquery/jquery-3.7.1.min.map delete mode 100644 lib/json2html/README.md delete mode 100644 lib/json2html/examples/bar-chart.html delete mode 100644 lib/json2html/examples/basic.html delete mode 100644 lib/json2html/examples/events.html delete mode 100644 lib/json2html/jquery.json2html.js delete mode 100644 lib/json2html/json2html.js delete mode 100644 lib/json2html/package.json delete mode 100644 lib/json2html/test/index.html delete mode 100644 lib/json5/index.min.js delete mode 100644 lib/json5/v2.1.0/CHANGELOG.md delete mode 100644 lib/json5/v2.1.0/LICENSE.md delete mode 100644 lib/json5/v2.1.0/README.md delete mode 100644 lib/json5/v2.1.0/dist/index.js delete mode 100644 lib/json5/v2.1.0/dist/index.min.js delete mode 100644 lib/json5/v2.1.0/dist/index.min.mjs delete mode 100644 lib/json5/v2.1.0/dist/index.mjs delete mode 100644 lib/json5/v2.1.0/lib/cli.js delete mode 100644 lib/json5/v2.1.0/lib/index.js delete mode 100644 lib/json5/v2.1.0/lib/parse.js delete mode 100644 lib/json5/v2.1.0/lib/register.js delete mode 100644 lib/json5/v2.1.0/lib/require.js delete mode 100644 lib/json5/v2.1.0/lib/stringify.js delete mode 100644 lib/json5/v2.1.0/lib/unicode.js delete mode 100644 lib/json5/v2.1.0/lib/util.js delete mode 100644 lib/json5/v2.1.0/package.json create mode 100644 lib/kFSM/index.ts delete mode 100644 lib/mustache/3.0.1/CHANGELOG.md delete mode 100644 lib/mustache/3.0.1/LICENSE delete mode 100644 lib/mustache/3.0.1/MIGRATING.md delete mode 100644 lib/mustache/3.0.1/README.md delete mode 100644 lib/mustache/3.0.1/mustache.js delete mode 100644 lib/mustache/3.0.1/mustache.min.js delete mode 100644 lib/mustache/3.0.1/wrappers/jquery/mustache.js.post delete mode 100644 lib/mustache/3.0.1/wrappers/jquery/mustache.js.pre delete mode 100644 lib/mustache/mustache.js delete mode 100644 lib/navigo/index.js delete mode 100644 package-lock.json create mode 100644 src/blapymotion-entry.ts create mode 100644 src/blapysocket-entry.ts delete mode 100644 src/browser-entry.js create mode 100644 src/browser-entry.ts delete mode 100644 src/index.js create mode 100644 src/main.ts rename src/modules/{Blapymotion.js => BlapyMotion.ts} (83%) rename src/modules/{BlapySocket.js => BlapySocket.ts} (69%) delete mode 100644 src/modules/Compatibility.js delete mode 100644 src/old/AjaxService.js delete mode 100644 src/old/Blapy2.js delete mode 100644 src/old/BlapyBlock.js delete mode 100644 src/old/Logger.js delete mode 100644 src/old/Router.js delete mode 100644 src/old/TemplateManager.js delete mode 100644 src/old/Utils.js create mode 100644 src/shared/constant/index.ts create mode 100644 src/shared/types/html-extension.d.ts create mode 100644 src/shared/types/index.ts delete mode 100644 src/types/html-extension.d.ts create mode 100644 tsconfig.json create mode 100644 vite.blapymotion.config.ts create mode 100644 vite.blapysocket.config.ts diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8a09709..cceacfa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,28 +60,30 @@ jobs: - name: Install jq (for reading version from package.json) run: sudo apt-get update && sudo apt-get install -y jq - - name: Bump version + tag + - name: Create tag from package.json version id: version run: | - LAST_VERSION=$(git tag --sort=-v:refname | tail -n 1) - if [[ "$LAST_VERSION" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then - MAJOR=${BASH_REMATCH[1]} - MINOR=${BASH_REMATCH[2]} - PATCH=${BASH_REMATCH[3]} - NEW_VERSION="v$(jq -r .version package.json)" - else - NEW_VERSION="v0.0.1" - fi - echo "New version: $NEW_VERSION" + VERSION=$(jq -r .version package.json) + NEW_VERSION="v$VERSION" + echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT - git tag $NEW_VERSION - git push origin $NEW_VERSION + + if git tag -l | grep -qx "$NEW_VERSION"; then + echo "Tag already exists: $NEW_VERSION" + echo "tag_created=false" >> $GITHUB_OUTPUT + exit 0 + fi + + git tag "$NEW_VERSION" + git push origin "$NEW_VERSION" + echo "tag_created=true" >> $GITHUB_OUTPUT - name: Create GitHub Release + if: steps.version.outputs.tag_created == 'true' uses: softprops/action-gh-release@v1 with: tag_name: ${{ steps.version.outputs.new_version }} name: Release ${{ steps.version.outputs.new_version }} files: dist/blapy2.js env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9c8acaa..b98ee0d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,11 @@ old/** node_modules/** -docker-compose.yml .idea/** dist/** test-results/** CLAUDE.md **/node_modules/ -dist/blapy2.js \ No newline at end of file +dist/blapy2.js +bun.lockb +src/old +/Blapy2/ diff --git a/.prettierrc b/.prettierrc index e5ed4be..92beac4 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,6 +1,6 @@ { "endOfLine": "lf", - "semi": false, + "semi": true, "singleQuote": true, "tabWidth": 2, "trailingComma": "es5" diff --git a/LICENSE b/LICENSE index 092b62c..af502a7 100644 --- a/LICENSE +++ b/LICENSE @@ -7,7 +7,7 @@ * Abstract : transform your standard website into a web app * Remark : * ----------------------------------------------------------------------------------------- - * @copyright : Intersel 2015-2025 + * @copyright : Intersel 2015-2026 * @contributors : * - Emmanuel Podvin - github@intersel.fr * ----------------------------------------------------------------------------------------- diff --git a/demos/bootstrap-four-column-gallery/index.html b/demos/bootstrap-four-column-gallery/index.html index 71df7ba..2d6b646 100644 --- a/demos/bootstrap-four-column-gallery/index.html +++ b/demos/bootstrap-four-column-gallery/index.html @@ -96,20 +96,17 @@

Blapy Demo - Bootstrap Four Column Gallery

- - - - - - - + - - - - - - - + + + +

📂 Blapy2 — Demos

+

Clique sur une demo pour l'ouvrir. Le tag indique si elle utilise déjà le build moderne (blapy.umd.js).

+
    + +
  • + + + migrée + + legacy + +
  • + +
+ + \ No newline at end of file diff --git a/demos/startbootstrap-sb-admin-2/pages/index.php b/demos/startbootstrap-sb-admin-2/pages/index.php index 62382b3..2c21552 100644 --- a/demos/startbootstrap-sb-admin-2/pages/index.php +++ b/demos/startbootstrap-sb-admin-2/pages/index.php @@ -542,15 +542,9 @@ - - - - - - - - - + + - - - - - - + @@ -25,12 +19,12 @@

todos

+ onkeypress="if (event.keyCode==13) { document.getElementById('myBlapy').Blapy().myFSM.trigger('postData',{aUrl:'php/addAction.php',params:{actionName:this.value}}); this.value=''}">
+ onclick="document.getElementById('myBlapy').Blapy().myFSM.trigger('postData',{aUrl:'php/allCompleted.php',params:{toggleStatus:this.checked}})">
    @@ -66,7 +60,7 @@ - + + - - - - - - - - + + diff --git a/demos/websocket/index.html b/demos/websocket/index.html index e829fad..202eb87 100644 --- a/demos/websocket/index.html +++ b/demos/websocket/index.html @@ -4,15 +4,8 @@ Blapy WebSocket Demo + - - - - - - - - - - - -

    Bar Chart Example

    - -
      - - - - - diff --git a/lib/json2html/examples/basic.html b/lib/json2html/examples/basic.html deleted file mode 100644 index bcaf4a6..0000000 --- a/lib/json2html/examples/basic.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - JSON2HTML Basic Example - - - - - - - - - - - - - - - - - - - -

      Basic Example

      - -
        - - - - - diff --git a/lib/json2html/examples/events.html b/lib/json2html/examples/events.html deleted file mode 100644 index 043471b..0000000 --- a/lib/json2html/examples/events.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - JSON2HTML Event Example - - - - - - - - - - - - - - - - - - - -

        Events Example

        - -

        Click on a company to select it

        - -
          - -
          - - - - - - diff --git a/lib/json2html/jquery.json2html.js b/lib/json2html/jquery.json2html.js deleted file mode 100644 index 0afb6c0..0000000 --- a/lib/json2html/jquery.json2html.js +++ /dev/null @@ -1,136 +0,0 @@ -//Copyright (c) 2016 Crystalline Technologies -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), -// to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -(function($){ - - //Alias for json2html.transform - // _options - // output : json2html | html | jquery - $.json2html = function(json, transform, _options) { - - //Make sure we have the json2html base loaded - if(typeof json2html === 'undefined') return(undefined); - - //Default Options - var options = { - 'output':'json2html' - }; - - //Extend the options (with defaults) - if( _options !== undefined ) $.extend(options, _options); - - switch(options.output){ - - //Process the transform with events - // for consumption within a json2html html attribute function call - // returns an object {'html':html,'events'[]} - case 'json2html': - - //make sure we have the events set as true - options.events = true; - - return(json2html.transform(json, transform, options)); - break; - - //Return raw html (same as calling json2html.transform - case 'html': - - //make sure we have the events set as false (to get html) - options.events = false; - - return(json2html.transform(json, transform, options)); - break; - - //Return a jquery object - case 'jquery': - - //make sure we have the events set as true - options.events = false; - - //let json2html core do it's magic - // and then process any jquery events - var $result = json2html_events(json2html.transform(json, transform, options)); - - //return the jquery object - return($result); - break; - } - }; - - //Chaining method - $.fn.json2html = function(json, transform, _options) { - - //Make sure we have the json2html base loaded - if(typeof json2html === 'undefined') return(undefined); - - //Default Options - var options = { - 'append':true, - 'replace':false, - 'prepend':false, - 'eventData':{} - }; - - //Extend the options (with defaults) - if( _options !== undefined ) $.extend(options, _options); - - //Insure that we have the events turned (Required) - options.events = true; - - //Otherwise we're running $().json2html - return this.each(function(){ - - //let json2html core do it's magic - // and then process any jquery events - var $result = json2html_events(json2html.transform(json, transform, options)); - - //Append it to the appropriate element - if (options.replace) $.fn.replaceWith.call($(this),$result); - else if (options.prepend) $.fn.prepend.call($(this),$result); - else $.fn.append.call($(this),$result); - }); - }; -})(jQuery); - - -function json2html_events(result) { - - //Attach the html(string) result to the DOM - var dom = $(document.createElement('i')).html(result.html); - - //Determine if we have events - for(var i = 0; i < result.events.length; i++) { - - var event = result.events[i]; - - //find the associated DOM object with this event - var obj = $(dom).find("[json2html-event-id-"+event.type+"='" + event.id + "']"); - - //Check to see if we found this element or not - if(obj.length === 0) throw 'jquery.json2html was unable to attach event ' + event.id + ' to DOM'; - - //remove the attribute - $(obj).removeAttr('json2html-event-id-'+event.type); - - //attach the event - $(obj).on(event.type,event.data,function(e){ - //attach the jquery event - e.data.event = e; - - //call the appropriate method - e.data.action.call($(this),e.data); - }); - } - - //Get the children to this result - return($(dom).children()); -} \ No newline at end of file diff --git a/lib/json2html/json2html.js b/lib/json2html/json2html.js deleted file mode 100644 index c20b6c7..0000000 --- a/lib/json2html/json2html.js +++ /dev/null @@ -1,447 +0,0 @@ -//Copyright (c) 2018 Crystalline Technologies -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), -// to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -var json2html = { - - /* ---------------------------------------- Public Methods ------------------------------------------------ */ - 'transform': function(json,transform,_options) { - - //create the default output - var out = {'events':[],'html':''}; - - //default options (by default we don't allow events) - var options = { - 'events':false - }; - - //extend the options - options = json2html._extend(options,_options); - - //Make sure we have a transform & json object - if( transform !== undefined || json !== undefined ) { - - //Normalize strings to JSON objects if necessary - var obj = typeof json === 'string' ? JSON.parse(json) : json; - - //Transform the object (using the options) - out = json2html._transform(obj, transform, options); - } - - //determine if we need the events - // otherwise return just the html string - if(options.events) return(out); - else return( out.html ); - }, - - /* ---------------------------------------- Private Methods ------------------------------------------------ */ - - //Extend options - '_extend':function(obj1,obj2){ - var obj3 = {}; - for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; } - for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; } - return obj3; - }, - - //Append results - '_append':function(obj1,obj2) { - var out = {'html':'','event':[]}; - if(typeof obj1 !== 'undefined' && typeof obj2 !== 'undefined') { - out.html = obj1.html + obj2.html; - - out.events = obj1.events.concat(obj2.events); - } - - return(out); - }, - - //isArray (fix for IE prior to 9) - '_isArray':function(obj) { - return Object.prototype.toString.call(obj) === '[object Array]'; - }, - - //Transform object - '_transform':function(json, transform, options) { - - var elements = {'events':[],'html':''}; - - //Determine the type of this object - if(json2html._isArray(json)) { - - //Itterrate through the array and add it to the elements array - var len=json.length; - for(var j=0;j instead) - case 'tag': - - //HTML element to render - case '<>': - //Do nothing as we have already created the element - break; - - //Encode as text - case 'text': - //Get the transform value associated with this key - var _transform = transform[key]; - - //Determine what kind of object this is - // array => NOT SUPPORTED - // other => text - if(json2html._isArray(_transform)) { - //NOT Supported - } else if(typeof _transform === 'function') { - - //Get the result from the function - var temp = _transform.call(obj, obj, index); - - //Don't allow arrays as return objects from functions - if(!json2html._isArray(temp)) { - - //Determine what type of object was returned - switch(typeof temp){ - - //Not supported for text - case 'function': - case 'undefined': - case 'object': - break; - - //Append as text - // string, number, boolean - default: - //Insure we encode as text first - children.html += json2html.toText(temp); - break; - } - } - } else { - - //Get the encoded text associated with this element - html = json2html.toText( json2html._getValue(obj,transform,key,index) ); - } - break; - - //DEPRECATED (use HTML instead) - case 'children': - - //Encode as HTML - // accepts Array of children, functions, string, number, boolean - case 'html': - - //Get the transform value associated with this key - // added as key could be children or html - var _transform = transform[key]; - - //Determine what kind of object this is - // array & function => children - // other => html - if(json2html._isArray(_transform)) { - - //Apply the transform to the children - children = json2html._append(children,json2html._apply(obj, _transform, index, options)); - } else if(typeof _transform === 'function') { - - //Get the result from the function - var temp = _transform.call(obj, obj, index); - - //Don't allow arrays as return objects from functions - if(!json2html._isArray(temp)) { - - //Determine what type of object was returned - switch(typeof temp){ - - //Only returned by json2html.transform or $.json2html calls - case 'object': - //make sure this object is a valid json2html response object - // we ignore all other objects (since we don't know how to represent them in html) - if(temp.html !== undefined && temp.events !== undefined) children = json2html._append(children,temp); - break; - - //Not supported - case 'function': - case 'undefined': - break; - - //Append to html - // string, number, boolean - default: - children.html += temp; - break; - } - } - } else { - - //Get the HTML associated with this element - html = json2html._getValue(obj,transform,key,index); - } - break; - - default: - //Add the property as a attribute if it's not a key one - var isEvent = false; - - //Check if the first two characters are 'on' then this is an event - if( key.length > 2 ) - if(key.substring(0,2).toLowerCase() == 'on') { - - //Determine if we should add events - if(options.events) { - - //if so then setup the event data - var data = { - 'action':transform[key], - 'obj':obj, - 'data':options.eventData, - 'index':index - }; - - //create a new id for this event - var id = json2html._guid(); - - //append the new event to this elements events - element.events[element.events.length] = {'id':id,'type':key.substring(2),'data':data}; - - //Insert temporary event property (json2html-event-id) into the element - element.html += " json2html-event-id-"+key.substring(2)+"='" + id + "'"; - } - //this is an event - isEvent = true; - } - - //If this wasn't an event AND we actually have a value then add it as a property - if( !isEvent){ - //Get the value - var val = json2html._getValue(obj, transform, key, index); - - //Make sure we have a value - if(val !== undefined) { - var out; - - //Determine the output type of this value (wrap with quotes) - if(typeof val === 'string') out = '"' + val.replace(/"/g, '"') + '"'; - else out = val; - - //create the name value pair - element.html += ' ' + key + '=' + out; - } - } - break; - } - } - - //close the opening element - element.html += '>'; - - //add the innerHTML (if we have any) - if(html) element.html += html; - - //add the children (if we have any) - element = json2html._append(element,children); - - //add the closing element - element.html += ''; - } - } - - //Return the output object - return(element); - }, - - //Get a new GUID (used by events) - '_guid':function() { - var S4 = function() { - return (((1+Math.random())*0x10000)|0).toString(16).substring(1); - }; - return (S4()+S4()+"-"+S4()+S4()+"-"+S4()+S4()); - }, - - //Get the html value of the object - '_getValue':function(obj, transform, key,index) { - - var out = ''; - - var val = transform[key]; - var type = typeof val; - - if (type === 'function') { - return(val.call(obj,obj,index)); - } else if (type === 'string') { - var _tokenizer = new json2html._tokenizer([ - /\$\{([^\}\{]+)\}/ - ],function( src, real, re ){ - return real ? src.replace(re,function(all,name){ - - //Split the string into it's seperate components - var components = name.split('.'); - - //Set the object we use to query for this name to be the original object - var useObj = obj; - - //Output value - var outVal = ''; - - //Parse the object components - var c_len = components.length; - for (var i=0;i 0 ) { - - var newObj = useObj[components[i]]; - useObj = newObj; - if(useObj === null || useObj === undefined) break; - } - } - - //As long as we have an object to use then set the out - if(useObj !== null && useObj !== undefined) outVal = useObj; - - return(outVal); - }) : src; - }); - - out = _tokenizer.parse(val).join(''); - } else { - out = val; - } - - return(out); - }, - - //Encode the html to text - 'toText':function(html) { - return html - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/\"/g, '"') - .replace(/\'/g, ''') - .replace(/\//g, '/'); - }, - - //Tokenizer - '_tokenizer':function( tokenizers, doBuild ){ - - if( !(this instanceof json2html._tokenizer ) ) - return new json2html._tokenizer( tokenizers, doBuild ); - - this.tokenizers = tokenizers.splice ? tokenizers : [tokenizers]; - if( doBuild ) - this.doBuild = doBuild; - - this.parse = function( src ){ - this.src = src; - this.ended = false; - this.tokens = [ ]; - do { - this.next(); - } while( !this.ended ); - return this.tokens; - }; - - this.build = function( src, real ){ - if( src ) - this.tokens.push( - !this.doBuild ? src : - this.doBuild(src,real,this.tkn) - ); - }; - - this.next = function(){ - var self = this, - plain; - - self.findMin(); - plain = self.src.slice(0, self.min); - - self.build( plain, false ); - - self.src = self.src.slice(self.min).replace(self.tkn,function( all ){ - self.build(all, true); - return ''; - }); - - if( !self.src ) - self.ended = true; - }; - - this.findMin = function(){ - var self = this, i=0, tkn, idx; - self.min = -1; - self.tkn = ''; - - while(( tkn = self.tokenizers[i++]) !== undefined ){ - idx = self.src[tkn.test?'search':'indexOf'](tkn); - if( idx != -1 && (self.min == -1 || idx < self.min )){ - self.tkn = tkn; - self.min = idx; - } - } - if( self.min == -1 ) - self.min = self.src.length; - }; - } -}; diff --git a/lib/json2html/package.json b/lib/json2html/package.json deleted file mode 100644 index e1edfad..0000000 --- a/lib/json2html/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "author": { - "name": "Chad Brown", - "email": "info@json2html.com", - "url": "http://json2html.com" - }, - "name": "jquery.json2html", - "description": "jquery.json2html - HTML Templating", - "version": "1.2.0", - "homepage": "http://json2html.com", - "repository": { - "url": "https://github.com/moappi/jquery.json2html.git" - }, - "keywords": [ - "json2html", - "templating", - "html", - "web", - "templates", - "transforms", - "json" - ], - "main": "jquery.json2html.js", - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {} -} \ No newline at end of file diff --git a/lib/json2html/test/index.html b/lib/json2html/test/index.html deleted file mode 100644 index 219e719..0000000 --- a/lib/json2html/test/index.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - JSON2HTML Tests - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/json5/index.min.js b/lib/json5/index.min.js deleted file mode 100644 index b336aba..0000000 --- a/lib/json5/index.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(u,D){"object"==typeof exports&&"undefined"!=typeof module?module.exports=D():"function"==typeof define&&define.amd?define(D):u.JSON5=D()}(this,function(){"use strict";function u(u,D){return u(D={exports:{}},D.exports),D.exports}var D=u(function(u){var D=u.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=D)}),e=u(function(u){var D=u.exports={version:"2.5.7"};"number"==typeof __e&&(__e=D)}),t=(e.version,function(u){return"object"==typeof u?null!==u:"function"==typeof u}),r=function(u){if(!t(u))throw TypeError(u+" is not an object!");return u},F=function(u){try{return!!u()}catch(u){return!0}},n=!F(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),C=D.document,A=t(C)&&t(C.createElement),E=!n&&!F(function(){return 7!=Object.defineProperty((u="div",A?C.createElement(u):{}),"a",{get:function(){return 7}}).a;var u}),i=Object.defineProperty,o={f:n?Object.defineProperty:function(u,D,e){if(r(u),D=function(u,D){if(!t(u))return u;var e,r;if(D&&"function"==typeof(e=u.toString)&&!t(r=e.call(u)))return r;if("function"==typeof(e=u.valueOf)&&!t(r=e.call(u)))return r;if(!D&&"function"==typeof(e=u.toString)&&!t(r=e.call(u)))return r;throw TypeError("Can't convert object to primitive value")}(D,!0),r(e),E)try{return i(u,D,e)}catch(u){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(u[D]=e.value),u}},a=n?function(u,D,e){return o.f(u,D,function(u,D){return{enumerable:!(1&u),configurable:!(2&u),writable:!(4&u),value:D}}(1,e))}:function(u,D,e){return u[D]=e,u},c={}.hasOwnProperty,B=function(u,D){return c.call(u,D)},s=0,f=Math.random(),l=u(function(u){var t,r="Symbol(".concat(void 0===(t="src")?"":t,")_",(++s+f).toString(36)),F=Function.toString,n=(""+F).split("toString");e.inspectSource=function(u){return F.call(u)},(u.exports=function(u,e,t,F){var C="function"==typeof t;C&&(B(t,"name")||a(t,"name",e)),u[e]!==t&&(C&&(B(t,r)||a(t,r,u[e]?""+u[e]:n.join(String(e)))),u===D?u[e]=t:F?u[e]?u[e]=t:a(u,e,t):(delete u[e],a(u,e,t)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[r]||F.call(this)})}),d=function(u,D,e){if(function(u){if("function"!=typeof u)throw TypeError(u+" is not a function!")}(u),void 0===D)return u;switch(e){case 1:return function(e){return u.call(D,e)};case 2:return function(e,t){return u.call(D,e,t)};case 3:return function(e,t,r){return u.call(D,e,t,r)}}return function(){return u.apply(D,arguments)}},v=function(u,t,r){var F,n,C,A,E=u&v.F,i=u&v.G,o=u&v.S,c=u&v.P,B=u&v.B,s=i?D:o?D[t]||(D[t]={}):(D[t]||{}).prototype,f=i?e:e[t]||(e[t]={}),p=f.prototype||(f.prototype={});for(F in i&&(r=t),r)C=((n=!E&&s&&void 0!==s[F])?s:r)[F],A=B&&n?d(C,D):c&&"function"==typeof C?d(Function.call,C):C,s&&l(s,F,C,u&v.U),f[F]!=C&&a(f,F,A),c&&p[F]!=C&&(p[F]=C)};D.core=e,v.F=1,v.G=2,v.S=4,v.P=8,v.B=16,v.W=32,v.U=64,v.R=128;var p,h=v,m=Math.ceil,g=Math.floor,y=function(u){return isNaN(u=+u)?0:(u>0?g:m)(u)},w=(p=!1,function(u,D){var e,t,r=String(function(u){if(null==u)throw TypeError("Can't call method on "+u);return u}(u)),F=y(D),n=r.length;return F<0||F>=n?p?"":void 0:(e=r.charCodeAt(F))<55296||e>56319||F+1===n||(t=r.charCodeAt(F+1))<56320||t>57343?p?r.charAt(F):e:p?r.slice(F,F+2):t-56320+(e-55296<<10)+65536});h(h.P,"String",{codePointAt:function(u){return w(this,u)}});e.String.codePointAt;var S=Math.max,b=Math.min,x=String.fromCharCode,N=String.fromCodePoint;h(h.S+h.F*(!!N&&1!=N.length),"String",{fromCodePoint:function(u){for(var D,e,t,r=arguments,F=[],n=arguments.length,C=0;n>C;){if(D=+r[C++],t=1114111,((e=y(e=D))<0?S(e+t,0):b(e,t))!==D)throw RangeError(D+" is not a valid code point");F.push(D<65536?x(D):x(55296+((D-=65536)>>10),D%1024+56320))}return F.join("")}});e.String.fromCodePoint;var P,I,O,_,j,V,J,M,L,k,T,H,$,z,R={Space_Separator:/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},G={isSpaceSeparator:function(u){return R.Space_Separator.test(u)},isIdStartChar:function(u){return u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||R.ID_Start.test(u)},isIdContinueChar:function(u){return u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||R.ID_Continue.test(u)},isDigit:function(u){return/[0-9]/.test(u)},isHexDigit:function(u){return/[0-9A-Fa-f]/.test(u)}};function U(){for(k="default",T="",H=!1,$=1;;){z=Z();var u=W[k]();if(u)return u}}function Z(){if(P[_])return String.fromCodePoint(P.codePointAt(_))}function q(){var u=Z();return"\n"===u?(j++,V=0):u?V+=u.length:V++,u&&(_+=u.length),u}var W={default:function(){switch(z){case"\t":case"\v":case"\f":case" ":case" ":case"\ufeff":case"\n":case"\r":case"\u2028":case"\u2029":return void q();case"/":return q(),void(k="comment");case void 0:return q(),X("eof")}if(!G.isSpaceSeparator(z))return W[I]();q()},comment:function(){switch(z){case"*":return q(),void(k="multiLineComment");case"/":return q(),void(k="singleLineComment")}throw eu(q())},multiLineComment:function(){switch(z){case"*":return q(),void(k="multiLineCommentAsterisk");case void 0:throw eu(q())}q()},multiLineCommentAsterisk:function(){switch(z){case"*":return void q();case"/":return q(),void(k="default");case void 0:throw eu(q())}q(),k="multiLineComment"},singleLineComment:function(){switch(z){case"\n":case"\r":case"\u2028":case"\u2029":return q(),void(k="default");case void 0:return q(),X("eof")}q()},value:function(){switch(z){case"{":case"[":return X("punctuator",q());case"n":return q(),K("ull"),X("null",null);case"t":return q(),K("rue"),X("boolean",!0);case"f":return q(),K("alse"),X("boolean",!1);case"-":case"+":return"-"===q()&&($=-1),void(k="sign");case".":return T=q(),void(k="decimalPointLeading");case"0":return T=q(),void(k="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return T=q(),void(k="decimalInteger");case"I":return q(),K("nfinity"),X("numeric",1/0);case"N":return q(),K("aN"),X("numeric",NaN);case'"':case"'":return H='"'===q(),T="",void(k="string")}throw eu(q())},identifierNameStartEscape:function(){if("u"!==z)throw eu(q());q();var u=Q();switch(u){case"$":case"_":break;default:if(!G.isIdStartChar(u))throw ru()}T+=u,k="identifierName"},identifierName:function(){switch(z){case"$":case"_":case"‌":case"‍":return void(T+=q());case"\\":return q(),void(k="identifierNameEscape")}if(!G.isIdContinueChar(z))return X("identifier",T);T+=q()},identifierNameEscape:function(){if("u"!==z)throw eu(q());q();var u=Q();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!G.isIdContinueChar(u))throw ru()}T+=u,k="identifierName"},sign:function(){switch(z){case".":return T=q(),void(k="decimalPointLeading");case"0":return T=q(),void(k="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return T=q(),void(k="decimalInteger");case"I":return q(),K("nfinity"),X("numeric",$*(1/0));case"N":return q(),K("aN"),X("numeric",NaN)}throw eu(q())},zero:function(){switch(z){case".":return T+=q(),void(k="decimalPoint");case"e":case"E":return T+=q(),void(k="decimalExponent");case"x":case"X":return T+=q(),void(k="hexadecimal")}return X("numeric",0*$)},decimalInteger:function(){switch(z){case".":return T+=q(),void(k="decimalPoint");case"e":case"E":return T+=q(),void(k="decimalExponent")}if(!G.isDigit(z))return X("numeric",$*Number(T));T+=q()},decimalPointLeading:function(){if(G.isDigit(z))return T+=q(),void(k="decimalFraction");throw eu(q())},decimalPoint:function(){switch(z){case"e":case"E":return T+=q(),void(k="decimalExponent")}return G.isDigit(z)?(T+=q(),void(k="decimalFraction")):X("numeric",$*Number(T))},decimalFraction:function(){switch(z){case"e":case"E":return T+=q(),void(k="decimalExponent")}if(!G.isDigit(z))return X("numeric",$*Number(T));T+=q()},decimalExponent:function(){switch(z){case"+":case"-":return T+=q(),void(k="decimalExponentSign")}if(G.isDigit(z))return T+=q(),void(k="decimalExponentInteger");throw eu(q())},decimalExponentSign:function(){if(G.isDigit(z))return T+=q(),void(k="decimalExponentInteger");throw eu(q())},decimalExponentInteger:function(){if(!G.isDigit(z))return X("numeric",$*Number(T));T+=q()},hexadecimal:function(){if(G.isHexDigit(z))return T+=q(),void(k="hexadecimalInteger");throw eu(q())},hexadecimalInteger:function(){if(!G.isHexDigit(z))return X("numeric",$*Number(T));T+=q()},string:function(){switch(z){case"\\":return q(),void(T+=function(){switch(Z()){case"b":return q(),"\b";case"f":return q(),"\f";case"n":return q(),"\n";case"r":return q(),"\r";case"t":return q(),"\t";case"v":return q(),"\v";case"0":if(q(),G.isDigit(Z()))throw eu(q());return"\0";case"x":return q(),function(){var u="",D=Z();if(!G.isHexDigit(D))throw eu(q());if(u+=q(),D=Z(),!G.isHexDigit(D))throw eu(q());return u+=q(),String.fromCodePoint(parseInt(u,16))}();case"u":return q(),Q();case"\n":case"\u2028":case"\u2029":return q(),"";case"\r":return q(),"\n"===Z()&&q(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case void 0:throw eu(q())}return q()}());case'"':return H?(q(),X("string",T)):void(T+=q());case"'":return H?void(T+=q()):(q(),X("string",T));case"\n":case"\r":throw eu(q());case"\u2028":case"\u2029":!function(u){console.warn("JSON5: '"+Fu(u)+"' in strings is not valid ECMAScript; consider escaping")}(z);break;case void 0:throw eu(q())}T+=q()},start:function(){switch(z){case"{":case"[":return X("punctuator",q())}k="value"},beforePropertyName:function(){switch(z){case"$":case"_":return T=q(),void(k="identifierName");case"\\":return q(),void(k="identifierNameStartEscape");case"}":return X("punctuator",q());case'"':case"'":return H='"'===q(),void(k="string")}if(G.isIdStartChar(z))return T+=q(),void(k="identifierName");throw eu(q())},afterPropertyName:function(){if(":"===z)return X("punctuator",q());throw eu(q())},beforePropertyValue:function(){k="value"},afterPropertyValue:function(){switch(z){case",":case"}":return X("punctuator",q())}throw eu(q())},beforeArrayValue:function(){if("]"===z)return X("punctuator",q());k="value"},afterArrayValue:function(){switch(z){case",":case"]":return X("punctuator",q())}throw eu(q())},end:function(){throw eu(q())}};function X(u,D){return{type:u,value:D,line:j,column:V}}function K(u){for(var D=0,e=u;D0;){var e=Z();if(!G.isHexDigit(e))throw eu(q());u+=q()}return String.fromCodePoint(parseInt(u,16))}var Y={start:function(){if("eof"===J.type)throw tu();uu()},beforePropertyName:function(){switch(J.type){case"identifier":case"string":return M=J.value,void(I="afterPropertyName");case"punctuator":return void Du();case"eof":throw tu()}},afterPropertyName:function(){if("eof"===J.type)throw tu();I="beforePropertyValue"},beforePropertyValue:function(){if("eof"===J.type)throw tu();uu()},beforeArrayValue:function(){if("eof"===J.type)throw tu();"punctuator"!==J.type||"]"!==J.value?uu():Du()},afterPropertyValue:function(){if("eof"===J.type)throw tu();switch(J.value){case",":return void(I="beforePropertyName");case"}":Du()}},afterArrayValue:function(){if("eof"===J.type)throw tu();switch(J.value){case",":return void(I="beforeArrayValue");case"]":Du()}},end:function(){}};function uu(){var u;switch(J.type){case"punctuator":switch(J.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=J.value}if(void 0===L)L=u;else{var D=O[O.length-1];Array.isArray(D)?D.push(u):D[M]=u}if(null!==u&&"object"==typeof u)O.push(u),I=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{var e=O[O.length-1];I=null==e?"end":Array.isArray(e)?"afterArrayValue":"afterPropertyValue"}}function Du(){O.pop();var u=O[O.length-1];I=null==u?"end":Array.isArray(u)?"afterArrayValue":"afterPropertyValue"}function eu(u){return nu(void 0===u?"JSON5: invalid end of input at "+j+":"+V:"JSON5: invalid character '"+Fu(u)+"' at "+j+":"+V)}function tu(){return nu("JSON5: invalid end of input at "+j+":"+V)}function ru(){return nu("JSON5: invalid identifier character at "+j+":"+(V-=5))}function Fu(u){var D={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(D[u])return D[u];if(u<" "){var e=u.charCodeAt(0).toString(16);return"\\x"+("00"+e).substring(e.length)}return u}function nu(u){var D=new SyntaxError(u);return D.lineNumber=j,D.columnNumber=V,D}return{parse:function(u,D){P=String(u),I="start",O=[],_=0,j=1,V=0,J=void 0,M=void 0,L=void 0;do{J=U(),Y[I]()}while("eof"!==J.type);return"function"==typeof D?function u(D,e,t){var r=D[e];if(null!=r&&"object"==typeof r)for(var F in r){var n=u(r,F,t);void 0===n?delete r[F]:r[F]=n}return t.call(D,e,r)}({"":L},"",D):L},stringify:function(u,D,e){var t,r,F,n=[],C="",A="";if(null==D||"object"!=typeof D||Array.isArray(D)||(e=D.space,F=D.quote,D=D.replacer),"function"==typeof D)r=D;else if(Array.isArray(D)){t=[];for(var E=0,i=D;E0&&(e=Math.min(10,Math.floor(e)),A=" ".substr(0,e)):"string"==typeof e&&(A=e.substr(0,10)),c("",{"":u});function c(u,D){var e=D[u];switch(null!=e&&("function"==typeof e.toJSON5?e=e.toJSON5(u):"function"==typeof e.toJSON&&(e=e.toJSON(u))),r&&(e=r.call(D,u,e)),e instanceof Number?e=Number(e):e instanceof String?e=String(e):e instanceof Boolean&&(e=e.valueOf()),e){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof e?B(e):"number"==typeof e?String(e):"object"==typeof e?Array.isArray(e)?function(u){if(n.indexOf(u)>=0)throw TypeError("Converting circular structure to JSON5");n.push(u);var D=C;C+=A;for(var e,t=[],r=0;r=0)throw TypeError("Converting circular structure to JSON5");n.push(u);var D=C;C+=A;for(var e,r,F=t||Object.keys(u),E=[],i=0,o=F;i -``` - -This will create a global `JSON5` variable. - -## API -The JSON5 API is compatible with the [JSON API]. - -[JSON API]: -https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON - -### JSON5.parse() -Parses a JSON5 string, constructing the JavaScript value or object described by -the string. An optional reviver function can be provided to perform a -transformation on the resulting object before it is returned. - -#### Syntax - JSON5.parse(text[, reviver]) - -#### Parameters -- `text`: The string to parse as JSON5. -- `reviver`: If a function, this prescribes how the value originally produced by - parsing is transformed, before being returned. - -#### Return value -The object corresponding to the given JSON5 text. - -### JSON5.stringify() -Converts a JavaScript value to a JSON5 string, optionally replacing values if a -replacer function is specified, or optionally including only the specified -properties if a replacer array is specified. - -#### Syntax - JSON5.stringify(value[, replacer[, space]]) - JSON5.stringify(value[, options]) - -#### Parameters -- `value`: The value to convert to a JSON5 string. -- `replacer`: A function that alters the behavior of the stringification - process, or an array of String and Number objects that serve as a whitelist - for selecting/filtering the properties of the value object to be included in - the JSON5 string. If this value is null or not provided, all properties of the - object are included in the resulting JSON5 string. -- `space`: A String or Number object that's used to insert white space into the - output JSON5 string for readability purposes. If this is a Number, it - indicates the number of space characters to use as white space; this number is - capped at 10 (if it is greater, the value is just 10). Values less than 1 - indicate that no space should be used. If this is a String, the string (or the - first 10 characters of the string, if it's longer than that) is used as white - space. If this parameter is not provided (or is null), no white space is used. - If white space is used, trailing commas will be used in objects and arrays. -- `options`: An object with the following properties: - - `replacer`: Same as the `replacer` parameter. - - `space`: Same as the `space` parameter. - - `quote`: A String representing the quote character to use when serializing - strings. - -#### Return value -A JSON5 string representing the value. - -### Node.js `require()` JSON5 files -When using Node.js, you can `require()` JSON5 files by adding the following -statement. - -```js -require('json5/lib/register') -``` - -Then you can load a JSON5 file with a Node.js `require()` statement. For -example: - -```js -const config = require('./config.json5') -``` - -## CLI -Since JSON is more widely used than JSON5, this package includes a CLI for -converting JSON5 to JSON and for validating the syntax of JSON5 documents. - -### Installation -```sh -npm install --global json5 -``` - -### Usage -```sh -json5 [options] -``` - -If `` is not provided, then STDIN is used. - -#### Options: -- `-s`, `--space`: The number of spaces to indent or `t` for tabs -- `-o`, `--out-file [file]`: Output to the specified file, otherwise STDOUT -- `-v`, `--validate`: Validate JSON5 but do not output JSON -- `-V`, `--version`: Output the version number -- `-h`, `--help`: Output usage information - -## Contributing -### Development -```sh -git clone https://github.com/json5/json5 -cd json5 -npm install -``` - -When contributing code, please write relevant tests and run `npm test` and `npm -run lint` before submitting pull requests. Please use an editor that supports -[EditorConfig](http://editorconfig.org/). - -### Issues -To report bugs or request features regarding the JSON5 data format, please -submit an issue to the [official specification -repository](https://github.com/json5/json5-spec). - -To report bugs or request features regarding the JavaScript implentation of -JSON5, please submit an issue to this repository. - -## License -MIT. See [LICENSE.md](./LICENSE.md) for details. - -## Credits -[Assem Kishore](https://github.com/aseemk) founded this project. - -[Michael Bolin](http://bolinfest.com/) independently arrived at and published -some of these same ideas with awesome explanations and detail. Recommended -reading: [Suggested Improvements to JSON](http://bolinfest.com/essays/json.html) - -[Douglas Crockford](http://www.crockford.com/) of course designed and built -JSON, but his state machine diagrams on the [JSON website](http://json.org/), as -cheesy as it may sound, gave us motivation and confidence that building a new -parser to implement these ideas was within reach! The original -implementation of JSON5 was also modeled directly off of Doug’s open-source -[json_parse.js] parser. We’re grateful for that clean and well-documented -code. - -[json_parse.js]: -https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js - -[Max Nanasy](https://github.com/MaxNanasy) has been an early and prolific -supporter, contributing multiple patches and ideas. - -[Andrew Eisenberg](https://github.com/aeisenberg) contributed the original -`stringify` method. - -[Jordan Tucker](https://github.com/jordanbtucker) has aligned JSON5 more closely -with ES5, wrote the official JSON5 specification, completely rewrote the -codebase from the ground up, and is actively maintaining this project. diff --git a/lib/json5/v2.1.0/dist/index.js b/lib/json5/v2.1.0/dist/index.js deleted file mode 100644 index dcbe04f..0000000 --- a/lib/json5/v2.1.0/dist/index.js +++ /dev/null @@ -1,1688 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.JSON5 = factory()); -}(this, (function () { 'use strict'; - - function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; - } - - var _global = createCommonjsModule(function (module) { - // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 - var global = module.exports = typeof window != 'undefined' && window.Math == Math - ? window : typeof self != 'undefined' && self.Math == Math ? self - // eslint-disable-next-line no-new-func - : Function('return this')(); - if (typeof __g == 'number') { __g = global; } // eslint-disable-line no-undef - }); - - var _core = createCommonjsModule(function (module) { - var core = module.exports = { version: '2.5.7' }; - if (typeof __e == 'number') { __e = core; } // eslint-disable-line no-undef - }); - var _core_1 = _core.version; - - var _isObject = function (it) { - return typeof it === 'object' ? it !== null : typeof it === 'function'; - }; - - var _anObject = function (it) { - if (!_isObject(it)) { throw TypeError(it + ' is not an object!'); } - return it; - }; - - var _fails = function (exec) { - try { - return !!exec(); - } catch (e) { - return true; - } - }; - - // Thank's IE8 for his funny defineProperty - var _descriptors = !_fails(function () { - return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; - }); - - var document = _global.document; - // typeof document.createElement is 'object' in old IE - var is = _isObject(document) && _isObject(document.createElement); - var _domCreate = function (it) { - return is ? document.createElement(it) : {}; - }; - - var _ie8DomDefine = !_descriptors && !_fails(function () { - return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7; - }); - - // 7.1.1 ToPrimitive(input [, PreferredType]) - - // instead of the ES6 spec version, we didn't implement @@toPrimitive case - // and the second argument - flag - preferred type is a string - var _toPrimitive = function (it, S) { - if (!_isObject(it)) { return it; } - var fn, val; - if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) { return val; } - if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) { return val; } - if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) { return val; } - throw TypeError("Can't convert object to primitive value"); - }; - - var dP = Object.defineProperty; - - var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) { - _anObject(O); - P = _toPrimitive(P, true); - _anObject(Attributes); - if (_ie8DomDefine) { try { - return dP(O, P, Attributes); - } catch (e) { /* empty */ } } - if ('get' in Attributes || 'set' in Attributes) { throw TypeError('Accessors not supported!'); } - if ('value' in Attributes) { O[P] = Attributes.value; } - return O; - }; - - var _objectDp = { - f: f - }; - - var _propertyDesc = function (bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value: value - }; - }; - - var _hide = _descriptors ? function (object, key, value) { - return _objectDp.f(object, key, _propertyDesc(1, value)); - } : function (object, key, value) { - object[key] = value; - return object; - }; - - var hasOwnProperty = {}.hasOwnProperty; - var _has = function (it, key) { - return hasOwnProperty.call(it, key); - }; - - var id = 0; - var px = Math.random(); - var _uid = function (key) { - return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); - }; - - var _redefine = createCommonjsModule(function (module) { - var SRC = _uid('src'); - var TO_STRING = 'toString'; - var $toString = Function[TO_STRING]; - var TPL = ('' + $toString).split(TO_STRING); - - _core.inspectSource = function (it) { - return $toString.call(it); - }; - - (module.exports = function (O, key, val, safe) { - var isFunction = typeof val == 'function'; - if (isFunction) { _has(val, 'name') || _hide(val, 'name', key); } - if (O[key] === val) { return; } - if (isFunction) { _has(val, SRC) || _hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); } - if (O === _global) { - O[key] = val; - } else if (!safe) { - delete O[key]; - _hide(O, key, val); - } else if (O[key]) { - O[key] = val; - } else { - _hide(O, key, val); - } - // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative - })(Function.prototype, TO_STRING, function toString() { - return typeof this == 'function' && this[SRC] || $toString.call(this); - }); - }); - - var _aFunction = function (it) { - if (typeof it != 'function') { throw TypeError(it + ' is not a function!'); } - return it; - }; - - // optional / simple context binding - - var _ctx = function (fn, that, length) { - _aFunction(fn); - if (that === undefined) { return fn; } - switch (length) { - case 1: return function (a) { - return fn.call(that, a); - }; - case 2: return function (a, b) { - return fn.call(that, a, b); - }; - case 3: return function (a, b, c) { - return fn.call(that, a, b, c); - }; - } - return function (/* ...args */) { - return fn.apply(that, arguments); - }; - }; - - var PROTOTYPE = 'prototype'; - - var $export = function (type, name, source) { - var IS_FORCED = type & $export.F; - var IS_GLOBAL = type & $export.G; - var IS_STATIC = type & $export.S; - var IS_PROTO = type & $export.P; - var IS_BIND = type & $export.B; - var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] || (_global[name] = {}) : (_global[name] || {})[PROTOTYPE]; - var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {}); - var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); - var key, own, out, exp; - if (IS_GLOBAL) { source = name; } - for (key in source) { - // contains in native - own = !IS_FORCED && target && target[key] !== undefined; - // export native or passed - out = (own ? target : source)[key]; - // bind timers to global for call from export context - exp = IS_BIND && own ? _ctx(out, _global) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out; - // extend global - if (target) { _redefine(target, key, out, type & $export.U); } - // export - if (exports[key] != out) { _hide(exports, key, exp); } - if (IS_PROTO && expProto[key] != out) { expProto[key] = out; } - } - }; - _global.core = _core; - // type bitmap - $export.F = 1; // forced - $export.G = 2; // global - $export.S = 4; // static - $export.P = 8; // proto - $export.B = 16; // bind - $export.W = 32; // wrap - $export.U = 64; // safe - $export.R = 128; // real proto method for `library` - var _export = $export; - - // 7.1.4 ToInteger - var ceil = Math.ceil; - var floor = Math.floor; - var _toInteger = function (it) { - return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); - }; - - // 7.2.1 RequireObjectCoercible(argument) - var _defined = function (it) { - if (it == undefined) { throw TypeError("Can't call method on " + it); } - return it; - }; - - // true -> String#at - // false -> String#codePointAt - var _stringAt = function (TO_STRING) { - return function (that, pos) { - var s = String(_defined(that)); - var i = _toInteger(pos); - var l = s.length; - var a, b; - if (i < 0 || i >= l) { return TO_STRING ? '' : undefined; } - a = s.charCodeAt(i); - return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff - ? TO_STRING ? s.charAt(i) : a - : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; - }; - }; - - var $at = _stringAt(false); - _export(_export.P, 'String', { - // 21.1.3.3 String.prototype.codePointAt(pos) - codePointAt: function codePointAt(pos) { - return $at(this, pos); - } - }); - - var codePointAt = _core.String.codePointAt; - - var max = Math.max; - var min = Math.min; - var _toAbsoluteIndex = function (index, length) { - index = _toInteger(index); - return index < 0 ? max(index + length, 0) : min(index, length); - }; - - var fromCharCode = String.fromCharCode; - var $fromCodePoint = String.fromCodePoint; - - // length should be 1, old FF problem - _export(_export.S + _export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { - // 21.1.2.2 String.fromCodePoint(...codePoints) - fromCodePoint: function fromCodePoint(x) { - var arguments$1 = arguments; - // eslint-disable-line no-unused-vars - var res = []; - var aLen = arguments.length; - var i = 0; - var code; - while (aLen > i) { - code = +arguments$1[i++]; - if (_toAbsoluteIndex(code, 0x10ffff) !== code) { throw RangeError(code + ' is not a valid code point'); } - res.push(code < 0x10000 - ? fromCharCode(code) - : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) - ); - } return res.join(''); - } - }); - - var fromCodePoint = _core.String.fromCodePoint; - - // This is a generated file. Do not edit. - var Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/; - var ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/; - var ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/; - - var unicode = { - Space_Separator: Space_Separator, - ID_Start: ID_Start, - ID_Continue: ID_Continue - }; - - var util = { - isSpaceSeparator: function isSpaceSeparator (c) { - return unicode.Space_Separator.test(c) - }, - - isIdStartChar: function isIdStartChar (c) { - return ( - (c >= 'a' && c <= 'z') || - (c >= 'A' && c <= 'Z') || - (c === '$') || (c === '_') || - unicode.ID_Start.test(c) - ) - }, - - isIdContinueChar: function isIdContinueChar (c) { - return ( - (c >= 'a' && c <= 'z') || - (c >= 'A' && c <= 'Z') || - (c >= '0' && c <= '9') || - (c === '$') || (c === '_') || - (c === '\u200C') || (c === '\u200D') || - unicode.ID_Continue.test(c) - ) - }, - - isDigit: function isDigit (c) { - return /[0-9]/.test(c) - }, - - isHexDigit: function isHexDigit (c) { - return /[0-9A-Fa-f]/.test(c) - }, - }; - - var source; - var parseState; - var stack; - var pos; - var line; - var column; - var token; - var key; - var root; - - var parse = function parse (text, reviver) { - source = String(text); - parseState = 'start'; - stack = []; - pos = 0; - line = 1; - column = 0; - token = undefined; - key = undefined; - root = undefined; - - do { - token = lex(); - - // This code is unreachable. - // if (!parseStates[parseState]) { - // throw invalidParseState() - // } - - parseStates[parseState](); - } while (token.type !== 'eof') - - if (typeof reviver === 'function') { - return internalize({'': root}, '', reviver) - } - - return root - }; - - function internalize (holder, name, reviver) { - var value = holder[name]; - if (value != null && typeof value === 'object') { - for (var key in value) { - var replacement = internalize(value, key, reviver); - if (replacement === undefined) { - delete value[key]; - } else { - value[key] = replacement; - } - } - } - - return reviver.call(holder, name, value) - } - - var lexState; - var buffer; - var doubleQuote; - var sign; - var c; - - function lex () { - lexState = 'default'; - buffer = ''; - doubleQuote = false; - sign = 1; - - for (;;) { - c = peek(); - - // This code is unreachable. - // if (!lexStates[lexState]) { - // throw invalidLexState(lexState) - // } - - var token = lexStates[lexState](); - if (token) { - return token - } - } - } - - function peek () { - if (source[pos]) { - return String.fromCodePoint(source.codePointAt(pos)) - } - } - - function read () { - var c = peek(); - - if (c === '\n') { - line++; - column = 0; - } else if (c) { - column += c.length; - } else { - column++; - } - - if (c) { - pos += c.length; - } - - return c - } - - var lexStates = { - default: function default$1 () { - switch (c) { - case '\t': - case '\v': - case '\f': - case ' ': - case '\u00A0': - case '\uFEFF': - case '\n': - case '\r': - case '\u2028': - case '\u2029': - read(); - return - - case '/': - read(); - lexState = 'comment'; - return - - case undefined: - read(); - return newToken('eof') - } - - if (util.isSpaceSeparator(c)) { - read(); - return - } - - // This code is unreachable. - // if (!lexStates[parseState]) { - // throw invalidLexState(parseState) - // } - - return lexStates[parseState]() - }, - - comment: function comment () { - switch (c) { - case '*': - read(); - lexState = 'multiLineComment'; - return - - case '/': - read(); - lexState = 'singleLineComment'; - return - } - - throw invalidChar(read()) - }, - - multiLineComment: function multiLineComment () { - switch (c) { - case '*': - read(); - lexState = 'multiLineCommentAsterisk'; - return - - case undefined: - throw invalidChar(read()) - } - - read(); - }, - - multiLineCommentAsterisk: function multiLineCommentAsterisk () { - switch (c) { - case '*': - read(); - return - - case '/': - read(); - lexState = 'default'; - return - - case undefined: - throw invalidChar(read()) - } - - read(); - lexState = 'multiLineComment'; - }, - - singleLineComment: function singleLineComment () { - switch (c) { - case '\n': - case '\r': - case '\u2028': - case '\u2029': - read(); - lexState = 'default'; - return - - case undefined: - read(); - return newToken('eof') - } - - read(); - }, - - value: function value () { - switch (c) { - case '{': - case '[': - return newToken('punctuator', read()) - - case 'n': - read(); - literal('ull'); - return newToken('null', null) - - case 't': - read(); - literal('rue'); - return newToken('boolean', true) - - case 'f': - read(); - literal('alse'); - return newToken('boolean', false) - - case '-': - case '+': - if (read() === '-') { - sign = -1; - } - - lexState = 'sign'; - return - - case '.': - buffer = read(); - lexState = 'decimalPointLeading'; - return - - case '0': - buffer = read(); - lexState = 'zero'; - return - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - buffer = read(); - lexState = 'decimalInteger'; - return - - case 'I': - read(); - literal('nfinity'); - return newToken('numeric', Infinity) - - case 'N': - read(); - literal('aN'); - return newToken('numeric', NaN) - - case '"': - case "'": - doubleQuote = (read() === '"'); - buffer = ''; - lexState = 'string'; - return - } - - throw invalidChar(read()) - }, - - identifierNameStartEscape: function identifierNameStartEscape () { - if (c !== 'u') { - throw invalidChar(read()) - } - - read(); - var u = unicodeEscape(); - switch (u) { - case '$': - case '_': - break - - default: - if (!util.isIdStartChar(u)) { - throw invalidIdentifier() - } - - break - } - - buffer += u; - lexState = 'identifierName'; - }, - - identifierName: function identifierName () { - switch (c) { - case '$': - case '_': - case '\u200C': - case '\u200D': - buffer += read(); - return - - case '\\': - read(); - lexState = 'identifierNameEscape'; - return - } - - if (util.isIdContinueChar(c)) { - buffer += read(); - return - } - - return newToken('identifier', buffer) - }, - - identifierNameEscape: function identifierNameEscape () { - if (c !== 'u') { - throw invalidChar(read()) - } - - read(); - var u = unicodeEscape(); - switch (u) { - case '$': - case '_': - case '\u200C': - case '\u200D': - break - - default: - if (!util.isIdContinueChar(u)) { - throw invalidIdentifier() - } - - break - } - - buffer += u; - lexState = 'identifierName'; - }, - - sign: function sign$1 () { - switch (c) { - case '.': - buffer = read(); - lexState = 'decimalPointLeading'; - return - - case '0': - buffer = read(); - lexState = 'zero'; - return - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - buffer = read(); - lexState = 'decimalInteger'; - return - - case 'I': - read(); - literal('nfinity'); - return newToken('numeric', sign * Infinity) - - case 'N': - read(); - literal('aN'); - return newToken('numeric', NaN) - } - - throw invalidChar(read()) - }, - - zero: function zero () { - switch (c) { - case '.': - buffer += read(); - lexState = 'decimalPoint'; - return - - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - - case 'x': - case 'X': - buffer += read(); - lexState = 'hexadecimal'; - return - } - - return newToken('numeric', sign * 0) - }, - - decimalInteger: function decimalInteger () { - switch (c) { - case '.': - buffer += read(); - lexState = 'decimalPoint'; - return - - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalPointLeading: function decimalPointLeading () { - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalFraction'; - return - } - - throw invalidChar(read()) - }, - - decimalPoint: function decimalPoint () { - switch (c) { - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalFraction'; - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalFraction: function decimalFraction () { - switch (c) { - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalExponent: function decimalExponent () { - switch (c) { - case '+': - case '-': - buffer += read(); - lexState = 'decimalExponentSign'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalExponentInteger'; - return - } - - throw invalidChar(read()) - }, - - decimalExponentSign: function decimalExponentSign () { - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalExponentInteger'; - return - } - - throw invalidChar(read()) - }, - - decimalExponentInteger: function decimalExponentInteger () { - if (util.isDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - hexadecimal: function hexadecimal () { - if (util.isHexDigit(c)) { - buffer += read(); - lexState = 'hexadecimalInteger'; - return - } - - throw invalidChar(read()) - }, - - hexadecimalInteger: function hexadecimalInteger () { - if (util.isHexDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - string: function string () { - switch (c) { - case '\\': - read(); - buffer += escape(); - return - - case '"': - if (doubleQuote) { - read(); - return newToken('string', buffer) - } - - buffer += read(); - return - - case "'": - if (!doubleQuote) { - read(); - return newToken('string', buffer) - } - - buffer += read(); - return - - case '\n': - case '\r': - throw invalidChar(read()) - - case '\u2028': - case '\u2029': - separatorChar(c); - break - - case undefined: - throw invalidChar(read()) - } - - buffer += read(); - }, - - start: function start () { - switch (c) { - case '{': - case '[': - return newToken('punctuator', read()) - - // This code is unreachable since the default lexState handles eof. - // case undefined: - // return newToken('eof') - } - - lexState = 'value'; - }, - - beforePropertyName: function beforePropertyName () { - switch (c) { - case '$': - case '_': - buffer = read(); - lexState = 'identifierName'; - return - - case '\\': - read(); - lexState = 'identifierNameStartEscape'; - return - - case '}': - return newToken('punctuator', read()) - - case '"': - case "'": - doubleQuote = (read() === '"'); - lexState = 'string'; - return - } - - if (util.isIdStartChar(c)) { - buffer += read(); - lexState = 'identifierName'; - return - } - - throw invalidChar(read()) - }, - - afterPropertyName: function afterPropertyName () { - if (c === ':') { - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - beforePropertyValue: function beforePropertyValue () { - lexState = 'value'; - }, - - afterPropertyValue: function afterPropertyValue () { - switch (c) { - case ',': - case '}': - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - beforeArrayValue: function beforeArrayValue () { - if (c === ']') { - return newToken('punctuator', read()) - } - - lexState = 'value'; - }, - - afterArrayValue: function afterArrayValue () { - switch (c) { - case ',': - case ']': - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - end: function end () { - // This code is unreachable since it's handled by the default lexState. - // if (c === undefined) { - // read() - // return newToken('eof') - // } - - throw invalidChar(read()) - }, - }; - - function newToken (type, value) { - return { - type: type, - value: value, - line: line, - column: column, - } - } - - function literal (s) { - for (var i = 0, list = s; i < list.length; i += 1) { - var c = list[i]; - - var p = peek(); - - if (p !== c) { - throw invalidChar(read()) - } - - read(); - } - } - - function escape () { - var c = peek(); - switch (c) { - case 'b': - read(); - return '\b' - - case 'f': - read(); - return '\f' - - case 'n': - read(); - return '\n' - - case 'r': - read(); - return '\r' - - case 't': - read(); - return '\t' - - case 'v': - read(); - return '\v' - - case '0': - read(); - if (util.isDigit(peek())) { - throw invalidChar(read()) - } - - return '\0' - - case 'x': - read(); - return hexEscape() - - case 'u': - read(); - return unicodeEscape() - - case '\n': - case '\u2028': - case '\u2029': - read(); - return '' - - case '\r': - read(); - if (peek() === '\n') { - read(); - } - - return '' - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - throw invalidChar(read()) - - case undefined: - throw invalidChar(read()) - } - - return read() - } - - function hexEscape () { - var buffer = ''; - var c = peek(); - - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read(); - - c = peek(); - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read(); - - return String.fromCodePoint(parseInt(buffer, 16)) - } - - function unicodeEscape () { - var buffer = ''; - var count = 4; - - while (count-- > 0) { - var c = peek(); - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read(); - } - - return String.fromCodePoint(parseInt(buffer, 16)) - } - - var parseStates = { - start: function start () { - if (token.type === 'eof') { - throw invalidEOF() - } - - push(); - }, - - beforePropertyName: function beforePropertyName () { - switch (token.type) { - case 'identifier': - case 'string': - key = token.value; - parseState = 'afterPropertyName'; - return - - case 'punctuator': - // This code is unreachable since it's handled by the lexState. - // if (token.value !== '}') { - // throw invalidToken() - // } - - pop(); - return - - case 'eof': - throw invalidEOF() - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - afterPropertyName: function afterPropertyName () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator' || token.value !== ':') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - parseState = 'beforePropertyValue'; - }, - - beforePropertyValue: function beforePropertyValue () { - if (token.type === 'eof') { - throw invalidEOF() - } - - push(); - }, - - beforeArrayValue: function beforeArrayValue () { - if (token.type === 'eof') { - throw invalidEOF() - } - - if (token.type === 'punctuator' && token.value === ']') { - pop(); - return - } - - push(); - }, - - afterPropertyValue: function afterPropertyValue () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - switch (token.value) { - case ',': - parseState = 'beforePropertyName'; - return - - case '}': - pop(); - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - afterArrayValue: function afterArrayValue () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - switch (token.value) { - case ',': - parseState = 'beforeArrayValue'; - return - - case ']': - pop(); - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - end: function end () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'eof') { - // throw invalidToken() - // } - }, - }; - - function push () { - var value; - - switch (token.type) { - case 'punctuator': - switch (token.value) { - case '{': - value = {}; - break - - case '[': - value = []; - break - } - - break - - case 'null': - case 'boolean': - case 'numeric': - case 'string': - value = token.value; - break - - // This code is unreachable. - // default: - // throw invalidToken() - } - - if (root === undefined) { - root = value; - } else { - var parent = stack[stack.length - 1]; - if (Array.isArray(parent)) { - parent.push(value); - } else { - parent[key] = value; - } - } - - if (value !== null && typeof value === 'object') { - stack.push(value); - - if (Array.isArray(value)) { - parseState = 'beforeArrayValue'; - } else { - parseState = 'beforePropertyName'; - } - } else { - var current = stack[stack.length - 1]; - if (current == null) { - parseState = 'end'; - } else if (Array.isArray(current)) { - parseState = 'afterArrayValue'; - } else { - parseState = 'afterPropertyValue'; - } - } - } - - function pop () { - stack.pop(); - - var current = stack[stack.length - 1]; - if (current == null) { - parseState = 'end'; - } else if (Array.isArray(current)) { - parseState = 'afterArrayValue'; - } else { - parseState = 'afterPropertyValue'; - } - } - - // This code is unreachable. - // function invalidParseState () { - // return new Error(`JSON5: invalid parse state '${parseState}'`) - // } - - // This code is unreachable. - // function invalidLexState (state) { - // return new Error(`JSON5: invalid lex state '${state}'`) - // } - - function invalidChar (c) { - if (c === undefined) { - return syntaxError(("JSON5: invalid end of input at " + line + ":" + column)) - } - - return syntaxError(("JSON5: invalid character '" + (formatChar(c)) + "' at " + line + ":" + column)) - } - - function invalidEOF () { - return syntaxError(("JSON5: invalid end of input at " + line + ":" + column)) - } - - // This code is unreachable. - // function invalidToken () { - // if (token.type === 'eof') { - // return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) - // } - - // const c = String.fromCodePoint(token.value.codePointAt(0)) - // return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) - // } - - function invalidIdentifier () { - column -= 5; - return syntaxError(("JSON5: invalid identifier character at " + line + ":" + column)) - } - - function separatorChar (c) { - console.warn(("JSON5: '" + (formatChar(c)) + "' in strings is not valid ECMAScript; consider escaping")); - } - - function formatChar (c) { - var replacements = { - "'": "\\'", - '"': '\\"', - '\\': '\\\\', - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t', - '\v': '\\v', - '\0': '\\0', - '\u2028': '\\u2028', - '\u2029': '\\u2029', - }; - - if (replacements[c]) { - return replacements[c] - } - - if (c < ' ') { - var hexString = c.charCodeAt(0).toString(16); - return '\\x' + ('00' + hexString).substring(hexString.length) - } - - return c - } - - function syntaxError (message) { - var err = new SyntaxError(message); - err.lineNumber = line; - err.columnNumber = column; - return err - } - - var stringify = function stringify (value, replacer, space) { - var stack = []; - var indent = ''; - var propertyList; - var replacerFunc; - var gap = ''; - var quote; - - if ( - replacer != null && - typeof replacer === 'object' && - !Array.isArray(replacer) - ) { - space = replacer.space; - quote = replacer.quote; - replacer = replacer.replacer; - } - - if (typeof replacer === 'function') { - replacerFunc = replacer; - } else if (Array.isArray(replacer)) { - propertyList = []; - for (var i = 0, list = replacer; i < list.length; i += 1) { - var v = list[i]; - - var item = (void 0); - - if (typeof v === 'string') { - item = v; - } else if ( - typeof v === 'number' || - v instanceof String || - v instanceof Number - ) { - item = String(v); - } - - if (item !== undefined && propertyList.indexOf(item) < 0) { - propertyList.push(item); - } - } - } - - if (space instanceof Number) { - space = Number(space); - } else if (space instanceof String) { - space = String(space); - } - - if (typeof space === 'number') { - if (space > 0) { - space = Math.min(10, Math.floor(space)); - gap = ' '.substr(0, space); - } - } else if (typeof space === 'string') { - gap = space.substr(0, 10); - } - - return serializeProperty('', {'': value}) - - function serializeProperty (key, holder) { - var value = holder[key]; - if (value != null) { - if (typeof value.toJSON5 === 'function') { - value = value.toJSON5(key); - } else if (typeof value.toJSON === 'function') { - value = value.toJSON(key); - } - } - - if (replacerFunc) { - value = replacerFunc.call(holder, key, value); - } - - if (value instanceof Number) { - value = Number(value); - } else if (value instanceof String) { - value = String(value); - } else if (value instanceof Boolean) { - value = value.valueOf(); - } - - switch (value) { - case null: return 'null' - case true: return 'true' - case false: return 'false' - } - - if (typeof value === 'string') { - return quoteString(value, false) - } - - if (typeof value === 'number') { - return String(value) - } - - if (typeof value === 'object') { - return Array.isArray(value) ? serializeArray(value) : serializeObject(value) - } - - return undefined - } - - function quoteString (value) { - var quotes = { - "'": 0.1, - '"': 0.2, - }; - - var replacements = { - "'": "\\'", - '"': '\\"', - '\\': '\\\\', - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t', - '\v': '\\v', - '\0': '\\0', - '\u2028': '\\u2028', - '\u2029': '\\u2029', - }; - - var product = ''; - - for (var i = 0, list = value; i < list.length; i += 1) { - var c = list[i]; - - switch (c) { - case "'": - case '"': - quotes[c]++; - product += c; - continue - } - - if (replacements[c]) { - product += replacements[c]; - continue - } - - if (c < ' ') { - var hexString = c.charCodeAt(0).toString(16); - product += '\\x' + ('00' + hexString).substring(hexString.length); - continue - } - - product += c; - } - - var quoteChar = quote || Object.keys(quotes).reduce(function (a, b) { return (quotes[a] < quotes[b]) ? a : b; }); - - product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]); - - return quoteChar + product + quoteChar - } - - function serializeObject (value) { - if (stack.indexOf(value) >= 0) { - throw TypeError('Converting circular structure to JSON5') - } - - stack.push(value); - - var stepback = indent; - indent = indent + gap; - - var keys = propertyList || Object.keys(value); - var partial = []; - for (var i = 0, list = keys; i < list.length; i += 1) { - var key = list[i]; - - var propertyString = serializeProperty(key, value); - if (propertyString !== undefined) { - var member = serializeKey(key) + ':'; - if (gap !== '') { - member += ' '; - } - member += propertyString; - partial.push(member); - } - } - - var final; - if (partial.length === 0) { - final = '{}'; - } else { - var properties; - if (gap === '') { - properties = partial.join(','); - final = '{' + properties + '}'; - } else { - var separator = ',\n' + indent; - properties = partial.join(separator); - final = '{\n' + indent + properties + ',\n' + stepback + '}'; - } - } - - stack.pop(); - indent = stepback; - return final - } - - function serializeKey (key) { - if (key.length === 0) { - return quoteString(key, true) - } - - var firstChar = String.fromCodePoint(key.codePointAt(0)); - if (!util.isIdStartChar(firstChar)) { - return quoteString(key, true) - } - - for (var i = firstChar.length; i < key.length; i++) { - if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) { - return quoteString(key, true) - } - } - - return key - } - - function serializeArray (value) { - if (stack.indexOf(value) >= 0) { - throw TypeError('Converting circular structure to JSON5') - } - - stack.push(value); - - var stepback = indent; - indent = indent + gap; - - var partial = []; - for (var i = 0; i < value.length; i++) { - var propertyString = serializeProperty(String(i), value); - partial.push((propertyString !== undefined) ? propertyString : 'null'); - } - - var final; - if (partial.length === 0) { - final = '[]'; - } else { - if (gap === '') { - var properties = partial.join(','); - final = '[' + properties + ']'; - } else { - var separator = ',\n' + indent; - var properties$1 = partial.join(separator); - final = '[\n' + indent + properties$1 + ',\n' + stepback + ']'; - } - } - - stack.pop(); - indent = stepback; - return final - } - }; - - var JSON5 = { - parse: parse, - stringify: stringify, - }; - - var lib = JSON5; - - var es5 = lib; - - return es5; - -}))); diff --git a/lib/json5/v2.1.0/dist/index.min.js b/lib/json5/v2.1.0/dist/index.min.js deleted file mode 100644 index b336aba..0000000 --- a/lib/json5/v2.1.0/dist/index.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(u,D){"object"==typeof exports&&"undefined"!=typeof module?module.exports=D():"function"==typeof define&&define.amd?define(D):u.JSON5=D()}(this,function(){"use strict";function u(u,D){return u(D={exports:{}},D.exports),D.exports}var D=u(function(u){var D=u.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=D)}),e=u(function(u){var D=u.exports={version:"2.5.7"};"number"==typeof __e&&(__e=D)}),t=(e.version,function(u){return"object"==typeof u?null!==u:"function"==typeof u}),r=function(u){if(!t(u))throw TypeError(u+" is not an object!");return u},F=function(u){try{return!!u()}catch(u){return!0}},n=!F(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),C=D.document,A=t(C)&&t(C.createElement),E=!n&&!F(function(){return 7!=Object.defineProperty((u="div",A?C.createElement(u):{}),"a",{get:function(){return 7}}).a;var u}),i=Object.defineProperty,o={f:n?Object.defineProperty:function(u,D,e){if(r(u),D=function(u,D){if(!t(u))return u;var e,r;if(D&&"function"==typeof(e=u.toString)&&!t(r=e.call(u)))return r;if("function"==typeof(e=u.valueOf)&&!t(r=e.call(u)))return r;if(!D&&"function"==typeof(e=u.toString)&&!t(r=e.call(u)))return r;throw TypeError("Can't convert object to primitive value")}(D,!0),r(e),E)try{return i(u,D,e)}catch(u){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(u[D]=e.value),u}},a=n?function(u,D,e){return o.f(u,D,function(u,D){return{enumerable:!(1&u),configurable:!(2&u),writable:!(4&u),value:D}}(1,e))}:function(u,D,e){return u[D]=e,u},c={}.hasOwnProperty,B=function(u,D){return c.call(u,D)},s=0,f=Math.random(),l=u(function(u){var t,r="Symbol(".concat(void 0===(t="src")?"":t,")_",(++s+f).toString(36)),F=Function.toString,n=(""+F).split("toString");e.inspectSource=function(u){return F.call(u)},(u.exports=function(u,e,t,F){var C="function"==typeof t;C&&(B(t,"name")||a(t,"name",e)),u[e]!==t&&(C&&(B(t,r)||a(t,r,u[e]?""+u[e]:n.join(String(e)))),u===D?u[e]=t:F?u[e]?u[e]=t:a(u,e,t):(delete u[e],a(u,e,t)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[r]||F.call(this)})}),d=function(u,D,e){if(function(u){if("function"!=typeof u)throw TypeError(u+" is not a function!")}(u),void 0===D)return u;switch(e){case 1:return function(e){return u.call(D,e)};case 2:return function(e,t){return u.call(D,e,t)};case 3:return function(e,t,r){return u.call(D,e,t,r)}}return function(){return u.apply(D,arguments)}},v=function(u,t,r){var F,n,C,A,E=u&v.F,i=u&v.G,o=u&v.S,c=u&v.P,B=u&v.B,s=i?D:o?D[t]||(D[t]={}):(D[t]||{}).prototype,f=i?e:e[t]||(e[t]={}),p=f.prototype||(f.prototype={});for(F in i&&(r=t),r)C=((n=!E&&s&&void 0!==s[F])?s:r)[F],A=B&&n?d(C,D):c&&"function"==typeof C?d(Function.call,C):C,s&&l(s,F,C,u&v.U),f[F]!=C&&a(f,F,A),c&&p[F]!=C&&(p[F]=C)};D.core=e,v.F=1,v.G=2,v.S=4,v.P=8,v.B=16,v.W=32,v.U=64,v.R=128;var p,h=v,m=Math.ceil,g=Math.floor,y=function(u){return isNaN(u=+u)?0:(u>0?g:m)(u)},w=(p=!1,function(u,D){var e,t,r=String(function(u){if(null==u)throw TypeError("Can't call method on "+u);return u}(u)),F=y(D),n=r.length;return F<0||F>=n?p?"":void 0:(e=r.charCodeAt(F))<55296||e>56319||F+1===n||(t=r.charCodeAt(F+1))<56320||t>57343?p?r.charAt(F):e:p?r.slice(F,F+2):t-56320+(e-55296<<10)+65536});h(h.P,"String",{codePointAt:function(u){return w(this,u)}});e.String.codePointAt;var S=Math.max,b=Math.min,x=String.fromCharCode,N=String.fromCodePoint;h(h.S+h.F*(!!N&&1!=N.length),"String",{fromCodePoint:function(u){for(var D,e,t,r=arguments,F=[],n=arguments.length,C=0;n>C;){if(D=+r[C++],t=1114111,((e=y(e=D))<0?S(e+t,0):b(e,t))!==D)throw RangeError(D+" is not a valid code point");F.push(D<65536?x(D):x(55296+((D-=65536)>>10),D%1024+56320))}return F.join("")}});e.String.fromCodePoint;var P,I,O,_,j,V,J,M,L,k,T,H,$,z,R={Space_Separator:/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},G={isSpaceSeparator:function(u){return R.Space_Separator.test(u)},isIdStartChar:function(u){return u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||R.ID_Start.test(u)},isIdContinueChar:function(u){return u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||R.ID_Continue.test(u)},isDigit:function(u){return/[0-9]/.test(u)},isHexDigit:function(u){return/[0-9A-Fa-f]/.test(u)}};function U(){for(k="default",T="",H=!1,$=1;;){z=Z();var u=W[k]();if(u)return u}}function Z(){if(P[_])return String.fromCodePoint(P.codePointAt(_))}function q(){var u=Z();return"\n"===u?(j++,V=0):u?V+=u.length:V++,u&&(_+=u.length),u}var W={default:function(){switch(z){case"\t":case"\v":case"\f":case" ":case" ":case"\ufeff":case"\n":case"\r":case"\u2028":case"\u2029":return void q();case"/":return q(),void(k="comment");case void 0:return q(),X("eof")}if(!G.isSpaceSeparator(z))return W[I]();q()},comment:function(){switch(z){case"*":return q(),void(k="multiLineComment");case"/":return q(),void(k="singleLineComment")}throw eu(q())},multiLineComment:function(){switch(z){case"*":return q(),void(k="multiLineCommentAsterisk");case void 0:throw eu(q())}q()},multiLineCommentAsterisk:function(){switch(z){case"*":return void q();case"/":return q(),void(k="default");case void 0:throw eu(q())}q(),k="multiLineComment"},singleLineComment:function(){switch(z){case"\n":case"\r":case"\u2028":case"\u2029":return q(),void(k="default");case void 0:return q(),X("eof")}q()},value:function(){switch(z){case"{":case"[":return X("punctuator",q());case"n":return q(),K("ull"),X("null",null);case"t":return q(),K("rue"),X("boolean",!0);case"f":return q(),K("alse"),X("boolean",!1);case"-":case"+":return"-"===q()&&($=-1),void(k="sign");case".":return T=q(),void(k="decimalPointLeading");case"0":return T=q(),void(k="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return T=q(),void(k="decimalInteger");case"I":return q(),K("nfinity"),X("numeric",1/0);case"N":return q(),K("aN"),X("numeric",NaN);case'"':case"'":return H='"'===q(),T="",void(k="string")}throw eu(q())},identifierNameStartEscape:function(){if("u"!==z)throw eu(q());q();var u=Q();switch(u){case"$":case"_":break;default:if(!G.isIdStartChar(u))throw ru()}T+=u,k="identifierName"},identifierName:function(){switch(z){case"$":case"_":case"‌":case"‍":return void(T+=q());case"\\":return q(),void(k="identifierNameEscape")}if(!G.isIdContinueChar(z))return X("identifier",T);T+=q()},identifierNameEscape:function(){if("u"!==z)throw eu(q());q();var u=Q();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!G.isIdContinueChar(u))throw ru()}T+=u,k="identifierName"},sign:function(){switch(z){case".":return T=q(),void(k="decimalPointLeading");case"0":return T=q(),void(k="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return T=q(),void(k="decimalInteger");case"I":return q(),K("nfinity"),X("numeric",$*(1/0));case"N":return q(),K("aN"),X("numeric",NaN)}throw eu(q())},zero:function(){switch(z){case".":return T+=q(),void(k="decimalPoint");case"e":case"E":return T+=q(),void(k="decimalExponent");case"x":case"X":return T+=q(),void(k="hexadecimal")}return X("numeric",0*$)},decimalInteger:function(){switch(z){case".":return T+=q(),void(k="decimalPoint");case"e":case"E":return T+=q(),void(k="decimalExponent")}if(!G.isDigit(z))return X("numeric",$*Number(T));T+=q()},decimalPointLeading:function(){if(G.isDigit(z))return T+=q(),void(k="decimalFraction");throw eu(q())},decimalPoint:function(){switch(z){case"e":case"E":return T+=q(),void(k="decimalExponent")}return G.isDigit(z)?(T+=q(),void(k="decimalFraction")):X("numeric",$*Number(T))},decimalFraction:function(){switch(z){case"e":case"E":return T+=q(),void(k="decimalExponent")}if(!G.isDigit(z))return X("numeric",$*Number(T));T+=q()},decimalExponent:function(){switch(z){case"+":case"-":return T+=q(),void(k="decimalExponentSign")}if(G.isDigit(z))return T+=q(),void(k="decimalExponentInteger");throw eu(q())},decimalExponentSign:function(){if(G.isDigit(z))return T+=q(),void(k="decimalExponentInteger");throw eu(q())},decimalExponentInteger:function(){if(!G.isDigit(z))return X("numeric",$*Number(T));T+=q()},hexadecimal:function(){if(G.isHexDigit(z))return T+=q(),void(k="hexadecimalInteger");throw eu(q())},hexadecimalInteger:function(){if(!G.isHexDigit(z))return X("numeric",$*Number(T));T+=q()},string:function(){switch(z){case"\\":return q(),void(T+=function(){switch(Z()){case"b":return q(),"\b";case"f":return q(),"\f";case"n":return q(),"\n";case"r":return q(),"\r";case"t":return q(),"\t";case"v":return q(),"\v";case"0":if(q(),G.isDigit(Z()))throw eu(q());return"\0";case"x":return q(),function(){var u="",D=Z();if(!G.isHexDigit(D))throw eu(q());if(u+=q(),D=Z(),!G.isHexDigit(D))throw eu(q());return u+=q(),String.fromCodePoint(parseInt(u,16))}();case"u":return q(),Q();case"\n":case"\u2028":case"\u2029":return q(),"";case"\r":return q(),"\n"===Z()&&q(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case void 0:throw eu(q())}return q()}());case'"':return H?(q(),X("string",T)):void(T+=q());case"'":return H?void(T+=q()):(q(),X("string",T));case"\n":case"\r":throw eu(q());case"\u2028":case"\u2029":!function(u){console.warn("JSON5: '"+Fu(u)+"' in strings is not valid ECMAScript; consider escaping")}(z);break;case void 0:throw eu(q())}T+=q()},start:function(){switch(z){case"{":case"[":return X("punctuator",q())}k="value"},beforePropertyName:function(){switch(z){case"$":case"_":return T=q(),void(k="identifierName");case"\\":return q(),void(k="identifierNameStartEscape");case"}":return X("punctuator",q());case'"':case"'":return H='"'===q(),void(k="string")}if(G.isIdStartChar(z))return T+=q(),void(k="identifierName");throw eu(q())},afterPropertyName:function(){if(":"===z)return X("punctuator",q());throw eu(q())},beforePropertyValue:function(){k="value"},afterPropertyValue:function(){switch(z){case",":case"}":return X("punctuator",q())}throw eu(q())},beforeArrayValue:function(){if("]"===z)return X("punctuator",q());k="value"},afterArrayValue:function(){switch(z){case",":case"]":return X("punctuator",q())}throw eu(q())},end:function(){throw eu(q())}};function X(u,D){return{type:u,value:D,line:j,column:V}}function K(u){for(var D=0,e=u;D0;){var e=Z();if(!G.isHexDigit(e))throw eu(q());u+=q()}return String.fromCodePoint(parseInt(u,16))}var Y={start:function(){if("eof"===J.type)throw tu();uu()},beforePropertyName:function(){switch(J.type){case"identifier":case"string":return M=J.value,void(I="afterPropertyName");case"punctuator":return void Du();case"eof":throw tu()}},afterPropertyName:function(){if("eof"===J.type)throw tu();I="beforePropertyValue"},beforePropertyValue:function(){if("eof"===J.type)throw tu();uu()},beforeArrayValue:function(){if("eof"===J.type)throw tu();"punctuator"!==J.type||"]"!==J.value?uu():Du()},afterPropertyValue:function(){if("eof"===J.type)throw tu();switch(J.value){case",":return void(I="beforePropertyName");case"}":Du()}},afterArrayValue:function(){if("eof"===J.type)throw tu();switch(J.value){case",":return void(I="beforeArrayValue");case"]":Du()}},end:function(){}};function uu(){var u;switch(J.type){case"punctuator":switch(J.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=J.value}if(void 0===L)L=u;else{var D=O[O.length-1];Array.isArray(D)?D.push(u):D[M]=u}if(null!==u&&"object"==typeof u)O.push(u),I=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{var e=O[O.length-1];I=null==e?"end":Array.isArray(e)?"afterArrayValue":"afterPropertyValue"}}function Du(){O.pop();var u=O[O.length-1];I=null==u?"end":Array.isArray(u)?"afterArrayValue":"afterPropertyValue"}function eu(u){return nu(void 0===u?"JSON5: invalid end of input at "+j+":"+V:"JSON5: invalid character '"+Fu(u)+"' at "+j+":"+V)}function tu(){return nu("JSON5: invalid end of input at "+j+":"+V)}function ru(){return nu("JSON5: invalid identifier character at "+j+":"+(V-=5))}function Fu(u){var D={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(D[u])return D[u];if(u<" "){var e=u.charCodeAt(0).toString(16);return"\\x"+("00"+e).substring(e.length)}return u}function nu(u){var D=new SyntaxError(u);return D.lineNumber=j,D.columnNumber=V,D}return{parse:function(u,D){P=String(u),I="start",O=[],_=0,j=1,V=0,J=void 0,M=void 0,L=void 0;do{J=U(),Y[I]()}while("eof"!==J.type);return"function"==typeof D?function u(D,e,t){var r=D[e];if(null!=r&&"object"==typeof r)for(var F in r){var n=u(r,F,t);void 0===n?delete r[F]:r[F]=n}return t.call(D,e,r)}({"":L},"",D):L},stringify:function(u,D,e){var t,r,F,n=[],C="",A="";if(null==D||"object"!=typeof D||Array.isArray(D)||(e=D.space,F=D.quote,D=D.replacer),"function"==typeof D)r=D;else if(Array.isArray(D)){t=[];for(var E=0,i=D;E0&&(e=Math.min(10,Math.floor(e)),A=" ".substr(0,e)):"string"==typeof e&&(A=e.substr(0,10)),c("",{"":u});function c(u,D){var e=D[u];switch(null!=e&&("function"==typeof e.toJSON5?e=e.toJSON5(u):"function"==typeof e.toJSON&&(e=e.toJSON(u))),r&&(e=r.call(D,u,e)),e instanceof Number?e=Number(e):e instanceof String?e=String(e):e instanceof Boolean&&(e=e.valueOf()),e){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof e?B(e):"number"==typeof e?String(e):"object"==typeof e?Array.isArray(e)?function(u){if(n.indexOf(u)>=0)throw TypeError("Converting circular structure to JSON5");n.push(u);var D=C;C+=A;for(var e,t=[],r=0;r=0)throw TypeError("Converting circular structure to JSON5");n.push(u);var D=C;C+=A;for(var e,r,F=t||Object.keys(u),E=[],i=0,o=F;iunicode.Space_Separator.test(u),isIdStartChar:u=>u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||unicode.ID_Start.test(u),isIdContinueChar:u=>u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||unicode.ID_Continue.test(u),isDigit:u=>/[0-9]/.test(u),isHexDigit:u=>/[0-9A-Fa-f]/.test(u)};let source,parseState,stack,pos,line,column,token,key,root;var parse=function(u,D){source=String(u),parseState="start",stack=[],pos=0,line=1,column=0,token=void 0,key=void 0,root=void 0;do{token=lex(),parseStates[parseState]()}while("eof"!==token.type);return"function"==typeof D?internalize({"":root},"",D):root};function internalize(u,D,e){const r=u[D];if(null!=r&&"object"==typeof r)for(const u in r){const D=internalize(r,u,e);void 0===D?delete r[u]:r[u]=D}return e.call(u,D,r)}let lexState,buffer,doubleQuote,sign,c;function lex(){for(lexState="default",buffer="",doubleQuote=!1,sign=1;;){c=peek();const u=lexStates[lexState]();if(u)return u}}function peek(){if(source[pos])return String.fromCodePoint(source.codePointAt(pos))}function read(){const u=peek();return"\n"===u?(line++,column=0):u?column+=u.length:column++,u&&(pos+=u.length),u}const lexStates={default(){switch(c){case"\t":case"\v":case"\f":case" ":case" ":case"\ufeff":case"\n":case"\r":case"\u2028":case"\u2029":return void read();case"/":return read(),void(lexState="comment");case void 0:return read(),newToken("eof")}if(!util.isSpaceSeparator(c))return lexStates[parseState]();read()},comment(){switch(c){case"*":return read(),void(lexState="multiLineComment");case"/":return read(),void(lexState="singleLineComment")}throw invalidChar(read())},multiLineComment(){switch(c){case"*":return read(),void(lexState="multiLineCommentAsterisk");case void 0:throw invalidChar(read())}read()},multiLineCommentAsterisk(){switch(c){case"*":return void read();case"/":return read(),void(lexState="default");case void 0:throw invalidChar(read())}read(),lexState="multiLineComment"},singleLineComment(){switch(c){case"\n":case"\r":case"\u2028":case"\u2029":return read(),void(lexState="default");case void 0:return read(),newToken("eof")}read()},value(){switch(c){case"{":case"[":return newToken("punctuator",read());case"n":return read(),literal("ull"),newToken("null",null);case"t":return read(),literal("rue"),newToken("boolean",!0);case"f":return read(),literal("alse"),newToken("boolean",!1);case"-":case"+":return"-"===read()&&(sign=-1),void(lexState="sign");case".":return buffer=read(),void(lexState="decimalPointLeading");case"0":return buffer=read(),void(lexState="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return buffer=read(),void(lexState="decimalInteger");case"I":return read(),literal("nfinity"),newToken("numeric",1/0);case"N":return read(),literal("aN"),newToken("numeric",NaN);case'"':case"'":return doubleQuote='"'===read(),buffer="",void(lexState="string")}throw invalidChar(read())},identifierNameStartEscape(){if("u"!==c)throw invalidChar(read());read();const u=unicodeEscape();switch(u){case"$":case"_":break;default:if(!util.isIdStartChar(u))throw invalidIdentifier()}buffer+=u,lexState="identifierName"},identifierName(){switch(c){case"$":case"_":case"‌":case"‍":return void(buffer+=read());case"\\":return read(),void(lexState="identifierNameEscape")}if(!util.isIdContinueChar(c))return newToken("identifier",buffer);buffer+=read()},identifierNameEscape(){if("u"!==c)throw invalidChar(read());read();const u=unicodeEscape();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!util.isIdContinueChar(u))throw invalidIdentifier()}buffer+=u,lexState="identifierName"},sign(){switch(c){case".":return buffer=read(),void(lexState="decimalPointLeading");case"0":return buffer=read(),void(lexState="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return buffer=read(),void(lexState="decimalInteger");case"I":return read(),literal("nfinity"),newToken("numeric",sign*(1/0));case"N":return read(),literal("aN"),newToken("numeric",NaN)}throw invalidChar(read())},zero(){switch(c){case".":return buffer+=read(),void(lexState="decimalPoint");case"e":case"E":return buffer+=read(),void(lexState="decimalExponent");case"x":case"X":return buffer+=read(),void(lexState="hexadecimal")}return newToken("numeric",0*sign)},decimalInteger(){switch(c){case".":return buffer+=read(),void(lexState="decimalPoint");case"e":case"E":return buffer+=read(),void(lexState="decimalExponent")}if(!util.isDigit(c))return newToken("numeric",sign*Number(buffer));buffer+=read()},decimalPointLeading(){if(util.isDigit(c))return buffer+=read(),void(lexState="decimalFraction");throw invalidChar(read())},decimalPoint(){switch(c){case"e":case"E":return buffer+=read(),void(lexState="decimalExponent")}return util.isDigit(c)?(buffer+=read(),void(lexState="decimalFraction")):newToken("numeric",sign*Number(buffer))},decimalFraction(){switch(c){case"e":case"E":return buffer+=read(),void(lexState="decimalExponent")}if(!util.isDigit(c))return newToken("numeric",sign*Number(buffer));buffer+=read()},decimalExponent(){switch(c){case"+":case"-":return buffer+=read(),void(lexState="decimalExponentSign")}if(util.isDigit(c))return buffer+=read(),void(lexState="decimalExponentInteger");throw invalidChar(read())},decimalExponentSign(){if(util.isDigit(c))return buffer+=read(),void(lexState="decimalExponentInteger");throw invalidChar(read())},decimalExponentInteger(){if(!util.isDigit(c))return newToken("numeric",sign*Number(buffer));buffer+=read()},hexadecimal(){if(util.isHexDigit(c))return buffer+=read(),void(lexState="hexadecimalInteger");throw invalidChar(read())},hexadecimalInteger(){if(!util.isHexDigit(c))return newToken("numeric",sign*Number(buffer));buffer+=read()},string(){switch(c){case"\\":return read(),void(buffer+=escape());case'"':return doubleQuote?(read(),newToken("string",buffer)):void(buffer+=read());case"'":return doubleQuote?void(buffer+=read()):(read(),newToken("string",buffer));case"\n":case"\r":throw invalidChar(read());case"\u2028":case"\u2029":separatorChar(c);break;case void 0:throw invalidChar(read())}buffer+=read()},start(){switch(c){case"{":case"[":return newToken("punctuator",read())}lexState="value"},beforePropertyName(){switch(c){case"$":case"_":return buffer=read(),void(lexState="identifierName");case"\\":return read(),void(lexState="identifierNameStartEscape");case"}":return newToken("punctuator",read());case'"':case"'":return doubleQuote='"'===read(),void(lexState="string")}if(util.isIdStartChar(c))return buffer+=read(),void(lexState="identifierName");throw invalidChar(read())},afterPropertyName(){if(":"===c)return newToken("punctuator",read());throw invalidChar(read())},beforePropertyValue(){lexState="value"},afterPropertyValue(){switch(c){case",":case"}":return newToken("punctuator",read())}throw invalidChar(read())},beforeArrayValue(){if("]"===c)return newToken("punctuator",read());lexState="value"},afterArrayValue(){switch(c){case",":case"]":return newToken("punctuator",read())}throw invalidChar(read())},end(){throw invalidChar(read())}};function newToken(u,D){return{type:u,value:D,line:line,column:column}}function literal(u){for(const D of u){if(peek()!==D)throw invalidChar(read());read()}}function escape(){switch(peek()){case"b":return read(),"\b";case"f":return read(),"\f";case"n":return read(),"\n";case"r":return read(),"\r";case"t":return read(),"\t";case"v":return read(),"\v";case"0":if(read(),util.isDigit(peek()))throw invalidChar(read());return"\0";case"x":return read(),hexEscape();case"u":return read(),unicodeEscape();case"\n":case"\u2028":case"\u2029":return read(),"";case"\r":return read(),"\n"===peek()&&read(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case void 0:throw invalidChar(read())}return read()}function hexEscape(){let u="",D=peek();if(!util.isHexDigit(D))throw invalidChar(read());if(u+=read(),D=peek(),!util.isHexDigit(D))throw invalidChar(read());return u+=read(),String.fromCodePoint(parseInt(u,16))}function unicodeEscape(){let u="",D=4;for(;D-- >0;){const D=peek();if(!util.isHexDigit(D))throw invalidChar(read());u+=read()}return String.fromCodePoint(parseInt(u,16))}const parseStates={start(){if("eof"===token.type)throw invalidEOF();push()},beforePropertyName(){switch(token.type){case"identifier":case"string":return key=token.value,void(parseState="afterPropertyName");case"punctuator":return void pop();case"eof":throw invalidEOF()}},afterPropertyName(){if("eof"===token.type)throw invalidEOF();parseState="beforePropertyValue"},beforePropertyValue(){if("eof"===token.type)throw invalidEOF();push()},beforeArrayValue(){if("eof"===token.type)throw invalidEOF();"punctuator"!==token.type||"]"!==token.value?push():pop()},afterPropertyValue(){if("eof"===token.type)throw invalidEOF();switch(token.value){case",":return void(parseState="beforePropertyName");case"}":pop()}},afterArrayValue(){if("eof"===token.type)throw invalidEOF();switch(token.value){case",":return void(parseState="beforeArrayValue");case"]":pop()}},end(){}};function push(){let u;switch(token.type){case"punctuator":switch(token.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=token.value}if(void 0===root)root=u;else{const D=stack[stack.length-1];Array.isArray(D)?D.push(u):D[key]=u}if(null!==u&&"object"==typeof u)stack.push(u),parseState=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=stack[stack.length-1];parseState=null==u?"end":Array.isArray(u)?"afterArrayValue":"afterPropertyValue"}}function pop(){stack.pop();const u=stack[stack.length-1];parseState=null==u?"end":Array.isArray(u)?"afterArrayValue":"afterPropertyValue"}function invalidChar(u){return syntaxError(void 0===u?`JSON5: invalid end of input at ${line}:${column}`:`JSON5: invalid character '${formatChar(u)}' at ${line}:${column}`)}function invalidEOF(){return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)}function invalidIdentifier(){return syntaxError(`JSON5: invalid identifier character at ${line}:${column-=5}`)}function separatorChar(u){console.warn(`JSON5: '${formatChar(u)}' in strings is not valid ECMAScript; consider escaping`)}function formatChar(u){const D={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(D[u])return D[u];if(u<" "){const D=u.charCodeAt(0).toString(16);return"\\x"+("00"+D).substring(D.length)}return u}function syntaxError(u){const D=new SyntaxError(u);return D.lineNumber=line,D.columnNumber=column,D}var stringify=function(u,D,e){const r=[];let t,F,C,a="",A="";if(null==D||"object"!=typeof D||Array.isArray(D)||(e=D.space,C=D.quote,D=D.replacer),"function"==typeof D)F=D;else if(Array.isArray(D)){t=[];for(const u of D){let D;"string"==typeof u?D=u:("number"==typeof u||u instanceof String||u instanceof Number)&&(D=String(u)),void 0!==D&&t.indexOf(D)<0&&t.push(D)}}return e instanceof Number?e=Number(e):e instanceof String&&(e=String(e)),"number"==typeof e?e>0&&(e=Math.min(10,Math.floor(e)),A=" ".substr(0,e)):"string"==typeof e&&(A=e.substr(0,10)),E("",{"":u});function E(u,D){let e=D[u];switch(null!=e&&("function"==typeof e.toJSON5?e=e.toJSON5(u):"function"==typeof e.toJSON&&(e=e.toJSON(u))),F&&(e=F.call(D,u,e)),e instanceof Number?e=Number(e):e instanceof String?e=String(e):e instanceof Boolean&&(e=e.valueOf()),e){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof e?n(e):"number"==typeof e?String(e):"object"==typeof e?Array.isArray(e)?function(u){if(r.indexOf(u)>=0)throw TypeError("Converting circular structure to JSON5");r.push(u);let D=a;a+=A;let e,t=[];for(let D=0;D=0)throw TypeError("Converting circular structure to JSON5");r.push(u);let D=a;a+=A;let e,F=t||Object.keys(u),C=[];for(const D of F){const e=E(D,u);if(void 0!==e){let u=i(D)+":";""!==A&&(u+=" "),u+=e,C.push(u)}}if(0===C.length)e="{}";else{let u;if(""===A)u=C.join(","),e="{"+u+"}";else{let r=",\n"+a;u=C.join(r),e="{\n"+a+u+",\n"+D+"}"}}return r.pop(),a=D,e}(e):void 0}function n(u){const D={"'":.1,'"':.2},e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let r="";for(const t of u){switch(t){case"'":case'"':D[t]++,r+=t;continue}if(e[t])r+=e[t];else if(t<" "){let u=t.charCodeAt(0).toString(16);r+="\\x"+("00"+u).substring(u.length)}else r+=t}const t=C||Object.keys(D).reduce((u,e)=>D[u]= 'a' && c <= 'z') || - (c >= 'A' && c <= 'Z') || - (c === '$') || (c === '_') || - unicode.ID_Start.test(c) - ) - }, - - isIdContinueChar (c) { - return ( - (c >= 'a' && c <= 'z') || - (c >= 'A' && c <= 'Z') || - (c >= '0' && c <= '9') || - (c === '$') || (c === '_') || - (c === '\u200C') || (c === '\u200D') || - unicode.ID_Continue.test(c) - ) - }, - - isDigit (c) { - return /[0-9]/.test(c) - }, - - isHexDigit (c) { - return /[0-9A-Fa-f]/.test(c) - }, -}; - -let source; -let parseState; -let stack; -let pos; -let line; -let column; -let token; -let key; -let root; - -var parse = function parse (text, reviver) { - source = String(text); - parseState = 'start'; - stack = []; - pos = 0; - line = 1; - column = 0; - token = undefined; - key = undefined; - root = undefined; - - do { - token = lex(); - - // This code is unreachable. - // if (!parseStates[parseState]) { - // throw invalidParseState() - // } - - parseStates[parseState](); - } while (token.type !== 'eof') - - if (typeof reviver === 'function') { - return internalize({'': root}, '', reviver) - } - - return root -}; - -function internalize (holder, name, reviver) { - const value = holder[name]; - if (value != null && typeof value === 'object') { - for (const key in value) { - const replacement = internalize(value, key, reviver); - if (replacement === undefined) { - delete value[key]; - } else { - value[key] = replacement; - } - } - } - - return reviver.call(holder, name, value) -} - -let lexState; -let buffer; -let doubleQuote; -let sign; -let c; - -function lex () { - lexState = 'default'; - buffer = ''; - doubleQuote = false; - sign = 1; - - for (;;) { - c = peek(); - - // This code is unreachable. - // if (!lexStates[lexState]) { - // throw invalidLexState(lexState) - // } - - const token = lexStates[lexState](); - if (token) { - return token - } - } -} - -function peek () { - if (source[pos]) { - return String.fromCodePoint(source.codePointAt(pos)) - } -} - -function read () { - const c = peek(); - - if (c === '\n') { - line++; - column = 0; - } else if (c) { - column += c.length; - } else { - column++; - } - - if (c) { - pos += c.length; - } - - return c -} - -const lexStates = { - default () { - switch (c) { - case '\t': - case '\v': - case '\f': - case ' ': - case '\u00A0': - case '\uFEFF': - case '\n': - case '\r': - case '\u2028': - case '\u2029': - read(); - return - - case '/': - read(); - lexState = 'comment'; - return - - case undefined: - read(); - return newToken('eof') - } - - if (util.isSpaceSeparator(c)) { - read(); - return - } - - // This code is unreachable. - // if (!lexStates[parseState]) { - // throw invalidLexState(parseState) - // } - - return lexStates[parseState]() - }, - - comment () { - switch (c) { - case '*': - read(); - lexState = 'multiLineComment'; - return - - case '/': - read(); - lexState = 'singleLineComment'; - return - } - - throw invalidChar(read()) - }, - - multiLineComment () { - switch (c) { - case '*': - read(); - lexState = 'multiLineCommentAsterisk'; - return - - case undefined: - throw invalidChar(read()) - } - - read(); - }, - - multiLineCommentAsterisk () { - switch (c) { - case '*': - read(); - return - - case '/': - read(); - lexState = 'default'; - return - - case undefined: - throw invalidChar(read()) - } - - read(); - lexState = 'multiLineComment'; - }, - - singleLineComment () { - switch (c) { - case '\n': - case '\r': - case '\u2028': - case '\u2029': - read(); - lexState = 'default'; - return - - case undefined: - read(); - return newToken('eof') - } - - read(); - }, - - value () { - switch (c) { - case '{': - case '[': - return newToken('punctuator', read()) - - case 'n': - read(); - literal('ull'); - return newToken('null', null) - - case 't': - read(); - literal('rue'); - return newToken('boolean', true) - - case 'f': - read(); - literal('alse'); - return newToken('boolean', false) - - case '-': - case '+': - if (read() === '-') { - sign = -1; - } - - lexState = 'sign'; - return - - case '.': - buffer = read(); - lexState = 'decimalPointLeading'; - return - - case '0': - buffer = read(); - lexState = 'zero'; - return - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - buffer = read(); - lexState = 'decimalInteger'; - return - - case 'I': - read(); - literal('nfinity'); - return newToken('numeric', Infinity) - - case 'N': - read(); - literal('aN'); - return newToken('numeric', NaN) - - case '"': - case "'": - doubleQuote = (read() === '"'); - buffer = ''; - lexState = 'string'; - return - } - - throw invalidChar(read()) - }, - - identifierNameStartEscape () { - if (c !== 'u') { - throw invalidChar(read()) - } - - read(); - const u = unicodeEscape(); - switch (u) { - case '$': - case '_': - break - - default: - if (!util.isIdStartChar(u)) { - throw invalidIdentifier() - } - - break - } - - buffer += u; - lexState = 'identifierName'; - }, - - identifierName () { - switch (c) { - case '$': - case '_': - case '\u200C': - case '\u200D': - buffer += read(); - return - - case '\\': - read(); - lexState = 'identifierNameEscape'; - return - } - - if (util.isIdContinueChar(c)) { - buffer += read(); - return - } - - return newToken('identifier', buffer) - }, - - identifierNameEscape () { - if (c !== 'u') { - throw invalidChar(read()) - } - - read(); - const u = unicodeEscape(); - switch (u) { - case '$': - case '_': - case '\u200C': - case '\u200D': - break - - default: - if (!util.isIdContinueChar(u)) { - throw invalidIdentifier() - } - - break - } - - buffer += u; - lexState = 'identifierName'; - }, - - sign () { - switch (c) { - case '.': - buffer = read(); - lexState = 'decimalPointLeading'; - return - - case '0': - buffer = read(); - lexState = 'zero'; - return - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - buffer = read(); - lexState = 'decimalInteger'; - return - - case 'I': - read(); - literal('nfinity'); - return newToken('numeric', sign * Infinity) - - case 'N': - read(); - literal('aN'); - return newToken('numeric', NaN) - } - - throw invalidChar(read()) - }, - - zero () { - switch (c) { - case '.': - buffer += read(); - lexState = 'decimalPoint'; - return - - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - - case 'x': - case 'X': - buffer += read(); - lexState = 'hexadecimal'; - return - } - - return newToken('numeric', sign * 0) - }, - - decimalInteger () { - switch (c) { - case '.': - buffer += read(); - lexState = 'decimalPoint'; - return - - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalPointLeading () { - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalFraction'; - return - } - - throw invalidChar(read()) - }, - - decimalPoint () { - switch (c) { - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalFraction'; - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalFraction () { - switch (c) { - case 'e': - case 'E': - buffer += read(); - lexState = 'decimalExponent'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalExponent () { - switch (c) { - case '+': - case '-': - buffer += read(); - lexState = 'decimalExponentSign'; - return - } - - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalExponentInteger'; - return - } - - throw invalidChar(read()) - }, - - decimalExponentSign () { - if (util.isDigit(c)) { - buffer += read(); - lexState = 'decimalExponentInteger'; - return - } - - throw invalidChar(read()) - }, - - decimalExponentInteger () { - if (util.isDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - hexadecimal () { - if (util.isHexDigit(c)) { - buffer += read(); - lexState = 'hexadecimalInteger'; - return - } - - throw invalidChar(read()) - }, - - hexadecimalInteger () { - if (util.isHexDigit(c)) { - buffer += read(); - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - string () { - switch (c) { - case '\\': - read(); - buffer += escape(); - return - - case '"': - if (doubleQuote) { - read(); - return newToken('string', buffer) - } - - buffer += read(); - return - - case "'": - if (!doubleQuote) { - read(); - return newToken('string', buffer) - } - - buffer += read(); - return - - case '\n': - case '\r': - throw invalidChar(read()) - - case '\u2028': - case '\u2029': - separatorChar(c); - break - - case undefined: - throw invalidChar(read()) - } - - buffer += read(); - }, - - start () { - switch (c) { - case '{': - case '[': - return newToken('punctuator', read()) - - // This code is unreachable since the default lexState handles eof. - // case undefined: - // return newToken('eof') - } - - lexState = 'value'; - }, - - beforePropertyName () { - switch (c) { - case '$': - case '_': - buffer = read(); - lexState = 'identifierName'; - return - - case '\\': - read(); - lexState = 'identifierNameStartEscape'; - return - - case '}': - return newToken('punctuator', read()) - - case '"': - case "'": - doubleQuote = (read() === '"'); - lexState = 'string'; - return - } - - if (util.isIdStartChar(c)) { - buffer += read(); - lexState = 'identifierName'; - return - } - - throw invalidChar(read()) - }, - - afterPropertyName () { - if (c === ':') { - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - beforePropertyValue () { - lexState = 'value'; - }, - - afterPropertyValue () { - switch (c) { - case ',': - case '}': - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - beforeArrayValue () { - if (c === ']') { - return newToken('punctuator', read()) - } - - lexState = 'value'; - }, - - afterArrayValue () { - switch (c) { - case ',': - case ']': - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - end () { - // This code is unreachable since it's handled by the default lexState. - // if (c === undefined) { - // read() - // return newToken('eof') - // } - - throw invalidChar(read()) - }, -}; - -function newToken (type, value) { - return { - type, - value, - line, - column, - } -} - -function literal (s) { - for (const c of s) { - const p = peek(); - - if (p !== c) { - throw invalidChar(read()) - } - - read(); - } -} - -function escape () { - const c = peek(); - switch (c) { - case 'b': - read(); - return '\b' - - case 'f': - read(); - return '\f' - - case 'n': - read(); - return '\n' - - case 'r': - read(); - return '\r' - - case 't': - read(); - return '\t' - - case 'v': - read(); - return '\v' - - case '0': - read(); - if (util.isDigit(peek())) { - throw invalidChar(read()) - } - - return '\0' - - case 'x': - read(); - return hexEscape() - - case 'u': - read(); - return unicodeEscape() - - case '\n': - case '\u2028': - case '\u2029': - read(); - return '' - - case '\r': - read(); - if (peek() === '\n') { - read(); - } - - return '' - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - throw invalidChar(read()) - - case undefined: - throw invalidChar(read()) - } - - return read() -} - -function hexEscape () { - let buffer = ''; - let c = peek(); - - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read(); - - c = peek(); - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read(); - - return String.fromCodePoint(parseInt(buffer, 16)) -} - -function unicodeEscape () { - let buffer = ''; - let count = 4; - - while (count-- > 0) { - const c = peek(); - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read(); - } - - return String.fromCodePoint(parseInt(buffer, 16)) -} - -const parseStates = { - start () { - if (token.type === 'eof') { - throw invalidEOF() - } - - push(); - }, - - beforePropertyName () { - switch (token.type) { - case 'identifier': - case 'string': - key = token.value; - parseState = 'afterPropertyName'; - return - - case 'punctuator': - // This code is unreachable since it's handled by the lexState. - // if (token.value !== '}') { - // throw invalidToken() - // } - - pop(); - return - - case 'eof': - throw invalidEOF() - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - afterPropertyName () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator' || token.value !== ':') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - parseState = 'beforePropertyValue'; - }, - - beforePropertyValue () { - if (token.type === 'eof') { - throw invalidEOF() - } - - push(); - }, - - beforeArrayValue () { - if (token.type === 'eof') { - throw invalidEOF() - } - - if (token.type === 'punctuator' && token.value === ']') { - pop(); - return - } - - push(); - }, - - afterPropertyValue () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - switch (token.value) { - case ',': - parseState = 'beforePropertyName'; - return - - case '}': - pop(); - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - afterArrayValue () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - switch (token.value) { - case ',': - parseState = 'beforeArrayValue'; - return - - case ']': - pop(); - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - end () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'eof') { - // throw invalidToken() - // } - }, -}; - -function push () { - let value; - - switch (token.type) { - case 'punctuator': - switch (token.value) { - case '{': - value = {}; - break - - case '[': - value = []; - break - } - - break - - case 'null': - case 'boolean': - case 'numeric': - case 'string': - value = token.value; - break - - // This code is unreachable. - // default: - // throw invalidToken() - } - - if (root === undefined) { - root = value; - } else { - const parent = stack[stack.length - 1]; - if (Array.isArray(parent)) { - parent.push(value); - } else { - parent[key] = value; - } - } - - if (value !== null && typeof value === 'object') { - stack.push(value); - - if (Array.isArray(value)) { - parseState = 'beforeArrayValue'; - } else { - parseState = 'beforePropertyName'; - } - } else { - const current = stack[stack.length - 1]; - if (current == null) { - parseState = 'end'; - } else if (Array.isArray(current)) { - parseState = 'afterArrayValue'; - } else { - parseState = 'afterPropertyValue'; - } - } -} - -function pop () { - stack.pop(); - - const current = stack[stack.length - 1]; - if (current == null) { - parseState = 'end'; - } else if (Array.isArray(current)) { - parseState = 'afterArrayValue'; - } else { - parseState = 'afterPropertyValue'; - } -} - -// This code is unreachable. -// function invalidParseState () { -// return new Error(`JSON5: invalid parse state '${parseState}'`) -// } - -// This code is unreachable. -// function invalidLexState (state) { -// return new Error(`JSON5: invalid lex state '${state}'`) -// } - -function invalidChar (c) { - if (c === undefined) { - return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) - } - - return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) -} - -function invalidEOF () { - return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) -} - -// This code is unreachable. -// function invalidToken () { -// if (token.type === 'eof') { -// return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) -// } - -// const c = String.fromCodePoint(token.value.codePointAt(0)) -// return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) -// } - -function invalidIdentifier () { - column -= 5; - return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`) -} - -function separatorChar (c) { - console.warn(`JSON5: '${formatChar(c)}' in strings is not valid ECMAScript; consider escaping`); -} - -function formatChar (c) { - const replacements = { - "'": "\\'", - '"': '\\"', - '\\': '\\\\', - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t', - '\v': '\\v', - '\0': '\\0', - '\u2028': '\\u2028', - '\u2029': '\\u2029', - }; - - if (replacements[c]) { - return replacements[c] - } - - if (c < ' ') { - const hexString = c.charCodeAt(0).toString(16); - return '\\x' + ('00' + hexString).substring(hexString.length) - } - - return c -} - -function syntaxError (message) { - const err = new SyntaxError(message); - err.lineNumber = line; - err.columnNumber = column; - return err -} - -var stringify = function stringify (value, replacer, space) { - const stack = []; - let indent = ''; - let propertyList; - let replacerFunc; - let gap = ''; - let quote; - - if ( - replacer != null && - typeof replacer === 'object' && - !Array.isArray(replacer) - ) { - space = replacer.space; - quote = replacer.quote; - replacer = replacer.replacer; - } - - if (typeof replacer === 'function') { - replacerFunc = replacer; - } else if (Array.isArray(replacer)) { - propertyList = []; - for (const v of replacer) { - let item; - - if (typeof v === 'string') { - item = v; - } else if ( - typeof v === 'number' || - v instanceof String || - v instanceof Number - ) { - item = String(v); - } - - if (item !== undefined && propertyList.indexOf(item) < 0) { - propertyList.push(item); - } - } - } - - if (space instanceof Number) { - space = Number(space); - } else if (space instanceof String) { - space = String(space); - } - - if (typeof space === 'number') { - if (space > 0) { - space = Math.min(10, Math.floor(space)); - gap = ' '.substr(0, space); - } - } else if (typeof space === 'string') { - gap = space.substr(0, 10); - } - - return serializeProperty('', {'': value}) - - function serializeProperty (key, holder) { - let value = holder[key]; - if (value != null) { - if (typeof value.toJSON5 === 'function') { - value = value.toJSON5(key); - } else if (typeof value.toJSON === 'function') { - value = value.toJSON(key); - } - } - - if (replacerFunc) { - value = replacerFunc.call(holder, key, value); - } - - if (value instanceof Number) { - value = Number(value); - } else if (value instanceof String) { - value = String(value); - } else if (value instanceof Boolean) { - value = value.valueOf(); - } - - switch (value) { - case null: return 'null' - case true: return 'true' - case false: return 'false' - } - - if (typeof value === 'string') { - return quoteString(value, false) - } - - if (typeof value === 'number') { - return String(value) - } - - if (typeof value === 'object') { - return Array.isArray(value) ? serializeArray(value) : serializeObject(value) - } - - return undefined - } - - function quoteString (value) { - const quotes = { - "'": 0.1, - '"': 0.2, - }; - - const replacements = { - "'": "\\'", - '"': '\\"', - '\\': '\\\\', - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t', - '\v': '\\v', - '\0': '\\0', - '\u2028': '\\u2028', - '\u2029': '\\u2029', - }; - - let product = ''; - - for (const c of value) { - switch (c) { - case "'": - case '"': - quotes[c]++; - product += c; - continue - } - - if (replacements[c]) { - product += replacements[c]; - continue - } - - if (c < ' ') { - let hexString = c.charCodeAt(0).toString(16); - product += '\\x' + ('00' + hexString).substring(hexString.length); - continue - } - - product += c; - } - - const quoteChar = quote || Object.keys(quotes).reduce((a, b) => (quotes[a] < quotes[b]) ? a : b); - - product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]); - - return quoteChar + product + quoteChar - } - - function serializeObject (value) { - if (stack.indexOf(value) >= 0) { - throw TypeError('Converting circular structure to JSON5') - } - - stack.push(value); - - let stepback = indent; - indent = indent + gap; - - let keys = propertyList || Object.keys(value); - let partial = []; - for (const key of keys) { - const propertyString = serializeProperty(key, value); - if (propertyString !== undefined) { - let member = serializeKey(key) + ':'; - if (gap !== '') { - member += ' '; - } - member += propertyString; - partial.push(member); - } - } - - let final; - if (partial.length === 0) { - final = '{}'; - } else { - let properties; - if (gap === '') { - properties = partial.join(','); - final = '{' + properties + '}'; - } else { - let separator = ',\n' + indent; - properties = partial.join(separator); - final = '{\n' + indent + properties + ',\n' + stepback + '}'; - } - } - - stack.pop(); - indent = stepback; - return final - } - - function serializeKey (key) { - if (key.length === 0) { - return quoteString(key, true) - } - - const firstChar = String.fromCodePoint(key.codePointAt(0)); - if (!util.isIdStartChar(firstChar)) { - return quoteString(key, true) - } - - for (let i = firstChar.length; i < key.length; i++) { - if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) { - return quoteString(key, true) - } - } - - return key - } - - function serializeArray (value) { - if (stack.indexOf(value) >= 0) { - throw TypeError('Converting circular structure to JSON5') - } - - stack.push(value); - - let stepback = indent; - indent = indent + gap; - - let partial = []; - for (let i = 0; i < value.length; i++) { - const propertyString = serializeProperty(String(i), value); - partial.push((propertyString !== undefined) ? propertyString : 'null'); - } - - let final; - if (partial.length === 0) { - final = '[]'; - } else { - if (gap === '') { - let properties = partial.join(','); - final = '[' + properties + ']'; - } else { - let separator = ',\n' + indent; - let properties = partial.join(separator); - final = '[\n' + indent + properties + ',\n' + stepback + ']'; - } - } - - stack.pop(); - indent = stepback; - return final - } -}; - -const JSON5 = { - parse, - stringify, -}; - -var lib = JSON5; - -export default lib; diff --git a/lib/json5/v2.1.0/lib/cli.js b/lib/json5/v2.1.0/lib/cli.js deleted file mode 100644 index de852f1..0000000 --- a/lib/json5/v2.1.0/lib/cli.js +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/env node - -const fs = require('fs') -const path = require('path') -const minimist = require('minimist') -const pkg = require('../package.json') -const JSON5 = require('./') - -const argv = minimist(process.argv.slice(2), { - alias: { - 'convert': 'c', - 'space': 's', - 'validate': 'v', - 'out-file': 'o', - 'version': 'V', - 'help': 'h', - }, - boolean: [ - 'convert', - 'validate', - 'version', - 'help', - ], - string: [ - 'space', - 'out-file', - ], -}) - -if (argv.version) { - version() -} else if (argv.help) { - usage() -} else { - const inFilename = argv._[0] - - let readStream - if (inFilename) { - readStream = fs.createReadStream(inFilename) - } else { - readStream = process.stdin - } - - let json5 = '' - readStream.on('data', data => { - json5 += data - }) - - readStream.on('end', () => { - let space - if (argv.space === 't' || argv.space === 'tab') { - space = '\t' - } else { - space = Number(argv.space) - } - - let value - try { - value = JSON5.parse(json5) - if (!argv.validate) { - const json = JSON.stringify(value, null, space) - - let writeStream - - // --convert is for backward compatibility with v0.5.1. If - // specified with and not --out-file, then a file with - // the same name but with a .json extension will be written. - if (argv.convert && inFilename && !argv.o) { - const parsedFilename = path.parse(inFilename) - const outFilename = path.format( - Object.assign( - parsedFilename, - {base: path.basename(parsedFilename.base, parsedFilename.ext) + '.json'} - ) - ) - - writeStream = fs.createWriteStream(outFilename) - } else if (argv.o) { - writeStream = fs.createWriteStream(argv.o) - } else { - writeStream = process.stdout - } - - writeStream.write(json) - } - } catch (err) { - console.error(err.message) - process.exit(1) - } - }) -} - -function version () { - console.log(pkg.version) -} - -function usage () { - console.log( - ` - Usage: json5 [options] - - If is not provided, then STDIN is used. - - Options: - - -s, --space The number of spaces to indent or 't' for tabs - -o, --out-file [file] Output to the specified file, otherwise STDOUT - -v, --validate Validate JSON5 but do not output JSON - -V, --version Output the version number - -h, --help Output usage information` - ) -} diff --git a/lib/json5/v2.1.0/lib/index.js b/lib/json5/v2.1.0/lib/index.js deleted file mode 100644 index 3679638..0000000 --- a/lib/json5/v2.1.0/lib/index.js +++ /dev/null @@ -1,9 +0,0 @@ -const parse = require('./parse') -const stringify = require('./stringify') - -const JSON5 = { - parse, - stringify, -} - -module.exports = JSON5 diff --git a/lib/json5/v2.1.0/lib/parse.js b/lib/json5/v2.1.0/lib/parse.js deleted file mode 100644 index c01646f..0000000 --- a/lib/json5/v2.1.0/lib/parse.js +++ /dev/null @@ -1,1087 +0,0 @@ -const util = require('./util') - -let source -let parseState -let stack -let pos -let line -let column -let token -let key -let root - -module.exports = function parse (text, reviver) { - source = String(text) - parseState = 'start' - stack = [] - pos = 0 - line = 1 - column = 0 - token = undefined - key = undefined - root = undefined - - do { - token = lex() - - // This code is unreachable. - // if (!parseStates[parseState]) { - // throw invalidParseState() - // } - - parseStates[parseState]() - } while (token.type !== 'eof') - - if (typeof reviver === 'function') { - return internalize({'': root}, '', reviver) - } - - return root -} - -function internalize (holder, name, reviver) { - const value = holder[name] - if (value != null && typeof value === 'object') { - for (const key in value) { - const replacement = internalize(value, key, reviver) - if (replacement === undefined) { - delete value[key] - } else { - value[key] = replacement - } - } - } - - return reviver.call(holder, name, value) -} - -let lexState -let buffer -let doubleQuote -let sign -let c - -function lex () { - lexState = 'default' - buffer = '' - doubleQuote = false - sign = 1 - - for (;;) { - c = peek() - - // This code is unreachable. - // if (!lexStates[lexState]) { - // throw invalidLexState(lexState) - // } - - const token = lexStates[lexState]() - if (token) { - return token - } - } -} - -function peek () { - if (source[pos]) { - return String.fromCodePoint(source.codePointAt(pos)) - } -} - -function read () { - const c = peek() - - if (c === '\n') { - line++ - column = 0 - } else if (c) { - column += c.length - } else { - column++ - } - - if (c) { - pos += c.length - } - - return c -} - -const lexStates = { - default () { - switch (c) { - case '\t': - case '\v': - case '\f': - case ' ': - case '\u00A0': - case '\uFEFF': - case '\n': - case '\r': - case '\u2028': - case '\u2029': - read() - return - - case '/': - read() - lexState = 'comment' - return - - case undefined: - read() - return newToken('eof') - } - - if (util.isSpaceSeparator(c)) { - read() - return - } - - // This code is unreachable. - // if (!lexStates[parseState]) { - // throw invalidLexState(parseState) - // } - - return lexStates[parseState]() - }, - - comment () { - switch (c) { - case '*': - read() - lexState = 'multiLineComment' - return - - case '/': - read() - lexState = 'singleLineComment' - return - } - - throw invalidChar(read()) - }, - - multiLineComment () { - switch (c) { - case '*': - read() - lexState = 'multiLineCommentAsterisk' - return - - case undefined: - throw invalidChar(read()) - } - - read() - }, - - multiLineCommentAsterisk () { - switch (c) { - case '*': - read() - return - - case '/': - read() - lexState = 'default' - return - - case undefined: - throw invalidChar(read()) - } - - read() - lexState = 'multiLineComment' - }, - - singleLineComment () { - switch (c) { - case '\n': - case '\r': - case '\u2028': - case '\u2029': - read() - lexState = 'default' - return - - case undefined: - read() - return newToken('eof') - } - - read() - }, - - value () { - switch (c) { - case '{': - case '[': - return newToken('punctuator', read()) - - case 'n': - read() - literal('ull') - return newToken('null', null) - - case 't': - read() - literal('rue') - return newToken('boolean', true) - - case 'f': - read() - literal('alse') - return newToken('boolean', false) - - case '-': - case '+': - if (read() === '-') { - sign = -1 - } - - lexState = 'sign' - return - - case '.': - buffer = read() - lexState = 'decimalPointLeading' - return - - case '0': - buffer = read() - lexState = 'zero' - return - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - buffer = read() - lexState = 'decimalInteger' - return - - case 'I': - read() - literal('nfinity') - return newToken('numeric', Infinity) - - case 'N': - read() - literal('aN') - return newToken('numeric', NaN) - - case '"': - case "'": - doubleQuote = (read() === '"') - buffer = '' - lexState = 'string' - return - } - - throw invalidChar(read()) - }, - - identifierNameStartEscape () { - if (c !== 'u') { - throw invalidChar(read()) - } - - read() - const u = unicodeEscape() - switch (u) { - case '$': - case '_': - break - - default: - if (!util.isIdStartChar(u)) { - throw invalidIdentifier() - } - - break - } - - buffer += u - lexState = 'identifierName' - }, - - identifierName () { - switch (c) { - case '$': - case '_': - case '\u200C': - case '\u200D': - buffer += read() - return - - case '\\': - read() - lexState = 'identifierNameEscape' - return - } - - if (util.isIdContinueChar(c)) { - buffer += read() - return - } - - return newToken('identifier', buffer) - }, - - identifierNameEscape () { - if (c !== 'u') { - throw invalidChar(read()) - } - - read() - const u = unicodeEscape() - switch (u) { - case '$': - case '_': - case '\u200C': - case '\u200D': - break - - default: - if (!util.isIdContinueChar(u)) { - throw invalidIdentifier() - } - - break - } - - buffer += u - lexState = 'identifierName' - }, - - sign () { - switch (c) { - case '.': - buffer = read() - lexState = 'decimalPointLeading' - return - - case '0': - buffer = read() - lexState = 'zero' - return - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - buffer = read() - lexState = 'decimalInteger' - return - - case 'I': - read() - literal('nfinity') - return newToken('numeric', sign * Infinity) - - case 'N': - read() - literal('aN') - return newToken('numeric', NaN) - } - - throw invalidChar(read()) - }, - - zero () { - switch (c) { - case '.': - buffer += read() - lexState = 'decimalPoint' - return - - case 'e': - case 'E': - buffer += read() - lexState = 'decimalExponent' - return - - case 'x': - case 'X': - buffer += read() - lexState = 'hexadecimal' - return - } - - return newToken('numeric', sign * 0) - }, - - decimalInteger () { - switch (c) { - case '.': - buffer += read() - lexState = 'decimalPoint' - return - - case 'e': - case 'E': - buffer += read() - lexState = 'decimalExponent' - return - } - - if (util.isDigit(c)) { - buffer += read() - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalPointLeading () { - if (util.isDigit(c)) { - buffer += read() - lexState = 'decimalFraction' - return - } - - throw invalidChar(read()) - }, - - decimalPoint () { - switch (c) { - case 'e': - case 'E': - buffer += read() - lexState = 'decimalExponent' - return - } - - if (util.isDigit(c)) { - buffer += read() - lexState = 'decimalFraction' - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalFraction () { - switch (c) { - case 'e': - case 'E': - buffer += read() - lexState = 'decimalExponent' - return - } - - if (util.isDigit(c)) { - buffer += read() - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - decimalExponent () { - switch (c) { - case '+': - case '-': - buffer += read() - lexState = 'decimalExponentSign' - return - } - - if (util.isDigit(c)) { - buffer += read() - lexState = 'decimalExponentInteger' - return - } - - throw invalidChar(read()) - }, - - decimalExponentSign () { - if (util.isDigit(c)) { - buffer += read() - lexState = 'decimalExponentInteger' - return - } - - throw invalidChar(read()) - }, - - decimalExponentInteger () { - if (util.isDigit(c)) { - buffer += read() - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - hexadecimal () { - if (util.isHexDigit(c)) { - buffer += read() - lexState = 'hexadecimalInteger' - return - } - - throw invalidChar(read()) - }, - - hexadecimalInteger () { - if (util.isHexDigit(c)) { - buffer += read() - return - } - - return newToken('numeric', sign * Number(buffer)) - }, - - string () { - switch (c) { - case '\\': - read() - buffer += escape() - return - - case '"': - if (doubleQuote) { - read() - return newToken('string', buffer) - } - - buffer += read() - return - - case "'": - if (!doubleQuote) { - read() - return newToken('string', buffer) - } - - buffer += read() - return - - case '\n': - case '\r': - throw invalidChar(read()) - - case '\u2028': - case '\u2029': - separatorChar(c) - break - - case undefined: - throw invalidChar(read()) - } - - buffer += read() - }, - - start () { - switch (c) { - case '{': - case '[': - return newToken('punctuator', read()) - - // This code is unreachable since the default lexState handles eof. - // case undefined: - // return newToken('eof') - } - - lexState = 'value' - }, - - beforePropertyName () { - switch (c) { - case '$': - case '_': - buffer = read() - lexState = 'identifierName' - return - - case '\\': - read() - lexState = 'identifierNameStartEscape' - return - - case '}': - return newToken('punctuator', read()) - - case '"': - case "'": - doubleQuote = (read() === '"') - lexState = 'string' - return - } - - if (util.isIdStartChar(c)) { - buffer += read() - lexState = 'identifierName' - return - } - - throw invalidChar(read()) - }, - - afterPropertyName () { - if (c === ':') { - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - beforePropertyValue () { - lexState = 'value' - }, - - afterPropertyValue () { - switch (c) { - case ',': - case '}': - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - beforeArrayValue () { - if (c === ']') { - return newToken('punctuator', read()) - } - - lexState = 'value' - }, - - afterArrayValue () { - switch (c) { - case ',': - case ']': - return newToken('punctuator', read()) - } - - throw invalidChar(read()) - }, - - end () { - // This code is unreachable since it's handled by the default lexState. - // if (c === undefined) { - // read() - // return newToken('eof') - // } - - throw invalidChar(read()) - }, -} - -function newToken (type, value) { - return { - type, - value, - line, - column, - } -} - -function literal (s) { - for (const c of s) { - const p = peek() - - if (p !== c) { - throw invalidChar(read()) - } - - read() - } -} - -function escape () { - const c = peek() - switch (c) { - case 'b': - read() - return '\b' - - case 'f': - read() - return '\f' - - case 'n': - read() - return '\n' - - case 'r': - read() - return '\r' - - case 't': - read() - return '\t' - - case 'v': - read() - return '\v' - - case '0': - read() - if (util.isDigit(peek())) { - throw invalidChar(read()) - } - - return '\0' - - case 'x': - read() - return hexEscape() - - case 'u': - read() - return unicodeEscape() - - case '\n': - case '\u2028': - case '\u2029': - read() - return '' - - case '\r': - read() - if (peek() === '\n') { - read() - } - - return '' - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - throw invalidChar(read()) - - case undefined: - throw invalidChar(read()) - } - - return read() -} - -function hexEscape () { - let buffer = '' - let c = peek() - - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read() - - c = peek() - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read() - - return String.fromCodePoint(parseInt(buffer, 16)) -} - -function unicodeEscape () { - let buffer = '' - let count = 4 - - while (count-- > 0) { - const c = peek() - if (!util.isHexDigit(c)) { - throw invalidChar(read()) - } - - buffer += read() - } - - return String.fromCodePoint(parseInt(buffer, 16)) -} - -const parseStates = { - start () { - if (token.type === 'eof') { - throw invalidEOF() - } - - push() - }, - - beforePropertyName () { - switch (token.type) { - case 'identifier': - case 'string': - key = token.value - parseState = 'afterPropertyName' - return - - case 'punctuator': - // This code is unreachable since it's handled by the lexState. - // if (token.value !== '}') { - // throw invalidToken() - // } - - pop() - return - - case 'eof': - throw invalidEOF() - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - afterPropertyName () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator' || token.value !== ':') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - parseState = 'beforePropertyValue' - }, - - beforePropertyValue () { - if (token.type === 'eof') { - throw invalidEOF() - } - - push() - }, - - beforeArrayValue () { - if (token.type === 'eof') { - throw invalidEOF() - } - - if (token.type === 'punctuator' && token.value === ']') { - pop() - return - } - - push() - }, - - afterPropertyValue () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - switch (token.value) { - case ',': - parseState = 'beforePropertyName' - return - - case '}': - pop() - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - afterArrayValue () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'punctuator') { - // throw invalidToken() - // } - - if (token.type === 'eof') { - throw invalidEOF() - } - - switch (token.value) { - case ',': - parseState = 'beforeArrayValue' - return - - case ']': - pop() - } - - // This code is unreachable since it's handled by the lexState. - // throw invalidToken() - }, - - end () { - // This code is unreachable since it's handled by the lexState. - // if (token.type !== 'eof') { - // throw invalidToken() - // } - }, -} - -function push () { - let value - - switch (token.type) { - case 'punctuator': - switch (token.value) { - case '{': - value = {} - break - - case '[': - value = [] - break - } - - break - - case 'null': - case 'boolean': - case 'numeric': - case 'string': - value = token.value - break - - // This code is unreachable. - // default: - // throw invalidToken() - } - - if (root === undefined) { - root = value - } else { - const parent = stack[stack.length - 1] - if (Array.isArray(parent)) { - parent.push(value) - } else { - parent[key] = value - } - } - - if (value !== null && typeof value === 'object') { - stack.push(value) - - if (Array.isArray(value)) { - parseState = 'beforeArrayValue' - } else { - parseState = 'beforePropertyName' - } - } else { - const current = stack[stack.length - 1] - if (current == null) { - parseState = 'end' - } else if (Array.isArray(current)) { - parseState = 'afterArrayValue' - } else { - parseState = 'afterPropertyValue' - } - } -} - -function pop () { - stack.pop() - - const current = stack[stack.length - 1] - if (current == null) { - parseState = 'end' - } else if (Array.isArray(current)) { - parseState = 'afterArrayValue' - } else { - parseState = 'afterPropertyValue' - } -} - -// This code is unreachable. -// function invalidParseState () { -// return new Error(`JSON5: invalid parse state '${parseState}'`) -// } - -// This code is unreachable. -// function invalidLexState (state) { -// return new Error(`JSON5: invalid lex state '${state}'`) -// } - -function invalidChar (c) { - if (c === undefined) { - return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) - } - - return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) -} - -function invalidEOF () { - return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) -} - -// This code is unreachable. -// function invalidToken () { -// if (token.type === 'eof') { -// return syntaxError(`JSON5: invalid end of input at ${line}:${column}`) -// } - -// const c = String.fromCodePoint(token.value.codePointAt(0)) -// return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`) -// } - -function invalidIdentifier () { - column -= 5 - return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`) -} - -function separatorChar (c) { - console.warn(`JSON5: '${formatChar(c)}' in strings is not valid ECMAScript; consider escaping`) -} - -function formatChar (c) { - const replacements = { - "'": "\\'", - '"': '\\"', - '\\': '\\\\', - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t', - '\v': '\\v', - '\0': '\\0', - '\u2028': '\\u2028', - '\u2029': '\\u2029', - } - - if (replacements[c]) { - return replacements[c] - } - - if (c < ' ') { - const hexString = c.charCodeAt(0).toString(16) - return '\\x' + ('00' + hexString).substring(hexString.length) - } - - return c -} - -function syntaxError (message) { - const err = new SyntaxError(message) - err.lineNumber = line - err.columnNumber = column - return err -} diff --git a/lib/json5/v2.1.0/lib/register.js b/lib/json5/v2.1.0/lib/register.js deleted file mode 100644 index 935cdba..0000000 --- a/lib/json5/v2.1.0/lib/register.js +++ /dev/null @@ -1,13 +0,0 @@ -const fs = require('fs') -const JSON5 = require('./') - -// eslint-disable-next-line node/no-deprecated-api -require.extensions['.json5'] = function (module, filename) { - const content = fs.readFileSync(filename, 'utf8') - try { - module.exports = JSON5.parse(content) - } catch (err) { - err.message = filename + ': ' + err.message - throw err - } -} diff --git a/lib/json5/v2.1.0/lib/require.js b/lib/json5/v2.1.0/lib/require.js deleted file mode 100644 index 3aa29be..0000000 --- a/lib/json5/v2.1.0/lib/require.js +++ /dev/null @@ -1,4 +0,0 @@ -// This file is for backward compatibility with v0.5.1. -require('./register') - -console.warn("'json5/require' is deprecated. Please use 'json5/register' instead.") diff --git a/lib/json5/v2.1.0/lib/stringify.js b/lib/json5/v2.1.0/lib/stringify.js deleted file mode 100644 index 0df12f4..0000000 --- a/lib/json5/v2.1.0/lib/stringify.js +++ /dev/null @@ -1,254 +0,0 @@ -const util = require('./util') - -module.exports = function stringify (value, replacer, space) { - const stack = [] - let indent = '' - let propertyList - let replacerFunc - let gap = '' - let quote - - if ( - replacer != null && - typeof replacer === 'object' && - !Array.isArray(replacer) - ) { - space = replacer.space - quote = replacer.quote - replacer = replacer.replacer - } - - if (typeof replacer === 'function') { - replacerFunc = replacer - } else if (Array.isArray(replacer)) { - propertyList = [] - for (const v of replacer) { - let item - - if (typeof v === 'string') { - item = v - } else if ( - typeof v === 'number' || - v instanceof String || - v instanceof Number - ) { - item = String(v) - } - - if (item !== undefined && propertyList.indexOf(item) < 0) { - propertyList.push(item) - } - } - } - - if (space instanceof Number) { - space = Number(space) - } else if (space instanceof String) { - space = String(space) - } - - if (typeof space === 'number') { - if (space > 0) { - space = Math.min(10, Math.floor(space)) - gap = ' '.substr(0, space) - } - } else if (typeof space === 'string') { - gap = space.substr(0, 10) - } - - return serializeProperty('', {'': value}) - - function serializeProperty (key, holder) { - let value = holder[key] - if (value != null) { - if (typeof value.toJSON5 === 'function') { - value = value.toJSON5(key) - } else if (typeof value.toJSON === 'function') { - value = value.toJSON(key) - } - } - - if (replacerFunc) { - value = replacerFunc.call(holder, key, value) - } - - if (value instanceof Number) { - value = Number(value) - } else if (value instanceof String) { - value = String(value) - } else if (value instanceof Boolean) { - value = value.valueOf() - } - - switch (value) { - case null: return 'null' - case true: return 'true' - case false: return 'false' - } - - if (typeof value === 'string') { - return quoteString(value, false) - } - - if (typeof value === 'number') { - return String(value) - } - - if (typeof value === 'object') { - return Array.isArray(value) ? serializeArray(value) : serializeObject(value) - } - - return undefined - } - - function quoteString (value) { - const quotes = { - "'": 0.1, - '"': 0.2, - } - - const replacements = { - "'": "\\'", - '"': '\\"', - '\\': '\\\\', - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t', - '\v': '\\v', - '\0': '\\0', - '\u2028': '\\u2028', - '\u2029': '\\u2029', - } - - let product = '' - - for (const c of value) { - switch (c) { - case "'": - case '"': - quotes[c]++ - product += c - continue - } - - if (replacements[c]) { - product += replacements[c] - continue - } - - if (c < ' ') { - let hexString = c.charCodeAt(0).toString(16) - product += '\\x' + ('00' + hexString).substring(hexString.length) - continue - } - - product += c - } - - const quoteChar = quote || Object.keys(quotes).reduce((a, b) => (quotes[a] < quotes[b]) ? a : b) - - product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]) - - return quoteChar + product + quoteChar - } - - function serializeObject (value) { - if (stack.indexOf(value) >= 0) { - throw TypeError('Converting circular structure to JSON5') - } - - stack.push(value) - - let stepback = indent - indent = indent + gap - - let keys = propertyList || Object.keys(value) - let partial = [] - for (const key of keys) { - const propertyString = serializeProperty(key, value) - if (propertyString !== undefined) { - let member = serializeKey(key) + ':' - if (gap !== '') { - member += ' ' - } - member += propertyString - partial.push(member) - } - } - - let final - if (partial.length === 0) { - final = '{}' - } else { - let properties - if (gap === '') { - properties = partial.join(',') - final = '{' + properties + '}' - } else { - let separator = ',\n' + indent - properties = partial.join(separator) - final = '{\n' + indent + properties + ',\n' + stepback + '}' - } - } - - stack.pop() - indent = stepback - return final - } - - function serializeKey (key) { - if (key.length === 0) { - return quoteString(key, true) - } - - const firstChar = String.fromCodePoint(key.codePointAt(0)) - if (!util.isIdStartChar(firstChar)) { - return quoteString(key, true) - } - - for (let i = firstChar.length; i < key.length; i++) { - if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) { - return quoteString(key, true) - } - } - - return key - } - - function serializeArray (value) { - if (stack.indexOf(value) >= 0) { - throw TypeError('Converting circular structure to JSON5') - } - - stack.push(value) - - let stepback = indent - indent = indent + gap - - let partial = [] - for (let i = 0; i < value.length; i++) { - const propertyString = serializeProperty(String(i), value) - partial.push((propertyString !== undefined) ? propertyString : 'null') - } - - let final - if (partial.length === 0) { - final = '[]' - } else { - if (gap === '') { - let properties = partial.join(',') - final = '[' + properties + ']' - } else { - let separator = ',\n' + indent - let properties = partial.join(separator) - final = '[\n' + indent + properties + ',\n' + stepback + ']' - } - } - - stack.pop() - indent = stepback - return final - } -} diff --git a/lib/json5/v2.1.0/lib/unicode.js b/lib/json5/v2.1.0/lib/unicode.js deleted file mode 100644 index 215ccd8..0000000 --- a/lib/json5/v2.1.0/lib/unicode.js +++ /dev/null @@ -1,4 +0,0 @@ -// This is a generated file. Do not edit. -module.exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/ -module.exports.ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/ -module.exports.ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ diff --git a/lib/json5/v2.1.0/lib/util.js b/lib/json5/v2.1.0/lib/util.js deleted file mode 100644 index 3b5e466..0000000 --- a/lib/json5/v2.1.0/lib/util.js +++ /dev/null @@ -1,35 +0,0 @@ -const unicode = require('../lib/unicode') - -module.exports = { - isSpaceSeparator (c) { - return unicode.Space_Separator.test(c) - }, - - isIdStartChar (c) { - return ( - (c >= 'a' && c <= 'z') || - (c >= 'A' && c <= 'Z') || - (c === '$') || (c === '_') || - unicode.ID_Start.test(c) - ) - }, - - isIdContinueChar (c) { - return ( - (c >= 'a' && c <= 'z') || - (c >= 'A' && c <= 'Z') || - (c >= '0' && c <= '9') || - (c === '$') || (c === '_') || - (c === '\u200C') || (c === '\u200D') || - unicode.ID_Continue.test(c) - ) - }, - - isDigit (c) { - return /[0-9]/.test(c) - }, - - isHexDigit (c) { - return /[0-9A-Fa-f]/.test(c) - }, -} diff --git a/lib/json5/v2.1.0/package.json b/lib/json5/v2.1.0/package.json deleted file mode 100644 index 4bca17e..0000000 --- a/lib/json5/v2.1.0/package.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "_from": "json5", - "_id": "json5@2.1.0", - "_inBundle": false, - "_integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", - "_location": "/json5", - "_phantomChildren": {}, - "_requested": { - "type": "tag", - "registry": true, - "raw": "json5", - "name": "json5", - "escapedName": "json5", - "rawSpec": "", - "saveSpec": null, - "fetchSpec": "latest" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", - "_shasum": "e7a0c62c48285c628d20a10b85c89bb807c32850", - "_spec": "json5", - "_where": "C:\\Users\\Emmanuel\\npm", - "author": { - "name": "Aseem Kishore", - "email": "aseem.kishore@gmail.com" - }, - "bin": { - "json5": "lib/cli.js" - }, - "browser": "dist/index.js", - "bugs": { - "url": "https://github.com/json5/json5/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Max Nanasy", - "email": "max.nanasy@gmail.com" - }, - { - "name": "Andrew Eisenberg", - "email": "andrew@eisenberg.as" - }, - { - "name": "Jordan Tucker", - "email": "jordanbtucker@gmail.com" - } - ], - "dependencies": { - "minimist": "^1.2.0" - }, - "deprecated": false, - "description": "JSON for humans.", - "devDependencies": { - "core-js": "^2.5.7", - "eslint": "^5.3.0", - "eslint-config-standard": "^11.0.0", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-node": "^7.0.1", - "eslint-plugin-promise": "^3.8.0", - "eslint-plugin-standard": "^3.1.0", - "regenerate": "^1.4.0", - "rollup": "^0.64.1", - "rollup-plugin-buble": "^0.19.2", - "rollup-plugin-commonjs": "^9.1.5", - "rollup-plugin-node-resolve": "^3.3.0", - "rollup-plugin-terser": "^1.0.1", - "sinon": "^6.1.5", - "tap": "^12.0.1", - "unicode-10.0.0": "^0.7.5" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "lib/", - "dist/" - ], - "homepage": "http://json5.org/", - "keywords": [ - "json", - "json5", - "es5", - "es2015", - "ecmascript" - ], - "license": "MIT", - "main": "lib/index.js", - "name": "json5", - "repository": { - "type": "git", - "url": "git+https://github.com/json5/json5.git" - }, - "scripts": { - "build": "rollup -c", - "build-package": "node build/package.js", - "build-unicode": "node build/unicode.js", - "coverage": "tap --coverage-report html test", - "lint": "eslint --fix .", - "prepublishOnly": "npm run production", - "preversion": "npm run production", - "production": "npm run lint && npm test && npm run build", - "test": "tap -Rspec --100 test", - "version": "npm run build-package && git add package.json5" - }, - "version": "2.1.0" -} diff --git a/lib/kFSM/index.ts b/lib/kFSM/index.ts new file mode 100644 index 0000000..014d54e --- /dev/null +++ b/lib/kFSM/index.ts @@ -0,0 +1,1167 @@ +/** + * ----------------------------------------------------------------------------------------- + * iFSM.ts - TypeScript Edition + * A finite state machine library (no dependencies) + * + * Rewritten from the original jQuery-based iFSM by E.Podvin / INTERSEL + * Original: https://github.com/intersel/iFSM + * ----------------------------------------------------------------------------------------- + * + * @fileoverview Finite State Machine (FSM) with hierarchical sub-machine support + * @version 3.0.0 + * ----------------------------------------------------------------------------------------- + */ + +// ═══════════════════════════════════════════════════════════════════════ +// Type definitions +// ═══════════════════════════════════════════════════════════════════════ + +/** Any DOM target the FSM can be bound to */ +export type FSMTarget = Element | Document | Window | HTMLElement; + +/** Processing status of the FSM */ +export type ProcessEventStatus = 'idle' | 'processing'; + +/** Push/Pop directive */ +export type PushPopDirective = 'PushState' | 'PopState'; + +/** Logical operator for sub-machine target conditions */ +export type LogicalOperator = '||' | '&&'; + +/** Sub-machine condition modifier */ +export type ConditionModifier = '' | 'not'; + +/** Log error level */ +export type LogLevel = 1 | 2 | 3; + +/** + * A state function signature — `this` is bound to the FSMManager instance. + * `D` is the type of the event data carried between states (defaults to `unknown`). + */ +export type StateFunction = ( + this: FSMManager, + parameters: unknown, + event: FSMEvent, + data: D, + ...extra: unknown[] +) => boolean | void | Promise; + +/** Condition that can be a boolean-returning function or a string (eval'd) */ +export type ConditionExpression = string | ((this: FSMManager) => boolean); + +/** Internal dummy event used throughout the FSM */ +export interface FSMEvent { + data: unknown; + target: FSMTarget; + currentTarget: FSMTarget; + type: string; + stopPropagation: () => void; +} + +/** How an event should be processed */ +export interface HowProcessEvent { + immediate?: boolean; + delay?: number; + preventcancel?: boolean; + /** Internal — managed by the FSM */ + DelayedProcessNames?: Record; +} + +/** Condition on sub-machine states to decide on a transition */ +export interface SubMachineTargetCondition { + condition?: ConditionModifier; + target_list: string[]; +} + +/** Configuration for next_state_on_target */ +export interface NextStateOnTarget { + condition: LogicalOperator; + submachines: Record; +} + +/** Full event configuration within a state */ +export interface EventConfiguration { + how_process_event?: HowProcessEvent; + init_function?: StateFunction; + properties_init_function?: unknown; + next_state?: string; + pushpop_state?: PushPopDirective; + next_state_when?: ConditionExpression; + next_state_on_target?: NextStateOnTarget; + next_state_if_error?: string; + pushpop_state_if_error?: PushPopDirective; + propagate_event?: boolean | string | (boolean | string)[]; + propagate_event_on_localmachine?: boolean; + process_event_if?: ConditionExpression; + propagate_event_on_refused?: string; + out_function?: StateFunction; + properties_out_function?: unknown; + prevent_bubble?: boolean; + process_on_UItarget?: boolean; + UI_event_bubble?: boolean; + /** Internal — managed by the FSM */ + EventIteration?: number; +} + +/** A delegate (sub) machine declaration */ +export interface DelegateMachineDeclaration { + submachine: StateDefinition; + no_reinitialisation?: boolean; + /** Internal — the live FSM instance, created at runtime */ + myFSM?: FSMManager; +} + +/** + * A single state: a map of event names to their configuration. + * Special keys: `delegate_machines`, `enterState`, `exitState`. + * A string value means "synonym of another event in this state". + */ +export interface StateEvents { + delegate_machines?: Record>; + [eventName: string]: EventConfiguration | string | Record> | undefined; +} + +/** + * The full state definition. + * A string value for a state name means "synonym of another state". + * Must include `DefaultState`. + */ +export interface StateDefinition { + DefaultState?: StateEvents; + [stateName: string]: StateEvents | string | undefined; +} + +/** Options for the FSM */ +export interface FSMOptions { + debug?: boolean; + LogLevel?: LogLevel; + AlertError?: boolean; + maxPushEvent?: number; + startEvent?: string; + prefixFsmName?: string; + logFSM?: string; + initState?: string; + /** Internal — propagated to sub-machines */ + rootMachine?: FSMManager; + /** Internal — propagated to sub-machines */ + nextParent?: FSMManager; + /** Internal */ + FSMParent?: FSMManager; + [key: string]: unknown; + +} + +/** Pushed event waiting in the queue */ +interface PushedEvent { + anEvent: string; + data: unknown[]; +} + +/** Bound listener record for cleanup */ +interface BoundListener { + target: EventTarget; + event: string; + handler: EventListener; +} + +/** Trigger metadata attached to event data */ +interface TriggerMeta { + targetFSM: FSMManager; + localMachine: boolean; +} + +// ═══════════════════════════════════════════════════════════════════════ +// Internal state +// ═══════════════════════════════════════════════════════════════════════ + +let nbFSM = 0; + +/** Registry: element id -> FSMManager[] */ +const iFSMRegistry: Record = {}; + +/** Named timers (replaces jQuery.doTimeout) */ +const timers: Record> = {}; + +// ═══════════════════════════════════════════════════════════════════════ +// Internal utilities +// ═══════════════════════════════════════════════════════════════════════ + +function doTimeout(id: string, delay: number, fn: (...args: unknown[]) => void, ...args: unknown[]): void { + cancelTimeout(id); + timers[id] = setTimeout(() => { + delete timers[id]; + fn(...args); + }, delay); +} + +function cancelTimeout(id: string): void { + if (timers[id] !== undefined) { + clearTimeout(timers[id]); + delete timers[id]; + } +} + +/** Deep clone that preserves function references */ +function deepClone(src: T, seen: WeakMap = new WeakMap()): T { + if (src === null || typeof src !== 'object') return src; + if (src instanceof Date) return new Date(src as unknown as number) as unknown as T; + if (src instanceof RegExp) return new RegExp(src) as unknown as T; + if (typeof src === 'function') return src; + + const obj = src as Record; + if (seen.has(obj as object)) return seen.get(obj as object) as T; + + const copy: Record = Array.isArray(src) ? ([] as unknown as Record) : {}; + seen.set(obj as object, copy); + + for (const key of Object.keys(obj)) { + const val = obj[key]; + copy[key] = typeof val === 'function' ? val : deepClone(val, seen); + } + return copy as unknown as T; +} + +function elMatches(el: FSMTarget, ref: FSMTarget | EventTarget | null): boolean { + if (!el || !ref) return false; + if (el === ref) return true; + return false; +} + +function getElId(el: FSMTarget): string | null { + if (el === document) return 'iFSMDocumentRoot'; + if (isWindowTarget(el)) return '__iFSMWindow__'; + return (el as Element).id || null; +} + +function ensureId(el: FSMTarget): string { + if (el === document) return 'iFSMDocumentRoot'; + if (isWindowTarget(el)) return '__iFSMWindow__'; + const elem = el as HTMLElement; + if (!elem.id) { + elem.id = 'iFSM_auto_' + (++nbFSM) + '_' + Date.now(); + } + return elem.id; +} + +function isWindowTarget(o: unknown): o is Window { + return o === window; +} + +function getCss3Prop(cssprop: string): string | undefined { + const vendors = ['', '-moz-', '-webkit-', '-o-', '-ms-', '-khtml-']; + const root = document.documentElement; + const camelCase = (str: string) => + str.replace(/-([a-z])/gi, (_, p1: string) => p1.toUpperCase()); + for (const v of vendors) { + let prop = camelCase(v + cssprop); + if (prop.startsWith('Ms')) prop = 'm' + prop.slice(1); + if (prop in root.style) return prop; + } + return undefined; +} + +function createFSMEvent(target: FSMTarget, eventName: string, data?: unknown): FSMEvent { + return { + data: data ?? null, + target, + currentTarget: target, + type: eventName, + stopPropagation() {}, + }; +} + +function launchProcess(fsm: FSMManager, event: string, data: unknown[]): void { + fsm._log('launchProcess: ---> ' + event); + fsm.processEvent(event, data, true); +} + +function dispatch(el: EventTarget, eventName: string, detail: unknown): void { + el.dispatchEvent(new CustomEvent(eventName, { detail, bubbles: true })); +} + +function evaluateCondition(condition: ConditionExpression, context: FSMManager): boolean { + if (typeof condition === 'function') { + return condition.call(context); + } + // String expression — use Function constructor (safer scoping than raw eval) + const fn = new Function('return (' + condition + ')') as () => boolean; + return fn.call(context); +} + +// ═══════════════════════════════════════════════════════════════════════ +// FSMManager — main class +// ═══════════════════════════════════════════════════════════════════════ + +export class FSMManager { + // ── Public properties ──────────────────────────────────────────────── + readonly FSMName: string; + opts: Required> & FSMOptions; + + currentState: string; + lastState: string; + currentEvent: FSMEvent | string; + currentUIEvent?: FSMEvent; + receivedEvent?: string; + EventIteration: number; + actualTarget?: FSMTarget | EventTarget; + myUIObject: FSMTarget; + + rootMachine: FSMManager; + parentMachine: FSMManager | null; + childrenMachine: FSMManager[]; + subMachineName: string | null; + + _stateDefinition: Record; + readonly _originalStateDefinition: StateDefinition; + + // ── Internal properties ────────────────────────────────────────────── + pushStateList: string[]; + processEventStatus: ProcessEventStatus; + pushEventList: PushedEvent[]; + listEvents: Record; + currentDataEvent: unknown[]; + returnGeneralEventStatus: boolean; + preventCancelId: number; + + private _boundListeners: BoundListener[]; + private _mutationObserver: MutationObserver | null; + private _logOffset: string; + private lastevent: string; + + // ──────────────────────────────────────────────────────────────────── + constructor(anObject: FSMTarget, aStateDefinition: StateDefinition, options?: FSMOptions) { + const defaults = { + debug: true, + LogLevel: 1 as LogLevel, + AlertError: false, + maxPushEvent: 100, + startEvent: 'start', + prefixFsmName: 'FSM_', + logFSM: '', + }; + + nbFSM++; + + this.opts = { ...defaults, ...(options || {}) } as typeof this.opts; + this.FSMName = this.opts.prefixFsmName + nbFSM; + + this._stateDefinition = deepClone(aStateDefinition) as Record; + this._originalStateDefinition = aStateDefinition; + + this.currentState = ''; + this.lastState = ''; + this.currentEvent = ''; + this.EventIteration = 0; + this.pushStateList = []; + this.processEventStatus = 'idle'; + this.pushEventList = []; + this.myUIObject = anObject; + this.listEvents = {}; + this.currentDataEvent = []; + this.returnGeneralEventStatus = true; + this.preventCancelId = 0; + this.subMachineName = null; + this._boundListeners = []; + this._mutationObserver = null; + this._logOffset = ''; + this.lastevent = ''; + + // Root / parent machine + if (!this.opts.rootMachine) this.opts.rootMachine = this; + this.rootMachine = this.opts.rootMachine; + + if (this.opts.nextParent === undefined) { + this.parentMachine = null; + } else { + this.parentMachine = this.opts.nextParent; + } + this.opts.nextParent = this; + + this.childrenMachine = []; + if (this.parentMachine) this.parentMachine.childrenMachine.push(this); + + // ── Discover events & resolve synonyms ──────────────────────────── + const attrChangeEvents: string[] = []; + let attrChangeRequested = false; + let attrStyleChangeRequested = false; + let setStart = false; + + for (const aState in this._stateDefinition) { + const stateDef = this._stateDefinition[aState]; + // Synonym state + if (typeof stateDef === 'string') { + this._stateDefinition[aState] = this._stateDefinition[stateDef as string] as StateEvents; + } + const stateObj = this._stateDefinition[aState]; + if (!stateObj || typeof stateObj === 'string') continue; + + for (const aEvent in stateObj) { + // Synonym event + if (typeof stateObj[aEvent] === 'string') { + (stateObj as Record)[aEvent] = + stateObj[stateObj[aEvent] as string]; + } + + if ( + !this.rootMachine.listEvents[aEvent] && + aEvent !== 'delegate_machines' && + aEvent !== this.opts.startEvent + ) { + this.listEvents[aEvent] = aEvent; + if (this !== this.rootMachine) { + this.rootMachine.listEvents[aEvent] = aEvent; + } + } else if (aEvent === this.opts.startEvent) { + setStart = true; + } + } + } + + // ── Attribute-change handling via MutationObserver ───────────────── + for (const aEvent in this.listEvents) { + const parts = aEvent.split('_'); + if (parts[0] === 'attrchange') { + attrChangeRequested = true; + attrChangeEvents.push(aEvent); + if (parts[1] === 'style' && parts.length > 2) { + attrStyleChangeRequested = true; + } + } + } + + if (attrChangeRequested && anObject instanceof Element) { + this._setupMutationObserver(anObject, attrChangeEvents, attrStyleChangeRequested); + } + + // ── Bind event listeners ────────────────────────────────────────── + const eventTarget: EventTarget = isWindowTarget(anObject) + ? window + : anObject === document + ? document + : anObject; + const rootFSM = this.rootMachine; + + const eventNames = Object.keys(this.listEvents); + for (const evName of eventNames) { + if (evName.startsWith('attrchange')) continue; + const handler: EventListener = (event: Event) => { + const args: unknown[] = [event, (event as CustomEvent).detail ?? null]; + rootFSM.returnGeneralEventStatus = true; + rootFSM.processEvent(event.type, args); + return rootFSM.returnGeneralEventStatus; + }; + eventTarget.addEventListener(evName, handler); + this._boundListeners.push({ target: eventTarget, event: evName, handler }); + } + + // Start event listener + if (setStart) { + const localFSM = this; + const startHandler: EventListener = (event: Event) => { + const args: unknown[] = [event, (event as CustomEvent).detail ?? null]; + localFSM.processEvent(event.type, args); + }; + eventTarget.addEventListener(this.opts.startEvent, startHandler); + this._boundListeners.push({ target: eventTarget, event: this.opts.startEvent, handler: startHandler }); + } + + this._log('new FSMManager:' + this.FSMName, 2); + } + + // ── MutationObserver setup ──────────────────────────────────────────── + private _setupMutationObserver(el: Element, attrChangeEvents: string[], trackStyleChanges: boolean): void { + this._mutationObserver = new MutationObserver((mutations) => { + for (const mutation of mutations) { + if (mutation.type !== 'attributes' || !mutation.attributeName) continue; + const attrName = mutation.attributeName; + const oldValue = mutation.oldValue; + const newValue = el.getAttribute(attrName); + + if (attrChangeEvents.includes('attrchange')) { + dispatch(el, 'attrchange', { attributeName: attrName, oldValue, newValue }); + } + if (attrChangeEvents.includes('attrchange_' + attrName)) { + dispatch(el, 'attrchange_' + attrName, { oldValue, newValue }); + } + if (attrName === 'style' && trackStyleChanges) { + const parseStyles = (str: string | null): Record => { + const map: Record = {}; + if (!str) return map; + for (const part of str.split(';')) { + const idx = part.indexOf(':'); + if (idx > 0) { + map[part.slice(0, idx).trim()] = part.slice(idx + 1).trim(); + } + } + return map; + }; + const newStyles = parseStyles(newValue); + const oldStyles = parseStyles(oldValue); + for (const prop in newStyles) { + if (!oldStyles[prop] || oldStyles[prop] !== newStyles[prop]) { + const camelProp = getCss3Prop(prop) || prop; + const evtName = 'attrchange_style_' + camelProp; + if (attrChangeEvents.includes(evtName)) { + dispatch(el, evtName, { newValue: newStyles[prop], oldValue: oldStyles[prop] }); + } + } + } + } + } + }); + this._mutationObserver.observe(el, { attributes: true, attributeOldValue: true }); + } + + // ════════════════════════════════════════════════════════════════════ + // InitManager + // ════════════════════════════════════════════════════════════════════ + InitManager(aInitState?: string): void { + this._log('InitManager'); + this.currentState = aInitState || 'DefaultState'; + if (!this._stateDefinition.DefaultState) { + this._stateDefinition.DefaultState = {}; + } + + if (!this.parentMachine) { + this.trigger(this.opts.startEvent); + } else { + const anEv: unknown[] = [createFSMEvent(this.myUIObject, this.opts.startEvent)]; + this.processEvent(this.opts.startEvent, anEv, true); + } + } + + // ════════════════════════════════════════════════════════════════════ + // processEvent + // ════════════════════════════════════════════════════════════════════ + processEvent(anEvent: string, data: unknown[], forceProcess?: boolean): void { + const currentState = this.currentState; + const currentEvent = data[0] as FSMEvent; + this.currentUIEvent = currentEvent; + this.receivedEvent = anEvent; + this.currentDataEvent = data; + this.currentEvent = currentEvent; + let currentStateEvent = this.currentState; + let doForceProcess = forceProcess !== undefined; + + const anEv: unknown[] = [createFSMEvent(this.myUIObject, '', null)]; + anEv[1] = data[1]; + anEv[2] = data[2]; + + this._log( + 'processEvent: ' + this.FSMName + ':' + currentState + ':' + anEvent + '-> START', + 3, 1, + ); + + // ── Target machine check ────────────────────────────────────────── + if (data.length > 1) { + const meta = data[data.length - 1] as TriggerMeta | null; + if ( + meta?.targetFSM && + meta.targetFSM !== this && + (meta.localMachine || meta.targetFSM.rootMachine !== this.rootMachine) + ) { + this._log('processEvent: ' + this.FSMName + ':' + currentState + ':' + anEvent + '-> not for this machine', 3); + this._log('processEvent: EXIT', 3, -1); + return; + } + } + + // ── Sub-machine parent state check ──────────────────────────────── + if (this.subMachineName && this.parentMachine) { + const parentDef = this.parentMachine._stateDefinition[this.parentMachine.currentState]; + if ( + !parentDef?.delegate_machines || + !parentDef.delegate_machines[this.subMachineName] + ) { + this._log('processEvent: submachine cant run -> exit', 3); + this._log('processEvent: EXIT', 3, -1); + return; + } + } + + if (!this._stateDefinition[currentState]) { + this._log('processEvent: currentState "' + currentState + '" does not exist!', 1); + this._log('processEvent: EXIT', 3, -1); + return; + } + + if (anEvent === 'enterState' || anEvent === 'exitState') doForceProcess = true; + + // ── Target element check ────────────────────────────────────────── + const evtTarget = currentEvent.target; + const evtCurrent = currentEvent.currentTarget; + if ( + !elMatches(this.myUIObject, evtCurrent) && + !elMatches(this.myUIObject, evtTarget) && + this.myUIObject !== document && + !isWindowTarget(evtCurrent) && + !isWindowTarget(evtTarget) + ) { + this._log('processEvent: not a good target -> exit', 3); + this._log('processEvent: EXIT', 3, -1); + return; + } else { + this.actualTarget = this.myUIObject === document ? document : evtCurrent; + } + + let currentEventConfiguration = this._stateDefinition[currentState]?.[anEvent] as EventConfiguration | undefined; + + // ── Push event if busy ──────────────────────────────────────────── + if ( + !doForceProcess && + this.processEventStatus !== 'idle' && + (!currentEventConfiguration?.how_process_event || + (currentEventConfiguration.how_process_event.immediate === undefined && + currentEventConfiguration.how_process_event.delay === undefined)) + ) { + this.pushEvent(anEvent, data); + this._log('processEvent: Event pushed -> exit', 3); + this._log('processEvent: EXIT', 3, -1); + return; + } + + this.lastevent = currentState + '-' + anEvent; + + // ── Sub-machines ────────────────────────────────────────────────── + const delegateMachines = this._stateDefinition[currentState]?.delegate_machines; + if (delegateMachines) { + for (const aSubMachine in delegateMachines) { + this._log('processEvent: delegate to submachine -> ' + aSubMachine, 3); + const smDef = delegateMachines[aSubMachine] as DelegateMachineDeclaration; + + // Create if needed + if (!smDef.myFSM) { + this._log('processEvent: create FSM for submachine ' + aSubMachine, 3); + smDef.myFSM = new FSMManager(this.myUIObject, smDef.submachine, this.opts); + smDef.myFSM.opts.FSMParent = this; + smDef.myFSM.subMachineName = aSubMachine; + } + + if (anEvent === 'enterState') { + if (smDef.myFSM.currentState === '' || !smDef.no_reinitialisation) { + smDef.myFSM.InitManager(); + } + } else if (anEvent === 'exitState') { + (anEv[0] as FSMEvent).type = 'exitMachine'; + smDef.myFSM.processEvent('exitMachine', anEv, true); + smDef.myFSM.cancelDelayedProcess(); + } else { + smDef.myFSM.processEvent(anEvent, data); + + if (currentState !== this.currentState) { + this._log('processEvent: submachine changed environment', 3); + this.cleanExitProcess(); + this._log('processEvent: EXIT', 3, -1); + return; + } + + // Check prevent_bubble + const smState = smDef.myFSM.currentState; + const smStateDef = smDef.myFSM._stateDefinition; + if ( + (smStateDef[smState]?.[anEvent] as EventConfiguration)?.prevent_bubble || + (smStateDef.DefaultState?.[anEvent] as EventConfiguration)?.prevent_bubble || + anEvent === this.opts.startEvent + ) { + this._log('processEvent: prevent_bubble -> exit', 3); + this.cleanExitProcess(); + this._log('processEvent: EXIT', 3, -1); + return; + } + } + } + } + + // ── Resolve event configuration ─────────────────────────────────── + if (currentState === 'DefaultState' || currentEventConfiguration === undefined) { + this._log('processEvent: fallback to DefaultState for ' + anEvent, 3); + currentEventConfiguration = this._stateDefinition.DefaultState?.[anEvent] as EventConfiguration | undefined; + + if (currentEventConfiguration === undefined) { + if (!['start', 'enterState', 'exitState', 'exitMachine'].includes(anEvent)) { + this._log('processEvent: fallback to catchEvent for ' + anEvent, 3); + currentEventConfiguration = this._stateDefinition.DefaultState?.catchEvent as EventConfiguration | undefined; + if (currentEventConfiguration && !this._stateDefinition.DefaultState![anEvent]) { + (this._stateDefinition.DefaultState as Record)[anEvent] = deepClone(currentEventConfiguration); + } + } + } + + if (!currentEventConfiguration) { + this._log('processEvent: Event ' + anEvent + ' not found -> exit', 3); + this.cleanExitProcess(); + this._log('processEvent: EXIT', 3, -1); + return; + } + currentStateEvent = 'DefaultState'; + } + + // ── PopState resolution ─────────────────────────────────────────── + if ( + currentEventConfiguration.pushpop_state === 'PopState' && + this.pushStateList.length > 0 + ) { + currentEventConfiguration.next_state = this.pushStateList[this.pushStateList.length - 1]; + } + if ( + currentEventConfiguration.pushpop_state_if_error === 'PopState' && + this.pushStateList.length > 0 + ) { + currentEventConfiguration.next_state_if_error = this.pushStateList[this.pushStateList.length - 1]; + } + + // ── process_on_UItarget ─────────────────────────────────────────── + if ( + !elMatches(this.myUIObject, evtTarget) && + this.myUIObject !== document && + !isWindowTarget(evtCurrent) && + !isWindowTarget(evtTarget) && + currentEventConfiguration.process_on_UItarget + ) { + this._log('processEvent: wrong UI target (process_on_UItarget) -> exit', 3); + this.cleanExitProcess(); + this._log('processEvent: EXIT', 3, -1); + return; + } + + // ── UI_event_bubble ─────────────────────────────────────────────── + if (!currentEventConfiguration.UI_event_bubble) { + currentEvent.stopPropagation(); + this.returnGeneralEventStatus = false; + this.rootMachine.returnGeneralEventStatus = false; + } + + // ── Delayed event ───────────────────────────────────────────────── + if ( + !doForceProcess && + currentEventConfiguration.how_process_event?.delay + ) { + this._log('processEvent: Event ' + anEvent + ' delayed -> exit', 3); + this.delayProcess(anEvent, currentEventConfiguration.how_process_event.delay, data); + this.cleanExitProcess(); + this._log('processEvent: EXIT', 3, -1); + return; + } + + // ── EventIteration ──────────────────────────────────────────────── + const stateEvtDef = this._stateDefinition[currentStateEvent]?.[anEvent] as EventConfiguration; + if (stateEvtDef) { + stateEvtDef.EventIteration = (stateEvtDef.EventIteration ?? 0) + 1; + this.EventIteration = stateEvtDef.EventIteration; + } + + // ── process_event_if ────────────────────────────────────────────── + if (currentEventConfiguration.process_event_if !== undefined) { + if (!evaluateCondition(currentEventConfiguration.process_event_if, this)) { + this._log('processEvent: refused by process_event_if', 3); + if (currentEventConfiguration.propagate_event_on_refused) { + this.trigger( + currentEventConfiguration.propagate_event_on_refused, + null, + currentEventConfiguration.propagate_event_on_localmachine, + ); + } + this.cleanExitProcess(); + this._log('processEvent: EXIT', 3, -1); + return; + } + } + + // ********************************************* + // Actually processing the event + // ********************************************* + this._log('processEvent: ' + this.FSMName + ':' + currentState + ':' + anEvent + '-> processing', 2); + const lastStatus = this.processEventStatus; + this.processEventStatus = 'processing'; + + let funcReturn: boolean | void | Promise = true; + + // Clear preventCancel tag + const dataObj = data[1] as Record | null; + if (dataObj?.preventCancelSet) delete dataObj.preventCancelSet; + + // ── init_function ───────────────────────────────────────────────── + if (currentEventConfiguration.init_function) { + const localdata = [currentEventConfiguration.properties_init_function, ...data]; + funcReturn = currentEventConfiguration.init_function.apply(this, localdata as Parameters); + this._log('processEvent: init_function done', 3); + } + + // ── State transition ────────────────────────────────────────────── + + // Push/Pop + if (funcReturn !== false && currentEventConfiguration.pushpop_state) { + switch (currentEventConfiguration.pushpop_state) { + case 'PushState': + this.pushStateList.push(this.currentState); + break; + case 'PopState': + if (this.pushStateList.length > 0) this.pushStateList.pop(); + break; + } + } + + // next_state_when evaluation + let nextStateWhenResult: boolean | undefined; + if (currentEventConfiguration.next_state_when !== undefined) { + nextStateWhenResult = evaluateCondition(currentEventConfiguration.next_state_when, this); + } + + // Do we change state? + if ( + funcReturn !== false && + currentEventConfiguration.next_state && + currentState !== currentEventConfiguration.next_state && + ( + (currentEventConfiguration.next_state_when === undefined && + currentEventConfiguration.next_state_on_target === undefined) || + (currentEventConfiguration.next_state_when !== undefined && nextStateWhenResult === true) || + (currentEventConfiguration.next_state_on_target && + this.subMachinesRespectTargets(anEvent)) + ) + ) { + // Reset event iterations + const stateDef = this._stateDefinition[this.currentState]; + if (stateDef) { + for (const key in stateDef) { + if (key !== 'delegate_machines') { + const evt = stateDef[key] as EventConfiguration; + if (evt && typeof evt === 'object') evt.EventIteration = 0; + } + } + } + + this.cancelDelayedProcess(); + + // Exit state + (anEv[0] as FSMEvent).type = 'exitState'; + if (anEvent !== this.opts.startEvent) { + this.processEvent('exitState', anEv, true); + } + + // *** Change state *** + if (this._stateDefinition[currentEventConfiguration.next_state]) { + this._log('processEvent: Go to ' + currentEventConfiguration.next_state, 3); + this.lastState = this.currentState; + this.currentState = currentEventConfiguration.next_state; + } else { + this._log('processEvent: ' + currentEventConfiguration.next_state + ' DOES NOT EXIST!', 1); + this.lastState = this.currentState; + } + + // Enter state + (anEv[0] as FSMEvent).type = 'enterState'; + this.processEvent('enterState', anEv, true); + + // Propagate + this._propagateEvents(currentEventConfiguration, anEvent, data); + } else if (funcReturn !== false && currentEventConfiguration.propagate_event !== undefined) { + // Same state, propagate + this._propagateEvents(currentEventConfiguration, anEvent, data); + } else if (funcReturn === false && currentEventConfiguration.next_state_if_error) { + // Error path + this._log('processEvent: error in init_function', 3); + if (currentEventConfiguration.pushpop_state_if_error) { + switch (currentEventConfiguration.pushpop_state_if_error) { + case 'PushState': + this.pushStateList.push(this.currentState); + break; + case 'PopState': + if (this.pushStateList.length > 0) this.pushStateList.pop(); + break; + } + } + + this._log('processEvent: Go to (error) ' + currentEventConfiguration.next_state_if_error, 3); + this.lastState = this.currentState; + this.currentState = currentEventConfiguration.next_state_if_error; + + (anEv[0] as FSMEvent).type = 'enterState'; + this.processEvent('enterState', anEv, true); + } else { + this._log('processEvent: nothing to do', 3); + } + + // ── out_function ────────────────────────────────────────────────── + if (currentEventConfiguration.out_function) { + const localdata = [currentEventConfiguration.properties_out_function, ...data]; + currentEventConfiguration.out_function.apply(this, localdata as Parameters); + this._log('processEvent: out_function done', 3); + } + + this.processEventStatus = lastStatus; + this.cleanExitProcess(); + this._log('processEvent: ' + this.FSMName + ':' + currentState + ':' + anEvent + '-> EXIT', 3, -1); + } + + // ── propagate helper ──────────────────────────────────────────────── + private _propagateEvents(config: EventConfiguration, anEvent: string, data: unknown[]): void { + if (config.propagate_event === undefined) return; + let events = config.propagate_event; + if (!Array.isArray(events)) events = [events]; + for (const ev of events) { + this._log('processEvent: propagate -> ' + ev, 3); + if (ev === true) { + this.trigger(anEvent, data[1], config.propagate_event_on_localmachine); + } else { + this.trigger(ev as string, data[1], config.propagate_event_on_localmachine); + } + } + } + + // ════════════════════════════════════════════════════════════════════ + // Event queue + // ════════════════════════════════════════════════════════════════════ + + cleanExitProcess(): void { + if ( + this.pushEventList.length && + (this.processEventStatus === 'idle' || this.pushEventList.length > this.opts.maxPushEvent) + ) { + this.popEvent(); + } + } + + pushEvent(anEvent: string, data?: unknown[]): void { + this._log('pushEvent: -> ' + anEvent); + if (this.pushEventList.length > this.opts.maxPushEvent) { + this._log('pushEvent: too many events -> ' + this.pushEventList.length, 2); + return; + } + if (!data || !Array.isArray(data) || !(data[0] as FSMEvent)?.type) { + data = [createFSMEvent(this.myUIObject, anEvent), data]; + } + this.pushEventList.push({ anEvent, data }); + } + + popEvent(): boolean { + this._log('popEvent'); + if (this.pushEventList.length > 0) { + const evt = this.pushEventList.shift()!; + if (!evt.anEvent) return false; + this.processEvent(evt.anEvent, evt.data); + return true; + } + return false; + } + + // ════════════════════════════════════════════════════════════════════ + // Delayed events + // ════════════════════════════════════════════════════════════════════ + + delayProcess(anEvent: string, aDelay: number, data: unknown[]): void { + this._log('delayProcess: -> ' + anEvent); + this.preventCancelId++; + + let currentState = this.currentState; + let name = getElId(this.myUIObject) + currentState + anEvent + this.preventCancelId; + + if (!data[1]) data[1] = {}; + if (!this._stateDefinition[this.currentState]?.[anEvent]) currentState = 'DefaultState'; + + const evtCfg = this._stateDefinition[currentState][anEvent] as EventConfiguration; + if (!evtCfg.how_process_event!.DelayedProcessNames) { + evtCfg.how_process_event!.DelayedProcessNames = {}; + } + + if (evtCfg.how_process_event!.preventcancel) { + const d = data[1] as Record; + if (d.preventCancelSet) name = d.preventCancelSet as string; + else d.preventCancelSet = name; + } + + evtCfg.how_process_event!.DelayedProcessNames[name] = name; + doTimeout(name, aDelay, launchProcess as (...args: unknown[]) => void, this, anEvent, data); + } + + cancelDelayedProcess(): void { + this._log('cancelDelayedProcess'); + for (const aEvent in this._stateDefinition[this.currentState]) { + let cs = this.currentState; + if (!this._stateDefinition[cs]?.[aEvent]) cs = 'DefaultState'; + if (!this._stateDefinition[cs]?.[aEvent]) { + this._log('cancelDelayedProcess: ' + aEvent + ' has no definition', 1); + return; + } + const cfg = this._stateDefinition[cs][aEvent] as EventConfiguration; + if (cfg.how_process_event && !cfg.how_process_event.preventcancel) { + if (cfg.how_process_event.DelayedProcessNames) { + for (const n in cfg.how_process_event.DelayedProcessNames) { + cancelTimeout(n); + } + cfg.how_process_event.DelayedProcessNames = {}; + } + } + } + } + + // ════════════════════════════════════════════════════════════════════ + // trigger + // ════════════════════════════════════════════════════════════════════ + + trigger(aEventName: string, data?: unknown, sendToLocalMachine?: boolean): void { + const local = !!sendToLocalMachine; + const anEv: unknown[] = [createFSMEvent(this.myUIObject, aEventName)]; + anEv[1] = data; + anEv[2] = { targetFSM: this, localMachine: local } satisfies TriggerMeta; + if (!local) { + this.rootMachine.processEvent(aEventName, anEv); + } else { + this.processEvent(aEventName, anEv); + } + } + + // ════════════════════════════════════════════════════════════════════ + // Sub-machine target checks + // ════════════════════════════════════════════════════════════════════ + + subMachinesRespectTargets(anEvent: string): boolean { + this._log('subMachinesRespectTargets'); + const stateDef = this._stateDefinition[this.currentState]; + const evtCfg = stateDef[anEvent] as EventConfiguration; + const targetCfg = evtCfg.next_state_on_target!; + const condition = targetCfg.condition; + let result = condition === '||' ? false : true; + + for (const smName in targetCfg.submachines) { + const smCfg = targetCfg.submachines[smName]; + const delegates = stateDef.delegate_machines!; + let localRes = smCfg.target_list.indexOf( + (delegates[smName] as DelegateMachineDeclaration).myFSM!.currentState, + ) > -1; + + if (smCfg.condition === 'not') localRes = !localRes; + + if (condition === '||') { + result = result || localRes; + if (result) return result; + } else if (condition === '&&') { + result = result && localRes; + if (!result) return result; + } else { + this._log('unknown operator: ' + condition); + return result; + } + } + return result; + } + + // ════════════════════════════════════════════════════════════════════ + // Utility + // ════════════════════════════════════════════════════════════════════ + + hashCode(source: string): number { + let hash = 0; + for (let i = 0; i < source.length; i++) { + hash = ((hash << 5) - hash) + source.charCodeAt(i); + hash |= 0; + } + return hash; + } + + // ════════════════════════════════════════════════════════════════════ + // Logging + // ════════════════════════════════════════════════════════════════════ + + _log(message: string, errorLevel: LogLevel = 3, addOffset?: -1 | 0 | 1): void { + if (errorLevel >= 2 && !this.opts.debug) return; + if (errorLevel > this.opts.LogLevel) return; + if (this.opts.logFSM && !this.opts.logFSM.includes(this.FSMName)) return; + + if (addOffset === -1) { + this._logOffset = this._logOffset.replace(' ', ''); + } + + const prefix = '[fsm] ' + this._logOffset; + if (errorLevel === 1) console.error(prefix + message); + else if (errorLevel === 2) console.warn(prefix + message); + else console.log(prefix + message); + + if (errorLevel === 1 && this.opts.AlertError) alert(message); + if (addOffset === 1) this._logOffset += ' '; + } + + // ════════════════════════════════════════════════════════════════════ + // Cleanup + // ════════════════════════════════════════════════════════════════════ + + destroy(): void { + for (const { target, event, handler } of this._boundListeners) { + target.removeEventListener(event, handler); + } + this._boundListeners = []; + if (this._mutationObserver) { + this._mutationObserver.disconnect(); + this._mutationObserver = null; + } + const id = getElId(this.myUIObject); + if (id && iFSMRegistry[id]) { + iFSMRegistry[id] = iFSMRegistry[id].filter((f) => f !== this); + } + } +} + +// ═══════════════════════════════════════════════════════════════════════ +// Public API functions +// ═══════════════════════════════════════════════════════════════════════ + +/** + * Attach a FSM to a DOM element and start it. + */ +export function createFSM(el: FSMTarget, stateDefinition: StateDefinition, options?: FSMOptions): FSMManager { + const id = ensureId(el); + if (!iFSMRegistry[id]) iFSMRegistry[id] = []; + + // The FSM machinery is agnostic to the event-data type `D`; bridge to the + // internal (unknown-data) StateDefinition. + const def = stateDefinition as StateDefinition; + const fsm = new FSMManager(el, def, options); + + const existing = getFSM(el, def); + if (existing) { + console.warn('[warn][fsm] state machine was already set for this definition on ' + id); + } + + iFSMRegistry[id].push(fsm); + + if (options?.initState !== undefined) { + fsm.InitManager(options.initState); + } else { + fsm.InitManager(); + } + + return fsm; +} + +/** + * Attach a FSM to multiple elements. + */ +export function createFSMBatch( + elements: NodeListOf | Element[], + stateDefinition: StateDefinition, + options?: FSMOptions, +): FSMManager[] { + const list = elements instanceof NodeList ? Array.from(elements) : elements; + return list.map((el) => createFSM(el, stateDefinition, options)); +} + +/** + * Retrieve FSM(s) linked to a DOM element. + */ +export function getFSM(el: FSMTarget, stateDefinition?: StateDefinition): FSMManager | FSMManager[] | null { + const id = getElId(el); + if (!id || !iFSMRegistry[id]) return stateDefinition ? null : []; + + if (!stateDefinition) return iFSMRegistry[id]; + + for (const fsm of iFSMRegistry[id]) { + if (fsm._originalStateDefinition === stateDefinition) return fsm; + } + return null; +} + +// ═══════════════════════════════════════════════════════════════════════ +// Default export +// ═══════════════════════════════════════════════════════════════════════ + +export default { FSMManager, createFSM, createFSMBatch, getFSM }; \ No newline at end of file diff --git a/lib/mustache/3.0.1/CHANGELOG.md b/lib/mustache/3.0.1/CHANGELOG.md deleted file mode 100644 index 912d790..0000000 --- a/lib/mustache/3.0.1/CHANGELOG.md +++ /dev/null @@ -1,427 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -This project adheres to [Semantic Versioning](http://semver.org/). - -## [3.0.1] / 11 November 2018 - - * [#679]: Fix partials not rendering tokens when using custom tags, by [@stackchain]. - -## [3.0.0] / 16 September 2018 - -We are very happy to announce a new major version of mustache.js. We want to be very careful not to break projects -out in the wild, and adhering to [Semantic Versioning](http://semver.org/) we have therefore cut this new major version. - -The changes introduced will likely not require any actions for most using projects. The things to look out for that -might cause unexpected rendering results are described in the migration guide below. - -A big shout out and thanks to [@raymond-lam] for this release! Without his contributions with code and issue triaging, -this release would never have happened. - -### Major - -* [#618]: Allow rendering properties of primitive types that are not objects, by [@raymond-lam]. -* [#643]: `Writer.prototype.parse` to cache by tags in addition to template string, by [@raymond-lam]. -* [#664]: Fix `Writer.prototype.parse` cache, by [@seminaoki]. - -### Minor - -* [#673]: Add `tags` parameter to `Mustache.render()`, by [@raymond-lam]. - -### Migrating from mustache.js v2.x to v3.x - -#### Rendering properties of primitive types - -We have ensured properties of primitive types can be rendered at all times. That means `Array.length`, `String.length` -and similar. A corner case where this could cause unexpected output follows: - -View: -``` -{ - stooges: [ - { name: "Moe" }, - { name: "Larry" }, - { name: "Curly" } - ] -} -``` - -Template: -``` -{{#stooges}} - {{name}}: {{name.length}} characters -{{/stooges}} -``` - -Output with v3.0: -``` - Moe: 3 characters - Larry: 5 characters - Curly: 5 characters -``` - -Output with v2.x: -``` - Moe: characters - Larry: characters - Curly: characters -``` - -#### Caching for templates with custom delimiters - -We have improved the templates cache to ensure custom delimiters are taken into consideration for the cache. -This improvement might cause unexpected rendering behaviour for using projects actively using the custom delimiters functionality. - -Previously it was possible to use `Mustache.parse()` as a means to set global custom delimiters. If custom -delimiters were provided as an argument, it would affect all following calls to `Mustache.render()`. -Consider the following: - -```js -const template = "[[item.title]] [[item.value]]"; -mustache.parse(template, ["[[", "]]"]); - -console.log( - mustache.render(template, { - item: { - title: "TEST", - value: 1 - } - }) -); - ->> TEST 1 -``` - -The above illustrates the fact that `Mustache.parse()` made mustache.js cache the template without considering -the custom delimiters provided. This is no longer true. - -We no longer encourage using `Mustache.parse()` for this purpose, but have rather added a fourth argument to -`Mustache.render()` letting you provide custom delimiters when rendering. - -If you still need the pre-parse the template and use custom delimiters at the same time, ensure to provide -the custom delimiters as argument to `Mustache.render()` as well. - -## [2.3.2] / 17 August 2018 - -This release is made to revert changes introduced in [2.3.1] that caused unexpected behaviour for several users. - -### Minor - - * [#670]: Rollback template cache causing unexpected behaviour, by [@raymond-lam]. - -## [2.3.1] / 7 August 2018 - -### Minor - - * [#643]: `Writer.prototype.parse` to cache by tags in addition to template string, by [@raymond-lam]. - * [#664]: Fix `Writer.prototype.parse` cache, by [@seminaoki]. - -### Dev - - * [#666]: Install release tools with npm rather than pre-commit hook & `Rakefile`, by [@phillipj]. - * [#667], [#668]: Stabilize browser test suite, by [@phillipj]. - -### Docs - - * [#644]: Document global Mustache.escape overriding capacity, by [@paultopia]. - * [#657]: Correct `Mustache.parse()` return type documentation, by [@bbrooks]. - -## [2.3.0] / 8 November 2016 - -### Minor - - * [#540]: Add optional `output` argument to mustache CLI, by [@wizawu]. - * [#597]: Add compatibility with amdclean, by [@mightyplow]. - -### Dev - - * [#553]: Assert `null` lookup when rendering an unescaped value, by [@dasilvacontin]. - * [#580], [#610]: Ignore eslint for greenkeeper updates, by [@phillipj]. - * [#560]: Fix CLI tests for Windows, by [@kookookchoozeus]. - * Run browser tests w/node v4, by [@phillipj]. - -### Docs - - * [#542]: Add API documentation to README, by [@tomekwi]. - * [#546]: Add missing syntax highlighting to README code blocks, by [@pra85]. - * [#569]: Update Ctemplate links in README, by [@mortonfox]. - * [#592]: Change "loadUser" to "loadUser()" in README, by [@Flaque]. - * [#593]: Adding doctype to HTML code example in README, by [@calvinf]. - -### Dependencies - - * eslint -> 2.2.0. Breaking changes fix by [@phillipj]. [#548] - * eslint -> 2.5.1. - * mocha -> 3.0.2. - * zuul -> 3.11.0. - -## [2.2.1] / 13 December 2015 - -### Fixes - - * Improve HTML escaping, by [@phillipj]. - * Fix inconsistency in defining global mustache object, by [@simast]. - * Fix switch-case indent error, by [@norfish]. - * Unpin chai and eslint versions, by [@dasilvacontin]. - * Update README.md with proper grammar, by [@EvanLovely]. - * Update mjackson username in README, by [@mjackson]. - * Remove syntax highlighting in README code sample, by [@imagentleman]. - * Fix typo in README, by [@Xcrucifier]. - * Fix link typo in README, by [@keirog]. - -## [2.2.0] / 15 October 2015 - -### Added - - * Add Partials support to CLI, by [@palkan]. - -### Changed - - * Move install instructions to README's top, by [@mateusortiz] - * Improved devhook install output, by [@ShashankaNataraj]. - * Clarifies and improves language in documentation, by [@jfmercer]. - * Linting CLI tool, by [@phillipj]. - * npm 2.x and node v4 on Travis, by [@phillipj]. - -### Fixes - - * Fix README spelling error to "aforementioned", by [@djchie]. - * Equal error message test in .render() for server and browser, by [@phillipj]. - -### Dependencies - - * chai -> 3.3.0 - * eslint -> 1.6.0 - -## [2.1.3] / 23 July 2015 - -### Added - - * Throw error when providing .render() with invalid template type, by [@phillipj]. - * Documents use of string literals containing double quotes, by [@jfmercer]. - -### Changed - - * Move mustache gif to githubusercontent, by [@Andersos]. - -### Fixed - - * Update UMD Shim to be resilient to HTMLElement global pollution, by [@mikesherov]. - -## [2.1.2] / 17 June 2015 - -### Added - - * Mustache global definition ([#466]) by [@yousefcisco]. - -## [2.1.1] / 11 June 2015 - -### Added - - * State that we use semver on the change log, by [@dasilvacontin]. - * Added version links to change log, by [@dasilvacontin]. - -### Fixed - - * Bugfix for using values from view's context prototype, by [@phillipj]. - * Improve test with undefined/null lookup hit using dot notation, by [@dasilvacontin]. - * Bugfix for null/undefined lookup hit when using dot notation, by [@phillipj]. - * Remove moot `version` property from bower.json, by [@kkirsche]. - * bower.json doesn't require a version bump via hook, by [@dasilvacontin]. - - -## [2.1.0] / 5 June 2015 - - * Added license attribute to package.json, by [@pgilad]. - * Minor changes to make mustache.js compatible with both WSH and ASP, by [@nagaozen]. - * Improve CLI view parsing error, by [@phillipj]. - * Bugfix for view context cache, by [@phillipj]. - -## [2.0.0] / 27 Mar 2015 - - * Fixed lookup not stopping upon finding `undefined` or `null` values, by [@dasilvacontin]. - * Refactored pre-commit hook, by [@dasilvacontin]. - -## [1.2.0] / 24 Mar 2015 - - * Added -v option to CLI, by [@phillipj]. - * Bugfix for rendering Number when it serves as the Context, by [@phillipj]. - * Specified files in package.json for a cleaner install, by [@phillipj]. - -## [1.1.0] / 18 Feb 2015 - - * Refactor Writer.renderTokens() for better readability, by [@phillipj]. - * Cleanup tests section in readme, by [@phillipj]. - * Added JSHint to tests/CI, by [@phillipj]. - * Added node v0.12 on travis, by [@phillipj]. - * Created command line tool, by [@phillipj]. - * Added *falsy* to Inverted Sections description in README, by [@kristijanmatic]. - -## [1.0.0] / 20 Dec 2014 - - * Inline tag compilation, by [@mjackson]. - * Fixed AMD registration, volo package.json entry, by [@jrburke]. - * Added spm support, by [@afc163]. - * Only access properties of objects on Context.lookup, by [@cmbuckley]. - -## [0.8.2] / 17 Mar 2014 - - * Supporting Bower through a bower.json file. - -## [0.8.1] / 3 Jan 2014 - - * Fix usage of partial templates. - -## [0.8.0] / 2 Dec 2013 - - * Remove compile* writer functions, use mustache.parse instead. Smaller API. - * Throw an error when rendering a template that contains higher-order sections and - the original template is not provided. - * Remove low-level Context.make function. - * Better code readability and inline documentation. - * Stop caching templates by name. - -## [0.7.3] / 5 Nov 2013 - - * Don't require the original template to be passed to the rendering function - when using compiled templates. This is still required when using higher-order - functions in order to be able to extract the portion of the template - that was contained by that section. Fixes [#262]. - * Performance improvements. - -## [0.7.2] / 27 Dec 2012 - - * Fixed a rendering bug ([#274]) when using nested higher-order sections. - * Better error reporting on failed parse. - * Converted tests to use mocha instead of vows. - -## [0.7.1] / 6 Dec 2012 - - * Handle empty templates gracefully. Fixes [#265], [#267], and [#270]. - * Cache partials by template, not by name. Fixes [#257]. - * Added Mustache.compileTokens to compile the output of Mustache.parse. Fixes - [#258]. - -## [0.7.0] / 10 Sep 2012 - - * Rename Renderer => Writer. - * Allow partials to be loaded dynamically using a callback (thanks - [@TiddoLangerak] for the suggestion). - * Fixed a bug with higher-order sections that prevented them from being - passed the raw text of the section from the original template. - * More concise token format. Tokens also include start/end indices in the - original template. - * High-level API is consistent with the Writer API. - * Allow partials to be passed to the pre-compiled function (thanks - [@fallenice]). - * Don't use eval (thanks [@cweider]). - -## [0.6.0] / 31 Aug 2012 - - * Use JavaScript's definition of falsy when determining whether to render an - inverted section or not. Issue [#186]. - * Use Mustache.escape to escape values inside {{}}. This function may be - reassigned to alter the default escaping behavior. Issue [#244]. - * Fixed a bug that clashed with QUnit (thanks [@kannix]). - * Added volo support (thanks [@guybedford]). - -[3.0.1]: https://github.com/janl/mustache.js/compare/v3.0.0...v3.0.1 -[3.0.0]: https://github.com/janl/mustache.js/compare/v2.3.2...v3.0.0 -[2.3.2]: https://github.com/janl/mustache.js/compare/v2.3.1...v2.3.2 -[2.3.1]: https://github.com/janl/mustache.js/compare/v2.3.0...v2.3.1 -[2.3.0]: https://github.com/janl/mustache.js/compare/v2.2.1...v2.3.0 -[2.2.1]: https://github.com/janl/mustache.js/compare/v2.2.0...v2.2.1 -[2.2.0]: https://github.com/janl/mustache.js/compare/v2.1.3...v2.2.0 -[2.1.3]: https://github.com/janl/mustache.js/compare/v2.1.2...v2.1.3 -[2.1.2]: https://github.com/janl/mustache.js/compare/v2.1.1...v2.1.2 -[2.1.1]: https://github.com/janl/mustache.js/compare/v2.1.0...v2.1.1 -[2.1.0]: https://github.com/janl/mustache.js/compare/v2.0.0...v2.1.0 -[2.0.0]: https://github.com/janl/mustache.js/compare/v1.2.0...v2.0.0 -[1.2.0]: https://github.com/janl/mustache.js/compare/v1.1.0...v1.2.0 -[1.1.0]: https://github.com/janl/mustache.js/compare/v1.0.0...v1.1.0 -[1.0.0]: https://github.com/janl/mustache.js/compare/0.8.2...v1.0.0 -[0.8.2]: https://github.com/janl/mustache.js/compare/0.8.1...0.8.2 -[0.8.1]: https://github.com/janl/mustache.js/compare/0.8.0...0.8.1 -[0.8.0]: https://github.com/janl/mustache.js/compare/0.7.3...0.8.0 -[0.7.3]: https://github.com/janl/mustache.js/compare/0.7.2...0.7.3 -[0.7.2]: https://github.com/janl/mustache.js/compare/0.7.1...0.7.2 -[0.7.1]: https://github.com/janl/mustache.js/compare/0.7.0...0.7.1 -[0.7.0]: https://github.com/janl/mustache.js/compare/0.6.0...0.7.0 -[0.6.0]: https://github.com/janl/mustache.js/compare/0.5.2...0.6.0 - -[#186]: https://github.com/janl/mustache.js/issues/186 -[#244]: https://github.com/janl/mustache.js/issues/244 -[#257]: https://github.com/janl/mustache.js/issues/257 -[#258]: https://github.com/janl/mustache.js/issues/258 -[#262]: https://github.com/janl/mustache.js/issues/262 -[#265]: https://github.com/janl/mustache.js/issues/265 -[#267]: https://github.com/janl/mustache.js/issues/267 -[#270]: https://github.com/janl/mustache.js/issues/270 -[#274]: https://github.com/janl/mustache.js/issues/274 -[#466]: https://github.com/janl/mustache.js/issues/466 -[#540]: https://github.com/janl/mustache.js/issues/540 -[#542]: https://github.com/janl/mustache.js/issues/542 -[#546]: https://github.com/janl/mustache.js/issues/546 -[#548]: https://github.com/janl/mustache.js/issues/548 -[#553]: https://github.com/janl/mustache.js/issues/553 -[#560]: https://github.com/janl/mustache.js/issues/560 -[#569]: https://github.com/janl/mustache.js/issues/569 -[#580]: https://github.com/janl/mustache.js/issues/580 -[#592]: https://github.com/janl/mustache.js/issues/592 -[#593]: https://github.com/janl/mustache.js/issues/593 -[#597]: https://github.com/janl/mustache.js/issues/597 -[#610]: https://github.com/janl/mustache.js/issues/610 -[#643]: https://github.com/janl/mustache.js/issues/643 -[#644]: https://github.com/janl/mustache.js/issues/644 -[#657]: https://github.com/janl/mustache.js/issues/657 -[#664]: https://github.com/janl/mustache.js/issues/664 -[#666]: https://github.com/janl/mustache.js/issues/666 -[#667]: https://github.com/janl/mustache.js/issues/667 -[#668]: https://github.com/janl/mustache.js/issues/668 -[#670]: https://github.com/janl/mustache.js/issues/670 -[#618]: https://github.com/janl/mustache.js/issues/618 -[#673]: https://github.com/janl/mustache.js/issues/673 -[#679]: https://github.com/janl/mustache.js/issues/679 - -[@afc163]: https://github.com/afc163 -[@Andersos]: https://github.com/Andersos -[@bbrooks]: https://github.com/bbrooks -[@calvinf]: https://github.com/calvinf -[@cmbuckley]: https://github.com/cmbuckley -[@cweider]: https://github.com/cweider -[@dasilvacontin]: https://github.com/dasilvacontin -[@djchie]: https://github.com/djchie -[@EvanLovely]: https://github.com/EvanLovely -[@fallenice]: https://github.com/fallenice -[@Flaque]: https://github.com/Flaque -[@guybedford]: https://github.com/guybedford -[@imagentleman]: https://github.com/imagentleman -[@jfmercer]: https://github.com/jfmercer -[@jrburke]: https://github.com/jrburke -[@kannix]: https://github.com/kannix -[@keirog]: https://github.com/keirog -[@kkirsche]: https://github.com/kkirsche -[@kookookchoozeus]: https://github.com/kookookchoozeus -[@kristijanmatic]: https://github.com/kristijanmatic -[@mateusortiz]: https://github.com/mateusortiz -[@mightyplow]: https://github.com/mightyplow -[@mikesherov]: https://github.com/mikesherov -[@mjackson]: https://github.com/mjackson -[@mortonfox]: https://github.com/mortonfox -[@nagaozen]: https://github.com/nagaozen -[@norfish]: https://github.com/norfish -[@palkan]: https://github.com/palkan -[@paultopia]: https://github.com/paultopia -[@pgilad]: https://github.com/pgilad -[@phillipj]: https://github.com/phillipj -[@pra85]: https://github.com/pra85 -[@raymond-lam]: https://github.com/raymond-lam -[@seminaoki]: https://github.com/seminaoki -[@ShashankaNataraj]: https://github.com/ShashankaNataraj -[@simast]: https://github.com/simast -[@stackchain]: https://github.com/stackchain -[@TiddoLangerak]: https://github.com/TiddoLangerak -[@tomekwi]: https://github.com/tomekwi -[@wizawu]: https://github.com/wizawu -[@Xcrucifier]: https://github.com/Xcrucifier -[@yousefcisco]: https://github.com/yousefcisco diff --git a/lib/mustache/3.0.1/LICENSE b/lib/mustache/3.0.1/LICENSE deleted file mode 100644 index 4df7d1a..0000000 --- a/lib/mustache/3.0.1/LICENSE +++ /dev/null @@ -1,11 +0,0 @@ -The MIT License - -Copyright (c) 2009 Chris Wanstrath (Ruby) -Copyright (c) 2010-2014 Jan Lehnardt (JavaScript) -Copyright (c) 2010-2015 The mustache.js community - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lib/mustache/3.0.1/MIGRATING.md b/lib/mustache/3.0.1/MIGRATING.md deleted file mode 100644 index 28d5156..0000000 --- a/lib/mustache/3.0.1/MIGRATING.md +++ /dev/null @@ -1,50 +0,0 @@ -# Migrating Guide - -## Moving to mustache.js v2 - -### Overview - -mustache.js v2 introduces a bug fix that breaks compatibility with older versions: fixing null and undefined lookup. - -When mustache.js tries to render a variable `{{name}}`, it executes a `lookup` function to figure out which value it should render. This function looks up the value for the key `name` in the current context, and if there is no such key in the current context it looks up the parent contexts recursively. - -Value lookup should stop whenever the key exists in the context. However, due to a bug, this was not happening when the value was `null` or `undefined` even though the key existed in the context. - -Here's a simple example of the same template rendered with both mustache.js v1 and v2: - -Template: -```mustache -{{#friends}} -{{name}}'s twitter is: {{twitter}} -{{/friends}} -``` - -View: -```json -{ - "name": "David", - "twitter": "@dasilvacontin", - "friends": [ - { - "name": "Phillip", - "twitter": "@phillipjohnsen" - }, - { - "name": "Jan", - "twitter": null - } - ] -} -``` - -Rendered using mustache.js v1: -```text -Phillip's twitter is: @phillipjohnsen -Jan's twitter is: @dasilvacontin -``` - -Rendered using mustache.js v2: -```text -Phillip's twitter is: @phillipjohnsen -Jan's twitter is: -``` \ No newline at end of file diff --git a/lib/mustache/3.0.1/README.md b/lib/mustache/3.0.1/README.md deleted file mode 100644 index 05eac6d..0000000 --- a/lib/mustache/3.0.1/README.md +++ /dev/null @@ -1,645 +0,0 @@ -# mustache.js - Logic-less {{mustache}} templates with JavaScript - -> What could be more logical awesome than no logic at all? - -[![Build Status](https://travis-ci.org/janl/mustache.js.svg?branch=master)](https://travis-ci.org/janl/mustache.js) [![Gitter chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/janl/mustache.js) - -[mustache.js](http://github.com/janl/mustache.js) is an implementation of the [mustache](http://mustache.github.com/) template system in JavaScript. - -[Mustache](http://mustache.github.com/) is a logic-less template syntax. It can be used for HTML, config files, source code - anything. It works by expanding tags in a template using values provided in a hash or object. - -We call it "logic-less" because there are no if statements, else clauses, or for loops. Instead there are only tags. Some tags are replaced with a value, some nothing, and others a series of values. - -For a language-agnostic overview of mustache's template syntax, see the `mustache(5)` [manpage](http://mustache.github.com/mustache.5.html). - -## Where to use mustache.js? - -You can use mustache.js to render mustache templates anywhere you can use JavaScript. This includes web browsers, server-side environments such as [node](http://nodejs.org/), and [CouchDB](http://couchdb.apache.org/) views. - -mustache.js ships with support for both the [CommonJS](http://www.commonjs.org/) module API and the [Asynchronous Module Definition](https://github.com/amdjs/amdjs-api/wiki/AMD) API, or AMD. - -And this will be your templates after you use Mustache: - -!['stache](https://cloud.githubusercontent.com/assets/288977/8779228/a3cf700e-2f02-11e5-869a-300312fb7a00.gif) - -## Install - -You can get Mustache via npm. - -```bash -$ npm install mustache --save -``` -or install with bower: - -```bash -$ bower install --save mustache -``` - -## Command line tool - -mustache.js is shipped with a node based command line tool. It might be installed as a global tool on your computer to render a mustache template of some kind - -```bash -$ npm install -g mustache - -$ mustache dataView.json myTemplate.mustache > output.html -``` - -also supports stdin. - -```bash -$ cat dataView.json | mustache - myTemplate.mustache > output.html -``` - -or as a package.json `devDependency` in a build process maybe? - -```bash -$ npm install mustache --save-dev -``` - -```json -{ - "scripts": { - "build": "mustache dataView.json myTemplate.mustache > public/output.html" - } -} -``` -```bash -$ npm run build -``` - -The command line tool is basically a wrapper around `Mustache.render` so you get all the features. - -If your templates use partials you should pass paths to partials using `-p` flag: - -```bash -$ mustache -p path/to/partial1.mustache -p path/to/partial2.mustache dataView.json myTemplate.mustache -``` - -## Who uses mustache.js? - -An updated list of mustache.js users is kept [on the Github wiki](https://github.com/janl/mustache.js/wiki/Beard-Competition). Add yourself or your company if you use mustache.js! - -## Contributing - -mustache.js is a mature project, but it continues to actively invite maintainers. You can help out a high-profile project that is used in a lot of places on the web. There is [plenty](https://github.com/janl/mustache.js/issues) of [work](https://github.com/janl/mustache.js/pulls) to do. No big commitment required, if all you do is review a single [Pull Request](https://github.com/janl/mustache.js/pulls), you are a maintainer. And a hero. - -### Your First Contribution - -- review a [Pull Request](https://github.com/janl/mustache.js/pulls) -- fix an [Issue](https://github.com/janl/mustache.js/issues) -- update the [documentation](https://github.com/janl/mustache.js#usage) -- make a website -- write a tutorial - -* * * - -## Usage - -Below is a quick example how to use mustache.js: - -```js -var view = { - title: "Joe", - calc: function () { - return 2 + 4; - } -}; - -var output = Mustache.render("{{title}} spends {{calc}}", view); -``` - -In this example, the `Mustache.render` function takes two parameters: 1) the [mustache](http://mustache.github.com/) template and 2) a `view` object that contains the data and code needed to render the template. - -## API - -Following is an [rtype](https://git.io/rtype) signature of the most commonly used functions. - -```js -Mustache.render( - template : String, - view : Object, - partials? : Object, - tags = ['{{', '}}'] : Tags, -) => String - -Mustache.parse( - template : String, - tags = ['{{', '}}'] : Tags, -) => Token[] - -interface Token [String, String, Number, Number, Token[]?, Number?] - -interface Tags [String, String] - -``` - -## Templates - -A [mustache](http://mustache.github.com/) template is a string that contains any number of mustache tags. Tags are indicated by the double mustaches that surround them. `{{person}}` is a tag, as is `{{#person}}`. In both examples we refer to `person` as the tag's key. There are several types of tags available in mustache.js, described below. - -There are several techniques that can be used to load templates and hand them to mustache.js, here are two of them: - -#### Include Templates - -If you need a template for a dynamic part in a static website, you can consider including the template in the static HTML file to avoid loading templates separately. Here's a small example using `jQuery`: - -```html - - - -
          Loading...
          - - - -``` - -```js -function loadUser() { - var template = $('#template').html(); - Mustache.parse(template); // optional, speeds up future uses - var rendered = Mustache.render(template, {name: "Luke"}); - $('#target').html(rendered); -} -``` - -#### Load External Templates - -If your templates reside in individual files, you can load them asynchronously and render them when they arrive. Another example using `jQuery`: - -```js -function loadUser() { - $.get('template.mst', function(template) { - var rendered = Mustache.render(template, {name: "Luke"}); - $('#target').html(rendered); - }); -} -``` - -### Variables - -The most basic tag type is a simple variable. A `{{name}}` tag renders the value of the `name` key in the current context. If there is no such key, nothing is rendered. - -All variables are HTML-escaped by default. If you want to render unescaped HTML, use the triple mustache: `{{{name}}}`. You can also use `&` to unescape a variable. - -If you'd like to change HTML-escaping behavior globally (for example, to template non-HTML formats), you can override Mustache's escape function. For example, to disable all escaping: `Mustache.escape = function(text) {return text;};`. - -If you want `{{name}}` _not_ to be interpreted as a mustache tag, but rather to appear exactly as `{{name}}` in the output, you must change and then restore the default delimiter. See the [Custom Delimiters](#custom-delimiters) section for more information. - -View: - -```json -{ - "name": "Chris", - "company": "GitHub" -} -``` - -Template: - -``` -* {{name}} -* {{age}} -* {{company}} -* {{{company}}} -* {{&company}} -{{=<% %>=}} -* {{company}} -<%={{ }}=%> -``` - -Output: - -```html -* Chris -* -* <b>GitHub</b> -* GitHub -* GitHub -* {{company}} -``` - -JavaScript's dot notation may be used to access keys that are properties of objects in a view. - -View: - -```json -{ - "name": { - "first": "Michael", - "last": "Jackson" - }, - "age": "RIP" -} -``` - -Template: - -```html -* {{name.first}} {{name.last}} -* {{age}} -``` - -Output: - -```html -* Michael Jackson -* RIP -``` - -### Sections - -Sections render blocks of text one or more times, depending on the value of the key in the current context. - -A section begins with a pound and ends with a slash. That is, `{{#person}}` begins a `person` section, while `{{/person}}` ends it. The text between the two tags is referred to as that section's "block". - -The behavior of the section is determined by the value of the key. - -#### False Values or Empty Lists - -If the `person` key does not exist, or exists and has a value of `null`, `undefined`, `false`, `0`, or `NaN`, or is an empty string or an empty list, the block will not be rendered. - -View: - -```json -{ - "person": false -} -``` - -Template: - -```html -Shown. -{{#person}} -Never shown! -{{/person}} -``` - -Output: - -```html -Shown. -``` - -#### Non-Empty Lists - -If the `person` key exists and is not `null`, `undefined`, or `false`, and is not an empty list the block will be rendered one or more times. - -When the value is a list, the block is rendered once for each item in the list. The context of the block is set to the current item in the list for each iteration. In this way we can loop over collections. - -View: - -```json -{ - "stooges": [ - { "name": "Moe" }, - { "name": "Larry" }, - { "name": "Curly" } - ] -} -``` - -Template: - -```html -{{#stooges}} -{{name}} -{{/stooges}} -``` - -Output: - -```html -Moe -Larry -Curly -``` - -When looping over an array of strings, a `.` can be used to refer to the current item in the list. - -View: - -```json -{ - "musketeers": ["Athos", "Aramis", "Porthos", "D'Artagnan"] -} -``` - -Template: - -```html -{{#musketeers}} -* {{.}} -{{/musketeers}} -``` - -Output: - -```html -* Athos -* Aramis -* Porthos -* D'Artagnan -``` - -If the value of a section variable is a function, it will be called in the context of the current item in the list on each iteration. - -View: - -```js -{ - "beatles": [ - { "firstName": "John", "lastName": "Lennon" }, - { "firstName": "Paul", "lastName": "McCartney" }, - { "firstName": "George", "lastName": "Harrison" }, - { "firstName": "Ringo", "lastName": "Starr" } - ], - "name": function () { - return this.firstName + " " + this.lastName; - } -} -``` - -Template: - -```html -{{#beatles}} -* {{name}} -{{/beatles}} -``` - -Output: - -```html -* John Lennon -* Paul McCartney -* George Harrison -* Ringo Starr -``` - -#### Functions - -If the value of a section key is a function, it is called with the section's literal block of text, un-rendered, as its first argument. The second argument is a special rendering function that uses the current view as its view argument. It is called in the context of the current view object. - -View: - -```js -{ - "name": "Tater", - "bold": function () { - return function (text, render) { - return "" + render(text) + ""; - } - } -} -``` - -Template: - -```html -{{#bold}}Hi {{name}}.{{/bold}} -``` - -Output: - -```html -Hi Tater. -``` - -### Inverted Sections - -An inverted section opens with `{{^section}}` instead of `{{#section}}`. The block of an inverted section is rendered only if the value of that section's tag is `null`, `undefined`, `false`, *falsy* or an empty list. - -View: - -```json -{ - "repos": [] -} -``` - -Template: - -```html -{{#repos}}{{name}}{{/repos}} -{{^repos}}No repos :({{/repos}} -``` - -Output: - -```html -No repos :( -``` - -### Comments - -Comments begin with a bang and are ignored. The following template: - -```html -

          Today{{! ignore me }}.

          -``` - -Will render as follows: - -```html -

          Today.

          -``` - -Comments may contain newlines. - -### Partials - -Partials begin with a greater than sign, like {{> box}}. - -Partials are rendered at runtime (as opposed to compile time), so recursive partials are possible. Just avoid infinite loops. - -They also inherit the calling context. Whereas in ERB you may have this: - -```html+erb -<%= partial :next_more, :start => start, :size => size %> -``` - -Mustache requires only this: - -```html -{{> next_more}} -``` - -Why? Because the `next_more.mustache` file will inherit the `size` and `start` variables from the calling context. In this way you may want to think of partials as includes, imports, template expansion, nested templates, or subtemplates, even though those aren't literally the case here. - - -For example, this template and partial: - - base.mustache: -

          Names

          - {{#names}} - {{> user}} - {{/names}} - - user.mustache: - {{name}} - -Can be thought of as a single, expanded template: - -```html -

          Names

          -{{#names}} - {{name}} -{{/names}} -``` - -In mustache.js an object of partials may be passed as the third argument to `Mustache.render`. The object should be keyed by the name of the partial, and its value should be the partial text. - -```js -Mustache.render(template, view, { - user: userTemplate -}); -``` - -### Custom Delimiters - -Custom delimiters can be used in place of `{{` and `}}` by setting the new values in JavaScript or in templates. - -#### Setting in JavaScript - -The `Mustache.tags` property holds an array consisting of the opening and closing tag values. Set custom values by passing a new array of tags to `render()`, which gets honored over the default values, or by overriding the `Mustache.tags` property itself: - -```js -var customTags = [ '<%', '%>' ]; -``` - -##### Pass Value into Render Method -```js -Mustache.render(template, view, {}, customTags); -``` - -##### Override Tags Property -```js -Mustache.tags = customTags; -// Subsequent parse() and render() calls will use customTags -``` - -#### Setting in Templates - -Set Delimiter tags start with an equals sign and change the tag delimiters from `{{` and `}}` to custom strings. - -Consider the following contrived example: - -```html+erb -* {{ default_tags }} -{{=<% %>=}} -* <% erb_style_tags %> -<%={{ }}=%> -* {{ default_tags_again }} -``` - -Here we have a list with three items. The first item uses the default tag style, the second uses ERB style as defined by the Set Delimiter tag, and the third returns to the default style after yet another Set Delimiter declaration. - -According to [ctemplates](https://htmlpreview.github.io/?https://raw.githubusercontent.com/OlafvdSpek/ctemplate/master/doc/howto.html), this "is useful for languages like TeX, where double-braces may occur in the text and are awkward to use for markup." - -Custom delimiters may not contain whitespace or the equals sign. - -## Pre-parsing and Caching Templates - -By default, when mustache.js first parses a template it keeps the full parsed token tree in a cache. The next time it sees that same template it skips the parsing step and renders the template much more quickly. If you'd like, you can do this ahead of time using `mustache.parse`. - -```js -Mustache.parse(template); - -// Then, sometime later. -Mustache.render(template, view); -``` - -## Plugins for JavaScript Libraries - -mustache.js may be built specifically for several different client libraries, including the following: - - - [jQuery](http://jquery.com/) - - [MooTools](http://mootools.net/) - - [Dojo](http://www.dojotoolkit.org/) - - [YUI](http://developer.yahoo.com/yui/) - - [qooxdoo](http://qooxdoo.org/) - -These may be built using [Rake](http://rake.rubyforge.org/) and one of the following commands: -```bash -$ rake jquery -$ rake mootools -$ rake dojo -$ rake yui3 -$ rake qooxdoo -``` -## Testing - -In order to run the tests you'll need to install [node](http://nodejs.org/). - -You also need to install the sub module containing [Mustache specifications](http://github.com/mustache/spec) in the project root. -```bash -$ git submodule init -$ git submodule update -``` -Install dependencies. -```bash -$ npm install -``` -Then run the tests. -```bash -$ npm test -``` -The test suite consists of both unit and integration tests. If a template isn't rendering correctly for you, you can make a test for it by doing the following: - - 1. Create a template file named `mytest.mustache` in the `test/_files` - directory. Replace `mytest` with the name of your test. - 2. Create a corresponding view file named `mytest.js` in the same directory. - This file should contain a JavaScript object literal enclosed in - parentheses. See any of the other view files for an example. - 3. Create a file with the expected output in `mytest.txt` in the same - directory. - -Then, you can run the test with: -```bash -$ TEST=mytest npm run test-render -``` -### Browser tests - -Browser tests are not included in `npm test` as they run for too long, although they are ran automatically on Travis when merged into master. Run browser tests locally in any browser: -```bash -$ npm run test-browser-local -``` -then point your browser to `http://localhost:8080/__zuul` - -### Troubleshooting - -#### npm install fails - -Ensure to have a recent version of npm installed. While developing this project requires npm with support for `^` version ranges. -```bash -$ npm install -g npm -``` -## Thanks - -mustache.js wouldn't kick ass if it weren't for these fine souls: - - * Chris Wanstrath / defunkt - * Alexander Lang / langalex - * Sebastian Cohnen / tisba - * J Chris Anderson / jchris - * Tom Robinson / tlrobinson - * Aaron Quint / quirkey - * Douglas Crockford - * Nikita Vasilyev / NV - * Elise Wood / glytch - * Damien Mathieu / dmathieu - * Jakub Kuźma / qoobaa - * Will Leinweber / will - * dpree - * Jason Smith / jhs - * Aaron Gibralter / agibralter - * Ross Boucher / boucher - * Matt Sanford / mzsanford - * Ben Cherry / bcherry - * Michael Jackson / mjackson - * Phillip Johnsen / phillipj - * David da Silva Contín / dasilvacontin diff --git a/lib/mustache/3.0.1/mustache.js b/lib/mustache/3.0.1/mustache.js deleted file mode 100644 index 8ec1b44..0000000 --- a/lib/mustache/3.0.1/mustache.js +++ /dev/null @@ -1,682 +0,0 @@ -/*! - * mustache.js - Logic-less {{mustache}} templates with JavaScript - * http://github.com/janl/mustache.js - */ - -/*global define: false Mustache: true*/ - -(function defineMustache (global, factory) { - if (typeof exports === 'object' && exports && typeof exports.nodeName !== 'string') { - factory(exports); // CommonJS - } else if (typeof define === 'function' && define.amd) { - define(['exports'], factory); // AMD - } else { - global.Mustache = {}; - factory(global.Mustache); // script, wsh, asp - } -}(this, function mustacheFactory (mustache) { - - var objectToString = Object.prototype.toString; - var isArray = Array.isArray || function isArrayPolyfill (object) { - return objectToString.call(object) === '[object Array]'; - }; - - function isFunction (object) { - return typeof object === 'function'; - } - - /** - * More correct typeof string handling array - * which normally returns typeof 'object' - */ - function typeStr (obj) { - return isArray(obj) ? 'array' : typeof obj; - } - - function escapeRegExp (string) { - return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&'); - } - - /** - * Null safe way of checking whether or not an object, - * including its prototype, has a given property - */ - function hasProperty (obj, propName) { - return obj != null && typeof obj === 'object' && (propName in obj); - } - - /** - * Safe way of detecting whether or not the given thing is a primitive and - * whether it has the given property - */ - function primitiveHasOwnProperty (primitive, propName) { - return ( - primitive != null - && typeof primitive !== 'object' - && primitive.hasOwnProperty - && primitive.hasOwnProperty(propName) - ); - } - - // Workaround for https://issues.apache.org/jira/browse/COUCHDB-577 - // See https://github.com/janl/mustache.js/issues/189 - var regExpTest = RegExp.prototype.test; - function testRegExp (re, string) { - return regExpTest.call(re, string); - } - - var nonSpaceRe = /\S/; - function isWhitespace (string) { - return !testRegExp(nonSpaceRe, string); - } - - var entityMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '/': '/', - '`': '`', - '=': '=' - }; - - function escapeHtml (string) { - return String(string).replace(/[&<>"'`=\/]/g, function fromEntityMap (s) { - return entityMap[s]; - }); - } - - var whiteRe = /\s*/; - var spaceRe = /\s+/; - var equalsRe = /\s*=/; - var curlyRe = /\s*\}/; - var tagRe = /#|\^|\/|>|\{|&|=|!/; - - /** - * Breaks up the given `template` string into a tree of tokens. If the `tags` - * argument is given here it must be an array with two string values: the - * opening and closing tags used in the template (e.g. [ "<%", "%>" ]). Of - * course, the default is to use mustaches (i.e. mustache.tags). - * - * A token is an array with at least 4 elements. The first element is the - * mustache symbol that was used inside the tag, e.g. "#" or "&". If the tag - * did not contain a symbol (i.e. {{myValue}}) this element is "name". For - * all text that appears outside a symbol this element is "text". - * - * The second element of a token is its "value". For mustache tags this is - * whatever else was inside the tag besides the opening symbol. For text tokens - * this is the text itself. - * - * The third and fourth elements of the token are the start and end indices, - * respectively, of the token in the original template. - * - * Tokens that are the root node of a subtree contain two more elements: 1) an - * array of tokens in the subtree and 2) the index in the original template at - * which the closing tag for that section begins. - */ - function parseTemplate (template, tags) { - if (!template) - return []; - - var sections = []; // Stack to hold section tokens - var tokens = []; // Buffer to hold the tokens - var spaces = []; // Indices of whitespace tokens on the current line - var hasTag = false; // Is there a {{tag}} on the current line? - var nonSpace = false; // Is there a non-space char on the current line? - - // Strips all whitespace tokens array for the current line - // if there was a {{#tag}} on it and otherwise only space. - function stripSpace () { - if (hasTag && !nonSpace) { - while (spaces.length) - delete tokens[spaces.pop()]; - } else { - spaces = []; - } - - hasTag = false; - nonSpace = false; - } - - var openingTagRe, closingTagRe, closingCurlyRe; - function compileTags (tagsToCompile) { - if (typeof tagsToCompile === 'string') - tagsToCompile = tagsToCompile.split(spaceRe, 2); - - if (!isArray(tagsToCompile) || tagsToCompile.length !== 2) - throw new Error('Invalid tags: ' + tagsToCompile); - - openingTagRe = new RegExp(escapeRegExp(tagsToCompile[0]) + '\\s*'); - closingTagRe = new RegExp('\\s*' + escapeRegExp(tagsToCompile[1])); - closingCurlyRe = new RegExp('\\s*' + escapeRegExp('}' + tagsToCompile[1])); - } - - compileTags(tags || mustache.tags); - - var scanner = new Scanner(template); - - var start, type, value, chr, token, openSection; - while (!scanner.eos()) { - start = scanner.pos; - - // Match any text between tags. - value = scanner.scanUntil(openingTagRe); - - if (value) { - for (var i = 0, valueLength = value.length; i < valueLength; ++i) { - chr = value.charAt(i); - - if (isWhitespace(chr)) { - spaces.push(tokens.length); - } else { - nonSpace = true; - } - - tokens.push([ 'text', chr, start, start + 1 ]); - start += 1; - - // Check for whitespace on the current line. - if (chr === '\n') - stripSpace(); - } - } - - // Match the opening tag. - if (!scanner.scan(openingTagRe)) - break; - - hasTag = true; - - // Get the tag type. - type = scanner.scan(tagRe) || 'name'; - scanner.scan(whiteRe); - - // Get the tag value. - if (type === '=') { - value = scanner.scanUntil(equalsRe); - scanner.scan(equalsRe); - scanner.scanUntil(closingTagRe); - } else if (type === '{') { - value = scanner.scanUntil(closingCurlyRe); - scanner.scan(curlyRe); - scanner.scanUntil(closingTagRe); - type = '&'; - } else { - value = scanner.scanUntil(closingTagRe); - } - - // Match the closing tag. - if (!scanner.scan(closingTagRe)) - throw new Error('Unclosed tag at ' + scanner.pos); - - token = [ type, value, start, scanner.pos ]; - tokens.push(token); - - if (type === '#' || type === '^') { - sections.push(token); - } else if (type === '/') { - // Check section nesting. - openSection = sections.pop(); - - if (!openSection) - throw new Error('Unopened section "' + value + '" at ' + start); - - if (openSection[1] !== value) - throw new Error('Unclosed section "' + openSection[1] + '" at ' + start); - } else if (type === 'name' || type === '{' || type === '&') { - nonSpace = true; - } else if (type === '=') { - // Set the tags for the next time around. - compileTags(value); - } - } - - // Make sure there are no open sections when we're done. - openSection = sections.pop(); - - if (openSection) - throw new Error('Unclosed section "' + openSection[1] + '" at ' + scanner.pos); - - return nestTokens(squashTokens(tokens)); - } - - /** - * Combines the values of consecutive text tokens in the given `tokens` array - * to a single token. - */ - function squashTokens (tokens) { - var squashedTokens = []; - - var token, lastToken; - for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) { - token = tokens[i]; - - if (token) { - if (token[0] === 'text' && lastToken && lastToken[0] === 'text') { - lastToken[1] += token[1]; - lastToken[3] = token[3]; - } else { - squashedTokens.push(token); - lastToken = token; - } - } - } - - return squashedTokens; - } - - /** - * Forms the given array of `tokens` into a nested tree structure where - * tokens that represent a section have two additional items: 1) an array of - * all tokens that appear in that section and 2) the index in the original - * template that represents the end of that section. - */ - function nestTokens (tokens) { - var nestedTokens = []; - var collector = nestedTokens; - var sections = []; - - var token, section; - for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) { - token = tokens[i]; - - switch (token[0]) { - case '#': - case '^': - collector.push(token); - sections.push(token); - collector = token[4] = []; - break; - case '/': - section = sections.pop(); - section[5] = token[2]; - collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens; - break; - default: - collector.push(token); - } - } - - return nestedTokens; - } - - /** - * A simple string scanner that is used by the template parser to find - * tokens in template strings. - */ - function Scanner (string) { - this.string = string; - this.tail = string; - this.pos = 0; - } - - /** - * Returns `true` if the tail is empty (end of string). - */ - Scanner.prototype.eos = function eos () { - return this.tail === ''; - }; - - /** - * Tries to match the given regular expression at the current position. - * Returns the matched text if it can match, the empty string otherwise. - */ - Scanner.prototype.scan = function scan (re) { - var match = this.tail.match(re); - - if (!match || match.index !== 0) - return ''; - - var string = match[0]; - - this.tail = this.tail.substring(string.length); - this.pos += string.length; - - return string; - }; - - /** - * Skips all text until the given regular expression can be matched. Returns - * the skipped string, which is the entire tail if no match can be made. - */ - Scanner.prototype.scanUntil = function scanUntil (re) { - var index = this.tail.search(re), match; - - switch (index) { - case -1: - match = this.tail; - this.tail = ''; - break; - case 0: - match = ''; - break; - default: - match = this.tail.substring(0, index); - this.tail = this.tail.substring(index); - } - - this.pos += match.length; - - return match; - }; - - /** - * Represents a rendering context by wrapping a view object and - * maintaining a reference to the parent context. - */ - function Context (view, parentContext) { - this.view = view; - this.cache = { '.': this.view }; - this.parent = parentContext; - } - - /** - * Creates a new context using the given view with this context - * as the parent. - */ - Context.prototype.push = function push (view) { - return new Context(view, this); - }; - - /** - * Returns the value of the given name in this context, traversing - * up the context hierarchy if the value is absent in this context's view. - */ - Context.prototype.lookup = function lookup (name) { - var cache = this.cache; - - var value; - if (cache.hasOwnProperty(name)) { - value = cache[name]; - } else { - var context = this, intermediateValue, names, index, lookupHit = false; - - while (context) { - if (name.indexOf('.') > 0) { - intermediateValue = context.view; - names = name.split('.'); - index = 0; - - /** - * Using the dot notion path in `name`, we descend through the - * nested objects. - * - * To be certain that the lookup has been successful, we have to - * check if the last object in the path actually has the property - * we are looking for. We store the result in `lookupHit`. - * - * This is specially necessary for when the value has been set to - * `undefined` and we want to avoid looking up parent contexts. - * - * In the case where dot notation is used, we consider the lookup - * to be successful even if the last "object" in the path is - * not actually an object but a primitive (e.g., a string, or an - * integer), because it is sometimes useful to access a property - * of an autoboxed primitive, such as the length of a string. - **/ - while (intermediateValue != null && index < names.length) { - if (index === names.length - 1) - lookupHit = ( - hasProperty(intermediateValue, names[index]) - || primitiveHasOwnProperty(intermediateValue, names[index]) - ); - - intermediateValue = intermediateValue[names[index++]]; - } - } else { - intermediateValue = context.view[name]; - - /** - * Only checking against `hasProperty`, which always returns `false` if - * `context.view` is not an object. Deliberately omitting the check - * against `primitiveHasOwnProperty` if dot notation is not used. - * - * Consider this example: - * ``` - * Mustache.render("The length of a football field is {{#length}}{{length}}{{/length}}.", {length: "100 yards"}) - * ``` - * - * If we were to check also against `primitiveHasOwnProperty`, as we do - * in the dot notation case, then render call would return: - * - * "The length of a football field is 9." - * - * rather than the expected: - * - * "The length of a football field is 100 yards." - **/ - lookupHit = hasProperty(context.view, name); - } - - if (lookupHit) { - value = intermediateValue; - break; - } - - context = context.parent; - } - - cache[name] = value; - } - - if (isFunction(value)) - value = value.call(this.view); - - return value; - }; - - /** - * A Writer knows how to take a stream of tokens and render them to a - * string, given a context. It also maintains a cache of templates to - * avoid the need to parse the same template twice. - */ - function Writer () { - this.cache = {}; - } - - /** - * Clears all cached templates in this writer. - */ - Writer.prototype.clearCache = function clearCache () { - this.cache = {}; - }; - - /** - * Parses and caches the given `template` according to the given `tags` or - * `mustache.tags` if `tags` is omitted, and returns the array of tokens - * that is generated from the parse. - */ - Writer.prototype.parse = function parse (template, tags) { - var cache = this.cache; - var cacheKey = template + ':' + (tags || mustache.tags).join(':'); - var tokens = cache[cacheKey]; - - if (tokens == null) - tokens = cache[cacheKey] = parseTemplate(template, tags); - - return tokens; - }; - - /** - * High-level method that is used to render the given `template` with - * the given `view`. - * - * The optional `partials` argument may be an object that contains the - * names and templates of partials that are used in the template. It may - * also be a function that is used to load partial templates on the fly - * that takes a single argument: the name of the partial. - * - * If the optional `tags` argument is given here it must be an array with two - * string values: the opening and closing tags used in the template (e.g. - * [ "<%", "%>" ]). The default is to mustache.tags. - */ - Writer.prototype.render = function render (template, view, partials, tags) { - var tokens = this.parse(template, tags); - var context = (view instanceof Context) ? view : new Context(view); - return this.renderTokens(tokens, context, partials, template, tags); - }; - - /** - * Low-level method that renders the given array of `tokens` using - * the given `context` and `partials`. - * - * Note: The `originalTemplate` is only ever used to extract the portion - * of the original template that was contained in a higher-order section. - * If the template doesn't use higher-order sections, this argument may - * be omitted. - */ - Writer.prototype.renderTokens = function renderTokens (tokens, context, partials, originalTemplate, tags) { - var buffer = ''; - - var token, symbol, value; - for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) { - value = undefined; - token = tokens[i]; - symbol = token[0]; - - if (symbol === '#') value = this.renderSection(token, context, partials, originalTemplate); - else if (symbol === '^') value = this.renderInverted(token, context, partials, originalTemplate); - else if (symbol === '>') value = this.renderPartial(token, context, partials, tags); - else if (symbol === '&') value = this.unescapedValue(token, context); - else if (symbol === 'name') value = this.escapedValue(token, context); - else if (symbol === 'text') value = this.rawValue(token); - - if (value !== undefined) - buffer += value; - } - - return buffer; - }; - - Writer.prototype.renderSection = function renderSection (token, context, partials, originalTemplate) { - var self = this; - var buffer = ''; - var value = context.lookup(token[1]); - - // This function is used to render an arbitrary template - // in the current context by higher-order sections. - function subRender (template) { - return self.render(template, context, partials); - } - - if (!value) return; - - if (isArray(value)) { - for (var j = 0, valueLength = value.length; j < valueLength; ++j) { - buffer += this.renderTokens(token[4], context.push(value[j]), partials, originalTemplate); - } - } else if (typeof value === 'object' || typeof value === 'string' || typeof value === 'number') { - buffer += this.renderTokens(token[4], context.push(value), partials, originalTemplate); - } else if (isFunction(value)) { - if (typeof originalTemplate !== 'string') - throw new Error('Cannot use higher-order sections without the original template'); - - // Extract the portion of the original template that the section contains. - value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender); - - if (value != null) - buffer += value; - } else { - buffer += this.renderTokens(token[4], context, partials, originalTemplate); - } - return buffer; - }; - - Writer.prototype.renderInverted = function renderInverted (token, context, partials, originalTemplate) { - var value = context.lookup(token[1]); - - // Use JavaScript's definition of falsy. Include empty arrays. - // See https://github.com/janl/mustache.js/issues/186 - if (!value || (isArray(value) && value.length === 0)) - return this.renderTokens(token[4], context, partials, originalTemplate); - }; - - Writer.prototype.renderPartial = function renderPartial (token, context, partials, tags) { - if (!partials) return; - - var value = isFunction(partials) ? partials(token[1]) : partials[token[1]]; - if (value != null) - return this.renderTokens(this.parse(value, tags), context, partials, value); - }; - - Writer.prototype.unescapedValue = function unescapedValue (token, context) { - var value = context.lookup(token[1]); - if (value != null) - return value; - }; - - Writer.prototype.escapedValue = function escapedValue (token, context) { - var value = context.lookup(token[1]); - if (value != null) - return mustache.escape(value); - }; - - Writer.prototype.rawValue = function rawValue (token) { - return token[1]; - }; - - mustache.name = 'mustache.js'; - mustache.version = '3.0.1'; - mustache.tags = [ '{{', '}}' ]; - - // All high-level mustache.* functions use this writer. - var defaultWriter = new Writer(); - - /** - * Clears all cached templates in the default writer. - */ - mustache.clearCache = function clearCache () { - return defaultWriter.clearCache(); - }; - - /** - * Parses and caches the given template in the default writer and returns the - * array of tokens it contains. Doing this ahead of time avoids the need to - * parse templates on the fly as they are rendered. - */ - mustache.parse = function parse (template, tags) { - return defaultWriter.parse(template, tags); - }; - - /** - * Renders the `template` with the given `view` and `partials` using the - * default writer. If the optional `tags` argument is given here it must be an - * array with two string values: the opening and closing tags used in the - * template (e.g. [ "<%", "%>" ]). The default is to mustache.tags. - */ - mustache.render = function render (template, view, partials, tags) { - if (typeof template !== 'string') { - throw new TypeError('Invalid template! Template should be a "string" ' + - 'but "' + typeStr(template) + '" was given as the first ' + - 'argument for mustache#render(template, view, partials)'); - } - - return defaultWriter.render(template, view, partials, tags); - }; - - // This is here for backwards compatibility with 0.4.x., - /*eslint-disable */ // eslint wants camel cased function name - mustache.to_html = function to_html (template, view, partials, send) { - /*eslint-enable*/ - - var result = mustache.render(template, view, partials); - - if (isFunction(send)) { - send(result); - } else { - return result; - } - }; - - // Export the escaping function so that the user may override it. - // See https://github.com/janl/mustache.js/issues/244 - mustache.escape = escapeHtml; - - // Export these mainly for testing, but also for advanced usage. - mustache.Scanner = Scanner; - mustache.Context = Context; - mustache.Writer = Writer; - - return mustache; -})); diff --git a/lib/mustache/3.0.1/mustache.min.js b/lib/mustache/3.0.1/mustache.min.js deleted file mode 100644 index 7ad4c00..0000000 --- a/lib/mustache/3.0.1/mustache.min.js +++ /dev/null @@ -1 +0,0 @@ -(function defineMustache(global,factory){if(typeof exports==="object"&&exports&&typeof exports.nodeName!=="string"){factory(exports)}else if(typeof define==="function"&&define.amd){define(["exports"],factory)}else{global.Mustache={};factory(global.Mustache)}})(this,function mustacheFactory(mustache){var objectToString=Object.prototype.toString;var isArray=Array.isArray||function isArrayPolyfill(object){return objectToString.call(object)==="[object Array]"};function isFunction(object){return typeof object==="function"}function typeStr(obj){return isArray(obj)?"array":typeof obj}function escapeRegExp(string){return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function hasProperty(obj,propName){return obj!=null&&typeof obj==="object"&&propName in obj}function primitiveHasOwnProperty(primitive,propName){return primitive!=null&&typeof primitive!=="object"&&primitive.hasOwnProperty&&primitive.hasOwnProperty(propName)}var regExpTest=RegExp.prototype.test;function testRegExp(re,string){return regExpTest.call(re,string)}var nonSpaceRe=/\S/;function isWhitespace(string){return!testRegExp(nonSpaceRe,string)}var entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function escapeHtml(string){return String(string).replace(/[&<>"'`=\/]/g,function fromEntityMap(s){return entityMap[s]})}var whiteRe=/\s*/;var spaceRe=/\s+/;var equalsRe=/\s*=/;var curlyRe=/\s*\}/;var tagRe=/#|\^|\/|>|\{|&|=|!/;function parseTemplate(template,tags){if(!template)return[];var sections=[];var tokens=[];var spaces=[];var hasTag=false;var nonSpace=false;function stripSpace(){if(hasTag&&!nonSpace){while(spaces.length)delete tokens[spaces.pop()]}else{spaces=[]}hasTag=false;nonSpace=false}var openingTagRe,closingTagRe,closingCurlyRe;function compileTags(tagsToCompile){if(typeof tagsToCompile==="string")tagsToCompile=tagsToCompile.split(spaceRe,2);if(!isArray(tagsToCompile)||tagsToCompile.length!==2)throw new Error("Invalid tags: "+tagsToCompile);openingTagRe=new RegExp(escapeRegExp(tagsToCompile[0])+"\\s*");closingTagRe=new RegExp("\\s*"+escapeRegExp(tagsToCompile[1]));closingCurlyRe=new RegExp("\\s*"+escapeRegExp("}"+tagsToCompile[1]))}compileTags(tags||mustache.tags);var scanner=new Scanner(template);var start,type,value,chr,token,openSection;while(!scanner.eos()){start=scanner.pos;value=scanner.scanUntil(openingTagRe);if(value){for(var i=0,valueLength=value.length;i0?sections[sections.length-1][4]:nestedTokens;break;default:collector.push(token)}}return nestedTokens}function Scanner(string){this.string=string;this.tail=string;this.pos=0}Scanner.prototype.eos=function eos(){return this.tail===""};Scanner.prototype.scan=function scan(re){var match=this.tail.match(re);if(!match||match.index!==0)return"";var string=match[0];this.tail=this.tail.substring(string.length);this.pos+=string.length;return string};Scanner.prototype.scanUntil=function scanUntil(re){var index=this.tail.search(re),match;switch(index){case-1:match=this.tail;this.tail="";break;case 0:match="";break;default:match=this.tail.substring(0,index);this.tail=this.tail.substring(index)}this.pos+=match.length;return match};function Context(view,parentContext){this.view=view;this.cache={".":this.view};this.parent=parentContext}Context.prototype.push=function push(view){return new Context(view,this)};Context.prototype.lookup=function lookup(name){var cache=this.cache;var value;if(cache.hasOwnProperty(name)){value=cache[name]}else{var context=this,intermediateValue,names,index,lookupHit=false;while(context){if(name.indexOf(".")>0){intermediateValue=context.view;names=name.split(".");index=0;while(intermediateValue!=null&&index")value=this.renderPartial(token,context,partials,tags);else if(symbol==="&")value=this.unescapedValue(token,context);else if(symbol==="name")value=this.escapedValue(token,context);else if(symbol==="text")value=this.rawValue(token);if(value!==undefined)buffer+=value}return buffer};Writer.prototype.renderSection=function renderSection(token,context,partials,originalTemplate){var self=this;var buffer="";var value=context.lookup(token[1]);function subRender(template){return self.render(template,context,partials)}if(!value)return;if(isArray(value)){for(var j=0,valueLength=value.length;j @janl => @aq - -See http://github.com/defunkt/mustache for more info. -*/ - -;(function($) { - diff --git a/lib/mustache/mustache.js b/lib/mustache/mustache.js deleted file mode 100644 index 8ec1b44..0000000 --- a/lib/mustache/mustache.js +++ /dev/null @@ -1,682 +0,0 @@ -/*! - * mustache.js - Logic-less {{mustache}} templates with JavaScript - * http://github.com/janl/mustache.js - */ - -/*global define: false Mustache: true*/ - -(function defineMustache (global, factory) { - if (typeof exports === 'object' && exports && typeof exports.nodeName !== 'string') { - factory(exports); // CommonJS - } else if (typeof define === 'function' && define.amd) { - define(['exports'], factory); // AMD - } else { - global.Mustache = {}; - factory(global.Mustache); // script, wsh, asp - } -}(this, function mustacheFactory (mustache) { - - var objectToString = Object.prototype.toString; - var isArray = Array.isArray || function isArrayPolyfill (object) { - return objectToString.call(object) === '[object Array]'; - }; - - function isFunction (object) { - return typeof object === 'function'; - } - - /** - * More correct typeof string handling array - * which normally returns typeof 'object' - */ - function typeStr (obj) { - return isArray(obj) ? 'array' : typeof obj; - } - - function escapeRegExp (string) { - return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&'); - } - - /** - * Null safe way of checking whether or not an object, - * including its prototype, has a given property - */ - function hasProperty (obj, propName) { - return obj != null && typeof obj === 'object' && (propName in obj); - } - - /** - * Safe way of detecting whether or not the given thing is a primitive and - * whether it has the given property - */ - function primitiveHasOwnProperty (primitive, propName) { - return ( - primitive != null - && typeof primitive !== 'object' - && primitive.hasOwnProperty - && primitive.hasOwnProperty(propName) - ); - } - - // Workaround for https://issues.apache.org/jira/browse/COUCHDB-577 - // See https://github.com/janl/mustache.js/issues/189 - var regExpTest = RegExp.prototype.test; - function testRegExp (re, string) { - return regExpTest.call(re, string); - } - - var nonSpaceRe = /\S/; - function isWhitespace (string) { - return !testRegExp(nonSpaceRe, string); - } - - var entityMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '/': '/', - '`': '`', - '=': '=' - }; - - function escapeHtml (string) { - return String(string).replace(/[&<>"'`=\/]/g, function fromEntityMap (s) { - return entityMap[s]; - }); - } - - var whiteRe = /\s*/; - var spaceRe = /\s+/; - var equalsRe = /\s*=/; - var curlyRe = /\s*\}/; - var tagRe = /#|\^|\/|>|\{|&|=|!/; - - /** - * Breaks up the given `template` string into a tree of tokens. If the `tags` - * argument is given here it must be an array with two string values: the - * opening and closing tags used in the template (e.g. [ "<%", "%>" ]). Of - * course, the default is to use mustaches (i.e. mustache.tags). - * - * A token is an array with at least 4 elements. The first element is the - * mustache symbol that was used inside the tag, e.g. "#" or "&". If the tag - * did not contain a symbol (i.e. {{myValue}}) this element is "name". For - * all text that appears outside a symbol this element is "text". - * - * The second element of a token is its "value". For mustache tags this is - * whatever else was inside the tag besides the opening symbol. For text tokens - * this is the text itself. - * - * The third and fourth elements of the token are the start and end indices, - * respectively, of the token in the original template. - * - * Tokens that are the root node of a subtree contain two more elements: 1) an - * array of tokens in the subtree and 2) the index in the original template at - * which the closing tag for that section begins. - */ - function parseTemplate (template, tags) { - if (!template) - return []; - - var sections = []; // Stack to hold section tokens - var tokens = []; // Buffer to hold the tokens - var spaces = []; // Indices of whitespace tokens on the current line - var hasTag = false; // Is there a {{tag}} on the current line? - var nonSpace = false; // Is there a non-space char on the current line? - - // Strips all whitespace tokens array for the current line - // if there was a {{#tag}} on it and otherwise only space. - function stripSpace () { - if (hasTag && !nonSpace) { - while (spaces.length) - delete tokens[spaces.pop()]; - } else { - spaces = []; - } - - hasTag = false; - nonSpace = false; - } - - var openingTagRe, closingTagRe, closingCurlyRe; - function compileTags (tagsToCompile) { - if (typeof tagsToCompile === 'string') - tagsToCompile = tagsToCompile.split(spaceRe, 2); - - if (!isArray(tagsToCompile) || tagsToCompile.length !== 2) - throw new Error('Invalid tags: ' + tagsToCompile); - - openingTagRe = new RegExp(escapeRegExp(tagsToCompile[0]) + '\\s*'); - closingTagRe = new RegExp('\\s*' + escapeRegExp(tagsToCompile[1])); - closingCurlyRe = new RegExp('\\s*' + escapeRegExp('}' + tagsToCompile[1])); - } - - compileTags(tags || mustache.tags); - - var scanner = new Scanner(template); - - var start, type, value, chr, token, openSection; - while (!scanner.eos()) { - start = scanner.pos; - - // Match any text between tags. - value = scanner.scanUntil(openingTagRe); - - if (value) { - for (var i = 0, valueLength = value.length; i < valueLength; ++i) { - chr = value.charAt(i); - - if (isWhitespace(chr)) { - spaces.push(tokens.length); - } else { - nonSpace = true; - } - - tokens.push([ 'text', chr, start, start + 1 ]); - start += 1; - - // Check for whitespace on the current line. - if (chr === '\n') - stripSpace(); - } - } - - // Match the opening tag. - if (!scanner.scan(openingTagRe)) - break; - - hasTag = true; - - // Get the tag type. - type = scanner.scan(tagRe) || 'name'; - scanner.scan(whiteRe); - - // Get the tag value. - if (type === '=') { - value = scanner.scanUntil(equalsRe); - scanner.scan(equalsRe); - scanner.scanUntil(closingTagRe); - } else if (type === '{') { - value = scanner.scanUntil(closingCurlyRe); - scanner.scan(curlyRe); - scanner.scanUntil(closingTagRe); - type = '&'; - } else { - value = scanner.scanUntil(closingTagRe); - } - - // Match the closing tag. - if (!scanner.scan(closingTagRe)) - throw new Error('Unclosed tag at ' + scanner.pos); - - token = [ type, value, start, scanner.pos ]; - tokens.push(token); - - if (type === '#' || type === '^') { - sections.push(token); - } else if (type === '/') { - // Check section nesting. - openSection = sections.pop(); - - if (!openSection) - throw new Error('Unopened section "' + value + '" at ' + start); - - if (openSection[1] !== value) - throw new Error('Unclosed section "' + openSection[1] + '" at ' + start); - } else if (type === 'name' || type === '{' || type === '&') { - nonSpace = true; - } else if (type === '=') { - // Set the tags for the next time around. - compileTags(value); - } - } - - // Make sure there are no open sections when we're done. - openSection = sections.pop(); - - if (openSection) - throw new Error('Unclosed section "' + openSection[1] + '" at ' + scanner.pos); - - return nestTokens(squashTokens(tokens)); - } - - /** - * Combines the values of consecutive text tokens in the given `tokens` array - * to a single token. - */ - function squashTokens (tokens) { - var squashedTokens = []; - - var token, lastToken; - for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) { - token = tokens[i]; - - if (token) { - if (token[0] === 'text' && lastToken && lastToken[0] === 'text') { - lastToken[1] += token[1]; - lastToken[3] = token[3]; - } else { - squashedTokens.push(token); - lastToken = token; - } - } - } - - return squashedTokens; - } - - /** - * Forms the given array of `tokens` into a nested tree structure where - * tokens that represent a section have two additional items: 1) an array of - * all tokens that appear in that section and 2) the index in the original - * template that represents the end of that section. - */ - function nestTokens (tokens) { - var nestedTokens = []; - var collector = nestedTokens; - var sections = []; - - var token, section; - for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) { - token = tokens[i]; - - switch (token[0]) { - case '#': - case '^': - collector.push(token); - sections.push(token); - collector = token[4] = []; - break; - case '/': - section = sections.pop(); - section[5] = token[2]; - collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens; - break; - default: - collector.push(token); - } - } - - return nestedTokens; - } - - /** - * A simple string scanner that is used by the template parser to find - * tokens in template strings. - */ - function Scanner (string) { - this.string = string; - this.tail = string; - this.pos = 0; - } - - /** - * Returns `true` if the tail is empty (end of string). - */ - Scanner.prototype.eos = function eos () { - return this.tail === ''; - }; - - /** - * Tries to match the given regular expression at the current position. - * Returns the matched text if it can match, the empty string otherwise. - */ - Scanner.prototype.scan = function scan (re) { - var match = this.tail.match(re); - - if (!match || match.index !== 0) - return ''; - - var string = match[0]; - - this.tail = this.tail.substring(string.length); - this.pos += string.length; - - return string; - }; - - /** - * Skips all text until the given regular expression can be matched. Returns - * the skipped string, which is the entire tail if no match can be made. - */ - Scanner.prototype.scanUntil = function scanUntil (re) { - var index = this.tail.search(re), match; - - switch (index) { - case -1: - match = this.tail; - this.tail = ''; - break; - case 0: - match = ''; - break; - default: - match = this.tail.substring(0, index); - this.tail = this.tail.substring(index); - } - - this.pos += match.length; - - return match; - }; - - /** - * Represents a rendering context by wrapping a view object and - * maintaining a reference to the parent context. - */ - function Context (view, parentContext) { - this.view = view; - this.cache = { '.': this.view }; - this.parent = parentContext; - } - - /** - * Creates a new context using the given view with this context - * as the parent. - */ - Context.prototype.push = function push (view) { - return new Context(view, this); - }; - - /** - * Returns the value of the given name in this context, traversing - * up the context hierarchy if the value is absent in this context's view. - */ - Context.prototype.lookup = function lookup (name) { - var cache = this.cache; - - var value; - if (cache.hasOwnProperty(name)) { - value = cache[name]; - } else { - var context = this, intermediateValue, names, index, lookupHit = false; - - while (context) { - if (name.indexOf('.') > 0) { - intermediateValue = context.view; - names = name.split('.'); - index = 0; - - /** - * Using the dot notion path in `name`, we descend through the - * nested objects. - * - * To be certain that the lookup has been successful, we have to - * check if the last object in the path actually has the property - * we are looking for. We store the result in `lookupHit`. - * - * This is specially necessary for when the value has been set to - * `undefined` and we want to avoid looking up parent contexts. - * - * In the case where dot notation is used, we consider the lookup - * to be successful even if the last "object" in the path is - * not actually an object but a primitive (e.g., a string, or an - * integer), because it is sometimes useful to access a property - * of an autoboxed primitive, such as the length of a string. - **/ - while (intermediateValue != null && index < names.length) { - if (index === names.length - 1) - lookupHit = ( - hasProperty(intermediateValue, names[index]) - || primitiveHasOwnProperty(intermediateValue, names[index]) - ); - - intermediateValue = intermediateValue[names[index++]]; - } - } else { - intermediateValue = context.view[name]; - - /** - * Only checking against `hasProperty`, which always returns `false` if - * `context.view` is not an object. Deliberately omitting the check - * against `primitiveHasOwnProperty` if dot notation is not used. - * - * Consider this example: - * ``` - * Mustache.render("The length of a football field is {{#length}}{{length}}{{/length}}.", {length: "100 yards"}) - * ``` - * - * If we were to check also against `primitiveHasOwnProperty`, as we do - * in the dot notation case, then render call would return: - * - * "The length of a football field is 9." - * - * rather than the expected: - * - * "The length of a football field is 100 yards." - **/ - lookupHit = hasProperty(context.view, name); - } - - if (lookupHit) { - value = intermediateValue; - break; - } - - context = context.parent; - } - - cache[name] = value; - } - - if (isFunction(value)) - value = value.call(this.view); - - return value; - }; - - /** - * A Writer knows how to take a stream of tokens and render them to a - * string, given a context. It also maintains a cache of templates to - * avoid the need to parse the same template twice. - */ - function Writer () { - this.cache = {}; - } - - /** - * Clears all cached templates in this writer. - */ - Writer.prototype.clearCache = function clearCache () { - this.cache = {}; - }; - - /** - * Parses and caches the given `template` according to the given `tags` or - * `mustache.tags` if `tags` is omitted, and returns the array of tokens - * that is generated from the parse. - */ - Writer.prototype.parse = function parse (template, tags) { - var cache = this.cache; - var cacheKey = template + ':' + (tags || mustache.tags).join(':'); - var tokens = cache[cacheKey]; - - if (tokens == null) - tokens = cache[cacheKey] = parseTemplate(template, tags); - - return tokens; - }; - - /** - * High-level method that is used to render the given `template` with - * the given `view`. - * - * The optional `partials` argument may be an object that contains the - * names and templates of partials that are used in the template. It may - * also be a function that is used to load partial templates on the fly - * that takes a single argument: the name of the partial. - * - * If the optional `tags` argument is given here it must be an array with two - * string values: the opening and closing tags used in the template (e.g. - * [ "<%", "%>" ]). The default is to mustache.tags. - */ - Writer.prototype.render = function render (template, view, partials, tags) { - var tokens = this.parse(template, tags); - var context = (view instanceof Context) ? view : new Context(view); - return this.renderTokens(tokens, context, partials, template, tags); - }; - - /** - * Low-level method that renders the given array of `tokens` using - * the given `context` and `partials`. - * - * Note: The `originalTemplate` is only ever used to extract the portion - * of the original template that was contained in a higher-order section. - * If the template doesn't use higher-order sections, this argument may - * be omitted. - */ - Writer.prototype.renderTokens = function renderTokens (tokens, context, partials, originalTemplate, tags) { - var buffer = ''; - - var token, symbol, value; - for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) { - value = undefined; - token = tokens[i]; - symbol = token[0]; - - if (symbol === '#') value = this.renderSection(token, context, partials, originalTemplate); - else if (symbol === '^') value = this.renderInverted(token, context, partials, originalTemplate); - else if (symbol === '>') value = this.renderPartial(token, context, partials, tags); - else if (symbol === '&') value = this.unescapedValue(token, context); - else if (symbol === 'name') value = this.escapedValue(token, context); - else if (symbol === 'text') value = this.rawValue(token); - - if (value !== undefined) - buffer += value; - } - - return buffer; - }; - - Writer.prototype.renderSection = function renderSection (token, context, partials, originalTemplate) { - var self = this; - var buffer = ''; - var value = context.lookup(token[1]); - - // This function is used to render an arbitrary template - // in the current context by higher-order sections. - function subRender (template) { - return self.render(template, context, partials); - } - - if (!value) return; - - if (isArray(value)) { - for (var j = 0, valueLength = value.length; j < valueLength; ++j) { - buffer += this.renderTokens(token[4], context.push(value[j]), partials, originalTemplate); - } - } else if (typeof value === 'object' || typeof value === 'string' || typeof value === 'number') { - buffer += this.renderTokens(token[4], context.push(value), partials, originalTemplate); - } else if (isFunction(value)) { - if (typeof originalTemplate !== 'string') - throw new Error('Cannot use higher-order sections without the original template'); - - // Extract the portion of the original template that the section contains. - value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender); - - if (value != null) - buffer += value; - } else { - buffer += this.renderTokens(token[4], context, partials, originalTemplate); - } - return buffer; - }; - - Writer.prototype.renderInverted = function renderInverted (token, context, partials, originalTemplate) { - var value = context.lookup(token[1]); - - // Use JavaScript's definition of falsy. Include empty arrays. - // See https://github.com/janl/mustache.js/issues/186 - if (!value || (isArray(value) && value.length === 0)) - return this.renderTokens(token[4], context, partials, originalTemplate); - }; - - Writer.prototype.renderPartial = function renderPartial (token, context, partials, tags) { - if (!partials) return; - - var value = isFunction(partials) ? partials(token[1]) : partials[token[1]]; - if (value != null) - return this.renderTokens(this.parse(value, tags), context, partials, value); - }; - - Writer.prototype.unescapedValue = function unescapedValue (token, context) { - var value = context.lookup(token[1]); - if (value != null) - return value; - }; - - Writer.prototype.escapedValue = function escapedValue (token, context) { - var value = context.lookup(token[1]); - if (value != null) - return mustache.escape(value); - }; - - Writer.prototype.rawValue = function rawValue (token) { - return token[1]; - }; - - mustache.name = 'mustache.js'; - mustache.version = '3.0.1'; - mustache.tags = [ '{{', '}}' ]; - - // All high-level mustache.* functions use this writer. - var defaultWriter = new Writer(); - - /** - * Clears all cached templates in the default writer. - */ - mustache.clearCache = function clearCache () { - return defaultWriter.clearCache(); - }; - - /** - * Parses and caches the given template in the default writer and returns the - * array of tokens it contains. Doing this ahead of time avoids the need to - * parse templates on the fly as they are rendered. - */ - mustache.parse = function parse (template, tags) { - return defaultWriter.parse(template, tags); - }; - - /** - * Renders the `template` with the given `view` and `partials` using the - * default writer. If the optional `tags` argument is given here it must be an - * array with two string values: the opening and closing tags used in the - * template (e.g. [ "<%", "%>" ]). The default is to mustache.tags. - */ - mustache.render = function render (template, view, partials, tags) { - if (typeof template !== 'string') { - throw new TypeError('Invalid template! Template should be a "string" ' + - 'but "' + typeStr(template) + '" was given as the first ' + - 'argument for mustache#render(template, view, partials)'); - } - - return defaultWriter.render(template, view, partials, tags); - }; - - // This is here for backwards compatibility with 0.4.x., - /*eslint-disable */ // eslint wants camel cased function name - mustache.to_html = function to_html (template, view, partials, send) { - /*eslint-enable*/ - - var result = mustache.render(template, view, partials); - - if (isFunction(send)) { - send(result); - } else { - return result; - } - }; - - // Export the escaping function so that the user may override it. - // See https://github.com/janl/mustache.js/issues/244 - mustache.escape = escapeHtml; - - // Export these mainly for testing, but also for advanced usage. - mustache.Scanner = Scanner; - mustache.Context = Context; - mustache.Writer = Writer; - - return mustache; -})); diff --git a/lib/navigo/index.js b/lib/navigo/index.js deleted file mode 100644 index 7f8e6c7..0000000 --- a/lib/navigo/index.js +++ /dev/null @@ -1,1350 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define("Navigo", [], factory); - else if(typeof exports === 'object') - exports["Navigo"] = factory(); - else - root["Navigo"] = factory(); -})(typeof self !== 'undefined' ? self : this, function() { - return /******/ (function() { // webpackBootstrap - /******/ "use strict"; - /******/ var __webpack_modules__ = ({ - - /***/ "./src/Q.ts": - /*!******************!*\ - !*** ./src/Q.ts ***! - \******************/ - /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ "default": function() { return /* binding */ Q; } - /* harmony export */ }); - function Q(funcs, c, done) { - var context = c || {}; - var idx = 0; - - (function next() { - if (!funcs[idx]) { - if (done) { - done(context); - } - - return; - } - - if (Array.isArray(funcs[idx])) { - funcs.splice.apply(funcs, [idx, 1].concat(funcs[idx][0](context) ? funcs[idx][1] : funcs[idx][2])); - next(); - } else { - // console.log(funcs[idx].name + " / " + JSON.stringify(context)); - // console.log(funcs[idx].name); - funcs[idx](context, function (moveForward) { - if (typeof moveForward === "undefined" || moveForward === true) { - idx += 1; - next(); - } else if (done) { - done(context); - } - }); - } - })(); - } - - Q.if = function (condition, one, two) { - if (!Array.isArray(one)) one = [one]; - if (!Array.isArray(two)) two = [two]; - return [condition, one, two]; - }; - - /***/ }), - - /***/ "./src/constants.ts": - /*!**************************!*\ - !*** ./src/constants.ts ***! - \**************************/ - /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ "PARAMETER_REGEXP": function() { return /* binding */ PARAMETER_REGEXP; }, - /* harmony export */ "REPLACE_VARIABLE_REGEXP": function() { return /* binding */ REPLACE_VARIABLE_REGEXP; }, - /* harmony export */ "WILDCARD_REGEXP": function() { return /* binding */ WILDCARD_REGEXP; }, - /* harmony export */ "REPLACE_WILDCARD": function() { return /* binding */ REPLACE_WILDCARD; }, - /* harmony export */ "NOT_SURE_REGEXP": function() { return /* binding */ NOT_SURE_REGEXP; }, - /* harmony export */ "REPLACE_NOT_SURE": function() { return /* binding */ REPLACE_NOT_SURE; }, - /* harmony export */ "START_BY_SLASH_REGEXP": function() { return /* binding */ START_BY_SLASH_REGEXP; }, - /* harmony export */ "MATCH_REGEXP_FLAGS": function() { return /* binding */ MATCH_REGEXP_FLAGS; } - /* harmony export */ }); - var PARAMETER_REGEXP = /([:*])(\w+)/g; - var REPLACE_VARIABLE_REGEXP = "([^/]+)"; - var WILDCARD_REGEXP = /\*/g; - var REPLACE_WILDCARD = "?(?:.*)"; - var NOT_SURE_REGEXP = /\/\?/g; - var REPLACE_NOT_SURE = "/?([^/]+|)"; - var START_BY_SLASH_REGEXP = "(?:/^|^)"; - var MATCH_REGEXP_FLAGS = ""; - - /***/ }), - - /***/ "./src/index.ts": - /*!**********************!*\ - !*** ./src/index.ts ***! - \**********************/ - /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ "default": function() { return /* binding */ Navigo; } - /* harmony export */ }); - /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./src/utils.ts"); - /* harmony import */ var _Q__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Q */ "./src/Q.ts"); - /* harmony import */ var _middlewares_setLocationPath__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./middlewares/setLocationPath */ "./src/middlewares/setLocationPath.ts"); - /* harmony import */ var _middlewares_matchPathToRegisteredRoutes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./middlewares/matchPathToRegisteredRoutes */ "./src/middlewares/matchPathToRegisteredRoutes.ts"); - /* harmony import */ var _middlewares_checkForDeprecationMethods__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./middlewares/checkForDeprecationMethods */ "./src/middlewares/checkForDeprecationMethods.ts"); - /* harmony import */ var _middlewares_checkForForceOp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./middlewares/checkForForceOp */ "./src/middlewares/checkForForceOp.ts"); - /* harmony import */ var _middlewares_updateBrowserURL__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./middlewares/updateBrowserURL */ "./src/middlewares/updateBrowserURL.ts"); - /* harmony import */ var _middlewares_processMatches__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./middlewares/processMatches */ "./src/middlewares/processMatches.ts"); - /* harmony import */ var _middlewares_waitingList__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./middlewares/waitingList */ "./src/middlewares/waitingList.ts"); - /* harmony import */ var _lifecycles__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./lifecycles */ "./src/lifecycles.ts"); - function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - - - - - - - - - - - - var DEFAULT_LINK_SELECTOR = "[data-navigo]"; - function Navigo(appRoute, options) { - var DEFAULT_RESOLVE_OPTIONS = options || { - strategy: "ONE", - hash: false, - noMatchWarning: false, - linksSelector: DEFAULT_LINK_SELECTOR - }; - var self = this; - var root = "/"; - var current = null; - var routes = []; - var destroyed = false; - var genericHooks; - var isPushStateAvailable = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.pushStateAvailable)(); - var isWindowAvailable = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.windowAvailable)(); - - if (!appRoute) { - console.warn('Navigo requires a root path in its constructor. If not provided will use "/" as default.'); - } else { - root = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.clean)(appRoute); - } - - function _checkForAHash(url) { - if (url.indexOf("#") >= 0) { - if (DEFAULT_RESOLVE_OPTIONS.hash === true) { - url = url.split("#")[1] || "/"; - } else { - url = url.split("#")[0]; - } - } - - return url; - } - - function composePathWithRoot(path) { - return (0,_utils__WEBPACK_IMPORTED_MODULE_0__.clean)(root + "/" + (0,_utils__WEBPACK_IMPORTED_MODULE_0__.clean)(path)); - } - - function createRoute(path, handler, hooks, name) { - path = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.isString)(path) ? composePathWithRoot(path) : path; - return { - name: name || (0,_utils__WEBPACK_IMPORTED_MODULE_0__.clean)(String(path)), - path: path, - handler: handler, - hooks: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.accumulateHooks)(hooks) - }; - } // public APIs - - - function on(path, handler, hooks) { - var _this = this; - - if (typeof path === "object" && !(path instanceof RegExp)) { - Object.keys(path).forEach(function (p) { - if (typeof path[p] === "function") { - _this.on(p, path[p]); - } else { - var _path$p = path[p], - _handler = _path$p.uses, - name = _path$p.as, - _hooks = _path$p.hooks; - routes.push(createRoute(p, _handler, [genericHooks, _hooks], name)); - } - }); - return this; - } else if (typeof path === "function") { - hooks = handler; - handler = path; - path = root; - } - - routes.push(createRoute(path, handler, [genericHooks, hooks])); - return this; - } - - function resolve(to, options) { - if (self.__dirty) { - self.__waiting.push(function () { - return self.resolve(to, options); - }); - - return; - } else { - self.__dirty = true; - } - - to = to ? (0,_utils__WEBPACK_IMPORTED_MODULE_0__.clean)(root) + "/" + (0,_utils__WEBPACK_IMPORTED_MODULE_0__.clean)(to) : undefined; // console.log("-- resolve --> " + to, self.__dirty); - - var context = { - instance: self, - to: to, - currentLocationPath: to, - navigateOptions: {}, - resolveOptions: _extends({}, DEFAULT_RESOLVE_OPTIONS, options) - }; - (0,_Q__WEBPACK_IMPORTED_MODULE_1__.default)([_middlewares_setLocationPath__WEBPACK_IMPORTED_MODULE_2__.default, _middlewares_matchPathToRegisteredRoutes__WEBPACK_IMPORTED_MODULE_3__.default, _Q__WEBPACK_IMPORTED_MODULE_1__.default.if(function (_ref) { - var matches = _ref.matches; - return matches && matches.length > 0; - }, _middlewares_processMatches__WEBPACK_IMPORTED_MODULE_7__.default, _lifecycles__WEBPACK_IMPORTED_MODULE_9__.notFoundLifeCycle)], context, _middlewares_waitingList__WEBPACK_IMPORTED_MODULE_8__.default); - return context.matches ? context.matches : false; - } - - function navigate(to, navigateOptions) { - // console.log("-- navigate --> " + to, self.__dirty); - if (self.__dirty) { - self.__waiting.push(function () { - return self.navigate(to, navigateOptions); - }); - - return; - } else { - self.__dirty = true; - } - - to = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.clean)(root) + "/" + (0,_utils__WEBPACK_IMPORTED_MODULE_0__.clean)(to); - var context = { - instance: self, - to: to, - navigateOptions: navigateOptions || {}, - resolveOptions: navigateOptions && navigateOptions.resolveOptions ? navigateOptions.resolveOptions : DEFAULT_RESOLVE_OPTIONS, - currentLocationPath: _checkForAHash(to) - }; - (0,_Q__WEBPACK_IMPORTED_MODULE_1__.default)([_middlewares_checkForDeprecationMethods__WEBPACK_IMPORTED_MODULE_4__.default, _middlewares_checkForForceOp__WEBPACK_IMPORTED_MODULE_5__.default, _middlewares_matchPathToRegisteredRoutes__WEBPACK_IMPORTED_MODULE_3__.default, _Q__WEBPACK_IMPORTED_MODULE_1__.default.if(function (_ref2) { - var matches = _ref2.matches; - return matches && matches.length > 0; - }, _middlewares_processMatches__WEBPACK_IMPORTED_MODULE_7__.default, _lifecycles__WEBPACK_IMPORTED_MODULE_9__.notFoundLifeCycle), _middlewares_updateBrowserURL__WEBPACK_IMPORTED_MODULE_6__.default, _middlewares_waitingList__WEBPACK_IMPORTED_MODULE_8__.default], context, _middlewares_waitingList__WEBPACK_IMPORTED_MODULE_8__.default); - } - - function navigateByName(name, data, options) { - var url = generate(name, data); - - if (url !== null) { - navigate(url.replace(new RegExp("^/?" + root), ""), options); - return true; - } - - return false; - } - - function off(what) { - this.routes = routes = routes.filter(function (r) { - if ((0,_utils__WEBPACK_IMPORTED_MODULE_0__.isString)(what)) { - return (0,_utils__WEBPACK_IMPORTED_MODULE_0__.clean)(r.path) !== (0,_utils__WEBPACK_IMPORTED_MODULE_0__.clean)(what); - } else if ((0,_utils__WEBPACK_IMPORTED_MODULE_0__.isFunction)(what)) { - return what !== r.handler; - } - - return String(r.path) !== String(what); - }); - return this; - } - - function listen() { - if (isPushStateAvailable) { - this.__popstateListener = function () { - if (!self.__freezeListening) { - resolve(); - } - }; - - window.addEventListener("popstate", this.__popstateListener); - } - } - - function destroy() { - this.routes = routes = []; - - if (isPushStateAvailable) { - window.removeEventListener("popstate", this.__popstateListener); - } - - this.destroyed = destroyed = true; - } - - function notFound(handler, hooks) { - self._notFoundRoute = createRoute("*", handler, [genericHooks, hooks], "__NOT_FOUND__"); - return this; - } - - function updatePageLinks() { - if (!isWindowAvailable) return; - findLinks().forEach(function (link) { - if ("false" === link.getAttribute("data-navigo") || "_blank" === link.getAttribute("target")) { - if (link.hasListenerAttached) { - link.removeEventListener("click", link.navigoHandler); - } - - return; - } - - if (!link.hasListenerAttached) { - link.hasListenerAttached = true; - - link.navigoHandler = function (e) { - if ((e.ctrlKey || e.metaKey) && e.target.tagName.toLowerCase() === "a") { - return false; - } - - var location = link.getAttribute("href"); - - if (typeof location === "undefined" || location === null) { - return false; - } // handling absolute paths - - - if (location.match(/^(http|https)/) && typeof URL !== "undefined") { - try { - var u = new URL(location); - location = u.pathname + u.search; - } catch (err) {} - } - - var options = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.parseNavigateOptions)(link.getAttribute("data-navigo-options")); - - if (!destroyed) { - e.preventDefault(); - e.stopPropagation(); - self.navigate((0,_utils__WEBPACK_IMPORTED_MODULE_0__.clean)(location), options); - } - }; - - link.addEventListener("click", link.navigoHandler); - } - }); - return self; - } - - function findLinks() { - if (isWindowAvailable) { - return [].slice.call(document.querySelectorAll(DEFAULT_RESOLVE_OPTIONS.linksSelector || DEFAULT_LINK_SELECTOR)); - } - - return []; - } - - function link(path) { - return "/" + root + "/" + (0,_utils__WEBPACK_IMPORTED_MODULE_0__.clean)(path); - } - - function setGenericHooks(hooks) { - genericHooks = hooks; - return this; - } - - function lastResolved() { - return current; - } - - function generate(name, data, options) { - var route = routes.find(function (r) { - return r.name === name; - }); - var result = null; - - if (route) { - result = route.path; - - if (data) { - for (var key in data) { - result = result.replace(":" + key, data[key]); - } - } - - result = !result.match(/^\//) ? "/" + result : result; - } - - if (result && options && !options.includeRoot) { - result = result.replace(new RegExp("^/" + root), ""); - } - - return result; - } - - function getLinkPath(link) { - return link.getAttribute("href"); - } - - function pathToMatchObject(path) { - var _extractGETParameters = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.extractGETParameters)((0,_utils__WEBPACK_IMPORTED_MODULE_0__.clean)(path)), - url = _extractGETParameters[0], - queryString = _extractGETParameters[1]; - - var params = queryString === "" ? null : (0,_utils__WEBPACK_IMPORTED_MODULE_0__.parseQuery)(queryString); - var hashString = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.extractHashFromURL)(path); - var route = createRoute(url, function () {}, [genericHooks], url); - return { - url: url, - queryString: queryString, - hashString: hashString, - route: route, - data: null, - params: params - }; - } - - function getCurrentLocation() { - return pathToMatchObject((0,_utils__WEBPACK_IMPORTED_MODULE_0__.clean)((0,_utils__WEBPACK_IMPORTED_MODULE_0__.getCurrentEnvURL)(root)).replace(new RegExp("^" + root), "")); - } - - function directMatchWithRegisteredRoutes(path) { - var context = { - instance: self, - currentLocationPath: path, - to: path, - navigateOptions: {}, - resolveOptions: DEFAULT_RESOLVE_OPTIONS - }; - (0,_middlewares_matchPathToRegisteredRoutes__WEBPACK_IMPORTED_MODULE_3__.default)(context, function () {}); - return context.matches ? context.matches : false; - } - - function directMatchWithLocation(path, currentLocation, annotatePathWithRoot) { - if (typeof currentLocation !== "undefined" && (typeof annotatePathWithRoot === "undefined" || annotatePathWithRoot)) { - currentLocation = composePathWithRoot(currentLocation); - } - - var context = { - instance: self, - to: currentLocation, - currentLocationPath: currentLocation - }; - (0,_middlewares_setLocationPath__WEBPACK_IMPORTED_MODULE_2__.default)(context, function () {}); - - if (typeof path === "string") { - path = typeof annotatePathWithRoot === "undefined" || annotatePathWithRoot ? composePathWithRoot(path) : path; - } - - var match = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.matchRoute)(context, { - name: String(path), - path: path, - handler: function handler() {}, - hooks: {} - }); - return match ? match : false; - } - - function addHook(type, route, func) { - if (typeof route === "string") { - route = getRoute(route); - } - - if (route) { - if (!route.hooks[type]) route.hooks[type] = []; - route.hooks[type].push(func); - return function () { - route.hooks[type] = route.hooks[type].filter(function (f) { - return f !== func; - }); - }; - } else { - console.warn("Route doesn't exists: " + route); - } - - return function () {}; - } - - function getRoute(nameOrHandler) { - if (typeof nameOrHandler === "string") { - return routes.find(function (r) { - return r.name === composePathWithRoot(nameOrHandler); - }); - } - - return routes.find(function (r) { - return r.handler === nameOrHandler; - }); - } - - function __markAsClean(context) { - context.instance.__dirty = false; - - if (context.instance.__waiting.length > 0) { - context.instance.__waiting.shift()(); - } - } - - this.root = root; - this.routes = routes; - this.destroyed = destroyed; - this.current = current; - this.__freezeListening = false; - this.__waiting = []; - this.__dirty = false; - this.__markAsClean = __markAsClean; - this.on = on; - this.off = off; - this.resolve = resolve; - this.navigate = navigate; - this.navigateByName = navigateByName; - this.destroy = destroy; - this.notFound = notFound; - this.updatePageLinks = updatePageLinks; - this.link = link; - this.hooks = setGenericHooks; - - this.extractGETParameters = function (url) { - return (0,_utils__WEBPACK_IMPORTED_MODULE_0__.extractGETParameters)(_checkForAHash(url)); - }; - - this.lastResolved = lastResolved; - this.generate = generate; - this.getLinkPath = getLinkPath; - this.match = directMatchWithRegisteredRoutes; - this.matchLocation = directMatchWithLocation; - this.getCurrentLocation = getCurrentLocation; - this.addBeforeHook = addHook.bind(this, "before"); - this.addAfterHook = addHook.bind(this, "after"); - this.addAlreadyHook = addHook.bind(this, "already"); - this.addLeaveHook = addHook.bind(this, "leave"); - this.getRoute = getRoute; - this._pathToMatchObject = pathToMatchObject; - this._clean = _utils__WEBPACK_IMPORTED_MODULE_0__.clean; - this._checkForAHash = _checkForAHash; - - this._setCurrent = function (c) { - return current = self.current = c; - }; - - listen.call(this); - updatePageLinks.call(this); - } - - /***/ }), - - /***/ "./src/lifecycles.ts": - /*!***************************!*\ - !*** ./src/lifecycles.ts ***! - \***************************/ - /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ "foundLifecycle": function() { return /* binding */ foundLifecycle; }, - /* harmony export */ "notFoundLifeCycle": function() { return /* binding */ notFoundLifeCycle; } - /* harmony export */ }); - /* harmony import */ var _Q__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Q */ "./src/Q.ts"); - /* harmony import */ var _middlewares_checkForLeaveHook__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./middlewares/checkForLeaveHook */ "./src/middlewares/checkForLeaveHook.ts"); - /* harmony import */ var _middlewares_checkForBeforeHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./middlewares/checkForBeforeHook */ "./src/middlewares/checkForBeforeHook.ts"); - /* harmony import */ var _middlewares_callHandler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./middlewares/callHandler */ "./src/middlewares/callHandler.ts"); - /* harmony import */ var _middlewares_checkForAfterHook__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./middlewares/checkForAfterHook */ "./src/middlewares/checkForAfterHook.ts"); - /* harmony import */ var _middlewares_checkForAlreadyHook__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./middlewares/checkForAlreadyHook */ "./src/middlewares/checkForAlreadyHook.ts"); - /* harmony import */ var _middlewares_checkForNotFoundHandler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./middlewares/checkForNotFoundHandler */ "./src/middlewares/checkForNotFoundHandler.ts"); - /* harmony import */ var _middlewares_errorOut__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./middlewares/errorOut */ "./src/middlewares/errorOut.ts"); - /* harmony import */ var _middlewares_flushCurrent__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./middlewares/flushCurrent */ "./src/middlewares/flushCurrent.ts"); - /* harmony import */ var _middlewares_updateState__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./middlewares/updateState */ "./src/middlewares/updateState.ts"); - - - - - - - - - - - var foundLifecycle = [_middlewares_checkForAlreadyHook__WEBPACK_IMPORTED_MODULE_5__.default, _middlewares_checkForBeforeHook__WEBPACK_IMPORTED_MODULE_2__.default, _middlewares_callHandler__WEBPACK_IMPORTED_MODULE_3__.default, _middlewares_checkForAfterHook__WEBPACK_IMPORTED_MODULE_4__.default]; - var notFoundLifeCycle = [_middlewares_checkForLeaveHook__WEBPACK_IMPORTED_MODULE_1__.default, _middlewares_checkForNotFoundHandler__WEBPACK_IMPORTED_MODULE_6__.default, _Q__WEBPACK_IMPORTED_MODULE_0__.default.if(function (_ref) { - var notFoundHandled = _ref.notFoundHandled; - return notFoundHandled; - }, foundLifecycle.concat([_middlewares_updateState__WEBPACK_IMPORTED_MODULE_9__.default]), [_middlewares_errorOut__WEBPACK_IMPORTED_MODULE_7__.default, _middlewares_flushCurrent__WEBPACK_IMPORTED_MODULE_8__.default])]; - - /***/ }), - - /***/ "./src/middlewares/callHandler.ts": - /*!****************************************!*\ - !*** ./src/middlewares/callHandler.ts ***! - \****************************************/ - /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ "default": function() { return /* binding */ callHandler; } - /* harmony export */ }); - /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); - - function callHandler(context, done) { - if ((0,_utils__WEBPACK_IMPORTED_MODULE_0__.undefinedOrTrue)(context.navigateOptions, "callHandler")) { - context.match.route.handler(context.match); - } - - context.instance.updatePageLinks(); - done(); - } - - /***/ }), - - /***/ "./src/middlewares/checkForAfterHook.ts": - /*!**********************************************!*\ - !*** ./src/middlewares/checkForAfterHook.ts ***! - \**********************************************/ - /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ "default": function() { return /* binding */ checkForAfterHook; } - /* harmony export */ }); - /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); - - function checkForAfterHook(context, done) { - if (context.match.route.hooks && context.match.route.hooks.after && (0,_utils__WEBPACK_IMPORTED_MODULE_0__.undefinedOrTrue)(context.navigateOptions, "callHooks")) { - context.match.route.hooks.after.forEach(function (f) { - return f(context.match); - }); - } - - done(); - } - - /***/ }), - - /***/ "./src/middlewares/checkForAlreadyHook.ts": - /*!************************************************!*\ - !*** ./src/middlewares/checkForAlreadyHook.ts ***! - \************************************************/ - /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ "default": function() { return /* binding */ checkForAlreadyHook; } - /* harmony export */ }); - /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); - - function checkForAlreadyHook(context, done) { - var current = context.instance.lastResolved(); - - if (current && current[0] && current[0].route === context.match.route && current[0].url === context.match.url && current[0].queryString === context.match.queryString) { - current.forEach(function (c) { - if (c.route.hooks && c.route.hooks.already) { - if ((0,_utils__WEBPACK_IMPORTED_MODULE_0__.undefinedOrTrue)(context.navigateOptions, "callHooks")) { - c.route.hooks.already.forEach(function (f) { - return f(context.match); - }); - } - } - }); - done(false); - return; - } - - done(); - } - - /***/ }), - - /***/ "./src/middlewares/checkForBeforeHook.ts": - /*!***********************************************!*\ - !*** ./src/middlewares/checkForBeforeHook.ts ***! - \***********************************************/ - /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ "default": function() { return /* binding */ checkForBeforeHook; } - /* harmony export */ }); - /* harmony import */ var _Q__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Q */ "./src/Q.ts"); - /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); - - - function checkForBeforeHook(context, done) { - if (context.match.route.hooks && context.match.route.hooks.before && (0,_utils__WEBPACK_IMPORTED_MODULE_1__.undefinedOrTrue)(context.navigateOptions, "callHooks")) { - (0,_Q__WEBPACK_IMPORTED_MODULE_0__.default)(context.match.route.hooks.before.map(function (f) { - // just so we match the Q interface - return function beforeHookInternal(_, d) { - return f(function (shouldStop) { - if (shouldStop === false) { - context.instance.__markAsClean(context); - } else { - d(); - } - }, context.match); - }; - }).concat([function () { - return done(); - }])); - } else { - done(); - } - } - - /***/ }), - - /***/ "./src/middlewares/checkForDeprecationMethods.ts": - /*!*******************************************************!*\ - !*** ./src/middlewares/checkForDeprecationMethods.ts ***! - \*******************************************************/ - /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ "default": function() { return /* binding */ checkForDeprecationMethods; } - /* harmony export */ }); - function checkForDeprecationMethods(context, done) { - if (context.navigateOptions) { - if (typeof context.navigateOptions["shouldResolve"] !== "undefined") { - console.warn("\"shouldResolve\" is deprecated. Please check the documentation."); - } - - if (typeof context.navigateOptions["silent"] !== "undefined") { - console.warn("\"silent\" is deprecated. Please check the documentation."); - } - } - - done(); - } - - /***/ }), - - /***/ "./src/middlewares/checkForForceOp.ts": - /*!********************************************!*\ - !*** ./src/middlewares/checkForForceOp.ts ***! - \********************************************/ - /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ "default": function() { return /* binding */ checkForForceOp; } - /* harmony export */ }); - function checkForForceOp(context, done) { - if (context.navigateOptions.force === true) { - context.instance._setCurrent([context.instance._pathToMatchObject(context.to)]); - - done(false); - } else { - done(); - } - } - - /***/ }), - - /***/ "./src/middlewares/checkForLeaveHook.ts": - /*!**********************************************!*\ - !*** ./src/middlewares/checkForLeaveHook.ts ***! - \**********************************************/ - /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ "default": function() { return /* binding */ checkForLeaveHook; } - /* harmony export */ }); - /* harmony import */ var _Q__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Q */ "./src/Q.ts"); - /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); - - - function checkForLeaveHook(context, done) { - var instance = context.instance; - - if (!instance.lastResolved()) { - done(); - return; - } - - (0,_Q__WEBPACK_IMPORTED_MODULE_0__.default)(instance.lastResolved().map(function (oldMatch) { - return function (_, leaveLoopDone) { - // no leave hook - if (!oldMatch.route.hooks || !oldMatch.route.hooks.leave) { - leaveLoopDone(); - return; - } - - var runHook = false; - var newLocationVSOldMatch = context.instance.matchLocation(oldMatch.route.path, context.currentLocationPath, false); - - if (oldMatch.route.path !== "*") { - runHook = !newLocationVSOldMatch; - } else { - var someOfTheLastOnesMatch = context.matches ? context.matches.find(function (match) { - return oldMatch.route.path === match.route.path; - }) : false; - runHook = !someOfTheLastOnesMatch; - } - - if ((0,_utils__WEBPACK_IMPORTED_MODULE_1__.undefinedOrTrue)(context.navigateOptions, "callHooks") && runHook) { - (0,_Q__WEBPACK_IMPORTED_MODULE_0__.default)(oldMatch.route.hooks.leave.map(function (f) { - // just so we match the Q interface - return function (_, d) { - return f(function (shouldStop) { - if (shouldStop === false) { - context.instance.__markAsClean(context); - } else { - d(); - } - }, context.matches && context.matches.length > 0 ? context.matches.length === 1 ? context.matches[0] : context.matches : undefined); - }; - }).concat([function () { - return leaveLoopDone(); - }])); - return; - } else { - leaveLoopDone(); - } - }; - }), {}, function () { - return done(); - }); - } - - /***/ }), - - /***/ "./src/middlewares/checkForNotFoundHandler.ts": - /*!****************************************************!*\ - !*** ./src/middlewares/checkForNotFoundHandler.ts ***! - \****************************************************/ - /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ "default": function() { return /* binding */ checkForNotFoundHandler; } - /* harmony export */ }); - /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); - - function checkForNotFoundHandler(context, done) { - var notFoundRoute = context.instance._notFoundRoute; - - if (notFoundRoute) { - context.notFoundHandled = true; - - var _extractGETParameters = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.extractGETParameters)(context.currentLocationPath), - url = _extractGETParameters[0], - queryString = _extractGETParameters[1]; - - var hashString = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.extractHashFromURL)(context.to); - notFoundRoute.path = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.clean)(url); - var notFoundMatch = { - url: notFoundRoute.path, - queryString: queryString, - hashString: hashString, - data: null, - route: notFoundRoute, - params: queryString !== "" ? (0,_utils__WEBPACK_IMPORTED_MODULE_0__.parseQuery)(queryString) : null - }; - context.matches = [notFoundMatch]; - context.match = notFoundMatch; - } - - done(); - } - - /***/ }), - - /***/ "./src/middlewares/errorOut.ts": - /*!*************************************!*\ - !*** ./src/middlewares/errorOut.ts ***! - \*************************************/ - /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ "default": function() { return /* binding */ errorOut; } - /* harmony export */ }); - function errorOut(context, done) { - if (!context.resolveOptions || context.resolveOptions.noMatchWarning === false || typeof context.resolveOptions.noMatchWarning === "undefined") console.warn("Navigo: \"" + context.currentLocationPath + "\" didn't match any of the registered routes."); - done(); - } - - /***/ }), - - /***/ "./src/middlewares/flushCurrent.ts": - /*!*****************************************!*\ - !*** ./src/middlewares/flushCurrent.ts ***! - \*****************************************/ - /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ "default": function() { return /* binding */ flushCurrent; } - /* harmony export */ }); - function flushCurrent(context, done) { - context.instance._setCurrent(null); - - done(); - } - - /***/ }), - - /***/ "./src/middlewares/matchPathToRegisteredRoutes.ts": - /*!********************************************************!*\ - !*** ./src/middlewares/matchPathToRegisteredRoutes.ts ***! - \********************************************************/ - /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ "default": function() { return /* binding */ matchPathToRegisteredRoutes; } - /* harmony export */ }); - /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); - - function matchPathToRegisteredRoutes(context, done) { - for (var i = 0; i < context.instance.routes.length; i++) { - var route = context.instance.routes[i]; - var match = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.matchRoute)(context, route); - - if (match) { - if (!context.matches) context.matches = []; - context.matches.push(match); - - if (context.resolveOptions.strategy === "ONE") { - done(); - return; - } - } - } - - done(); - } - - /***/ }), - - /***/ "./src/middlewares/processMatches.ts": - /*!*******************************************!*\ - !*** ./src/middlewares/processMatches.ts ***! - \*******************************************/ - /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ "default": function() { return /* binding */ processMatches; } - /* harmony export */ }); - /* harmony import */ var _Q__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Q */ "./src/Q.ts"); - /* harmony import */ var _lifecycles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lifecycles */ "./src/lifecycles.ts"); - /* harmony import */ var _updateState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./updateState */ "./src/middlewares/updateState.ts"); - /* harmony import */ var _checkForLeaveHook__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./checkForLeaveHook */ "./src/middlewares/checkForLeaveHook.ts"); - function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - - - - - - function processMatches(context, done) { - var idx = 0; - - function nextMatch() { - if (idx === context.matches.length) { - (0,_updateState__WEBPACK_IMPORTED_MODULE_2__.default)(context, done); - return; - } - - (0,_Q__WEBPACK_IMPORTED_MODULE_0__.default)(_lifecycles__WEBPACK_IMPORTED_MODULE_1__.foundLifecycle, _extends({}, context, { - match: context.matches[idx] - }), function end() { - idx += 1; - nextMatch(); - }); - } - - (0,_checkForLeaveHook__WEBPACK_IMPORTED_MODULE_3__.default)(context, nextMatch); - } - - /***/ }), - - /***/ "./src/middlewares/setLocationPath.ts": - /*!********************************************!*\ - !*** ./src/middlewares/setLocationPath.ts ***! - \********************************************/ - /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ "default": function() { return /* binding */ setLocationPath; } - /* harmony export */ }); - /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); - - function setLocationPath(context, done) { - if (typeof context.currentLocationPath === "undefined") { - context.currentLocationPath = context.to = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.getCurrentEnvURL)(context.instance.root); - } - - context.currentLocationPath = context.instance._checkForAHash(context.currentLocationPath); - done(); - } - - /***/ }), - - /***/ "./src/middlewares/updateBrowserURL.ts": - /*!*********************************************!*\ - !*** ./src/middlewares/updateBrowserURL.ts ***! - \*********************************************/ - /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ "default": function() { return /* binding */ updateBrowserURL; } - /* harmony export */ }); - /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); - - var isWindowAvailable = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.windowAvailable)(); - var isPushStateAvailable = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.pushStateAvailable)(); - function updateBrowserURL(context, done) { - if ((0,_utils__WEBPACK_IMPORTED_MODULE_0__.undefinedOrTrue)(context.navigateOptions, "updateBrowserURL")) { - var value = ("/" + context.to).replace(/\/\//g, "/"); // making sure that we don't have two slashes - - var isItUsingHash = isWindowAvailable && context.resolveOptions && context.resolveOptions.hash === true; - - if (isPushStateAvailable) { - history[context.navigateOptions.historyAPIMethod || "pushState"](context.navigateOptions.stateObj || {}, context.navigateOptions.title || "", isItUsingHash ? "#" + value : value); // This is to solve a nasty bug where the page doesn't scroll to the anchor. - // We set a microtask to update the hash only. - - if (location && location.hash) { - context.instance.__freezeListening = true; - setTimeout(function () { - if (!isItUsingHash) { - var tmp = location.hash; - location.hash = ""; - location.hash = tmp; - } - - context.instance.__freezeListening = false; - }, 1); - } - } else if (isWindowAvailable) { - window.location.href = context.to; - } - } - - done(); - } - - /***/ }), - - /***/ "./src/middlewares/updateState.ts": - /*!****************************************!*\ - !*** ./src/middlewares/updateState.ts ***! - \****************************************/ - /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ "default": function() { return /* binding */ updateState; } - /* harmony export */ }); - /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils.ts"); - - function updateState(context, done) { - if ((0,_utils__WEBPACK_IMPORTED_MODULE_0__.undefinedOrTrue)(context.navigateOptions, "updateState")) { - context.instance._setCurrent(context.matches); - } - - done(); - } - - /***/ }), - - /***/ "./src/middlewares/waitingList.ts": - /*!****************************************!*\ - !*** ./src/middlewares/waitingList.ts ***! - \****************************************/ - /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ "default": function() { return /* binding */ waitingList; } - /* harmony export */ }); - function waitingList(context) { - context.instance.__markAsClean(context); - } - - /***/ }), - - /***/ "./src/utils.ts": - /*!**********************!*\ - !*** ./src/utils.ts ***! - \**********************/ - /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ "getCurrentEnvURL": function() { return /* binding */ getCurrentEnvURL; }, - /* harmony export */ "clean": function() { return /* binding */ clean; }, - /* harmony export */ "isString": function() { return /* binding */ isString; }, - /* harmony export */ "isFunction": function() { return /* binding */ isFunction; }, - /* harmony export */ "extractHashFromURL": function() { return /* binding */ extractHashFromURL; }, - /* harmony export */ "regExpResultToParams": function() { return /* binding */ regExpResultToParams; }, - /* harmony export */ "extractGETParameters": function() { return /* binding */ extractGETParameters; }, - /* harmony export */ "parseQuery": function() { return /* binding */ parseQuery; }, - /* harmony export */ "matchRoute": function() { return /* binding */ matchRoute; }, - /* harmony export */ "pushStateAvailable": function() { return /* binding */ pushStateAvailable; }, - /* harmony export */ "undefinedOrTrue": function() { return /* binding */ undefinedOrTrue; }, - /* harmony export */ "parseNavigateOptions": function() { return /* binding */ parseNavigateOptions; }, - /* harmony export */ "windowAvailable": function() { return /* binding */ windowAvailable; }, - /* harmony export */ "accumulateHooks": function() { return /* binding */ accumulateHooks; } - /* harmony export */ }); - /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./src/constants.ts"); - - function getCurrentEnvURL(fallback) { - if (fallback === void 0) { - fallback = "/"; - } - - if (windowAvailable()) { - return location.pathname + location.search + location.hash; - } - - return fallback; - } - function clean(s) { - return s.replace(/\/+$/, "").replace(/^\/+/, ""); - } - function isString(s) { - return typeof s === "string"; - } - function isFunction(s) { - return typeof s === "function"; - } - function extractHashFromURL(url) { - if (url && url.indexOf("#") >= 0) { - return url.split("#").pop() || ""; - } - - return ""; - } - function regExpResultToParams(match, names) { - if (names.length === 0) return null; - if (!match) return null; - return match.slice(1, match.length).reduce(function (params, value, index) { - if (params === null) params = {}; - params[names[index]] = decodeURIComponent(value); - return params; - }, null); - } - function extractGETParameters(url) { - var tmp = clean(url).split(/\?(.*)?$/); - return [clean(tmp[0]), tmp.slice(1).join("")]; - } - function parseQuery(queryString) { - var query = {}; - var pairs = queryString.split("&"); - - for (var i = 0; i < pairs.length; i++) { - var pair = pairs[i].split("="); - - if (pair[0] !== "") { - var key = decodeURIComponent(pair[0]); - - if (!query[key]) { - query[key] = decodeURIComponent(pair[1] || ""); - } else { - if (!Array.isArray(query[key])) query[key] = [query[key]]; - query[key].push(decodeURIComponent(pair[1] || "")); - } - } - } - - return query; - } - function matchRoute(context, route) { - var _extractGETParameters = extractGETParameters(clean(context.currentLocationPath)), - current = _extractGETParameters[0], - GETParams = _extractGETParameters[1]; - - var params = GETParams === "" ? null : parseQuery(GETParams); - var paramNames = []; - var pattern; - - if (isString(route.path)) { - pattern = _constants__WEBPACK_IMPORTED_MODULE_0__.START_BY_SLASH_REGEXP + clean(route.path).replace(_constants__WEBPACK_IMPORTED_MODULE_0__.PARAMETER_REGEXP, function (full, dots, name) { - paramNames.push(name); - return _constants__WEBPACK_IMPORTED_MODULE_0__.REPLACE_VARIABLE_REGEXP; - }).replace(_constants__WEBPACK_IMPORTED_MODULE_0__.WILDCARD_REGEXP, _constants__WEBPACK_IMPORTED_MODULE_0__.REPLACE_WILDCARD).replace(_constants__WEBPACK_IMPORTED_MODULE_0__.NOT_SURE_REGEXP, _constants__WEBPACK_IMPORTED_MODULE_0__.REPLACE_NOT_SURE) + "$"; - - if (clean(route.path) === "") { - if (clean(current) === "") { - return { - url: current, - queryString: GETParams, - hashString: extractHashFromURL(context.to), - route: route, - data: null, - params: params - }; - } - } - } else { - pattern = route.path; - } - - var regexp = new RegExp(pattern, _constants__WEBPACK_IMPORTED_MODULE_0__.MATCH_REGEXP_FLAGS); - var match = current.match(regexp); - - if (match) { - var data = isString(route.path) ? regExpResultToParams(match, paramNames) : match.groups ? match.groups : match.slice(1); - return { - url: clean(current.replace(new RegExp("^" + context.instance.root), "")), - queryString: GETParams, - hashString: extractHashFromURL(context.to), - route: route, - data: data, - params: params - }; - } - - return false; - } - function pushStateAvailable() { - return !!(typeof window !== "undefined" && window.history && window.history.pushState); - } - function undefinedOrTrue(obj, key) { - return typeof obj[key] === "undefined" || obj[key] === true; - } - function parseNavigateOptions(source) { - if (!source) return {}; - var pairs = source.split(","); - var options = {}; - var resolveOptions; - pairs.forEach(function (str) { - var temp = str.split(":").map(function (v) { - return v.replace(/(^ +| +$)/g, ""); - }); - - switch (temp[0]) { - case "historyAPIMethod": - options.historyAPIMethod = temp[1]; - break; - - case "resolveOptionsStrategy": - if (!resolveOptions) resolveOptions = {}; - resolveOptions.strategy = temp[1]; - break; - - case "resolveOptionsHash": - if (!resolveOptions) resolveOptions = {}; - resolveOptions.hash = temp[1] === "true"; - break; - - case "updateBrowserURL": - case "callHandler": - case "updateState": - case "force": - options[temp[0]] = temp[1] === "true"; - break; - } - }); - - if (resolveOptions) { - options.resolveOptions = resolveOptions; - } - - return options; - } - function windowAvailable() { - return typeof window !== "undefined"; - } - function accumulateHooks(hooks, result) { - if (hooks === void 0) { - hooks = []; - } - - if (result === void 0) { - result = {}; - } - - hooks.filter(function (h) { - return h; - }).forEach(function (h) { - ["before", "after", "already", "leave"].forEach(function (type) { - if (h[type]) { - if (!result[type]) result[type] = []; - result[type].push(h[type]); - } - }); - }); - return result; - } - - /***/ }) - - /******/ }); - /************************************************************************/ - /******/ // The module cache - /******/ var __webpack_module_cache__ = {}; - /******/ - /******/ // The require function - /******/ function __webpack_require__(moduleId) { - /******/ // Check if module is in cache - /******/ if(__webpack_module_cache__[moduleId]) { - /******/ return __webpack_module_cache__[moduleId].exports; - /******/ } - /******/ // Create a new module (and put it into the cache) - /******/ var module = __webpack_module_cache__[moduleId] = { - /******/ // no module.id needed - /******/ // no module.loaded needed - /******/ exports: {} - /******/ }; - /******/ - /******/ // Execute the module function - /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); - /******/ - /******/ // Return the exports of the module - /******/ return module.exports; - /******/ } - /******/ - /************************************************************************/ - /******/ /* webpack/runtime/define property getters */ - /******/ !function() { - /******/ // define getter functions for harmony exports - /******/ __webpack_require__.d = function(exports, definition) { - /******/ for(var key in definition) { - /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { - /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); - /******/ } - /******/ } - /******/ }; - /******/ }(); - /******/ - /******/ /* webpack/runtime/hasOwnProperty shorthand */ - /******/ !function() { - /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } - /******/ }(); - /******/ - /******/ /* webpack/runtime/make namespace object */ - /******/ !function() { - /******/ // define __esModule on exports - /******/ __webpack_require__.r = function(exports) { - /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { - /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); - /******/ } - /******/ Object.defineProperty(exports, '__esModule', { value: true }); - /******/ }; - /******/ }(); - /******/ - /************************************************************************/ - /******/ // module exports must be returned from runtime so entry inlining is disabled - /******/ // startup - /******/ // Load entry module and return exports - /******/ return __webpack_require__("./src/index.ts"); - /******/ })() - .default; -}); -//# sourceMappingURL=navigo.js.map \ No newline at end of file diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 216c17d..0000000 --- a/package-lock.json +++ /dev/null @@ -1,4525 +0,0 @@ -{ - "name": "blapy2", - "version": "2.0.2", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "blapy2", - "version": "2.0.2", - "license": "DonationWare", - "dependencies": { - "vite-plugin-banner": "^0.8.1" - }, - "devDependencies": { - "@eslint/js": "^9.32.0", - "@eslint/json": "^0.13.1", - "@eslint/markdown": "^7.1.0", - "@playwright/test": "^1.54.2", - "eslint": "^9.32.0", - "globals": "^16.3.0", - "jsdom": "latest", - "playwright": "^1.54.2", - "terser": "^5.43.1", - "vite": "^7.0.6", - "vitest": "^3.2.4" - } - }, - "node_modules/@acemir/cssom": { - "version": "0.9.23", - "resolved": "https://registry.npmjs.org/@acemir/cssom/-/cssom-0.9.23.tgz", - "integrity": "sha512-2kJ1HxBKzPLbmhZpxBiTZggjtgCwKg1ma5RHShxvd6zgqhDEdEkzpiwe7jLkI2p2BrZvFCXIihdoMkl1H39VnA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@asamuzakjp/css-color": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-4.0.5.tgz", - "integrity": "sha512-lMrXidNhPGsDjytDy11Vwlb6OIGrT3CmLg3VWNFyWkLWtijKl7xjvForlh8vuj0SHGjgl4qZEQzUmYTeQA2JFQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@csstools/css-calc": "^2.1.4", - "@csstools/css-color-parser": "^3.1.0", - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4", - "lru-cache": "^11.2.1" - } - }, - "node_modules/@asamuzakjp/dom-selector": { - "version": "6.7.4", - "resolved": "https://registry.npmjs.org/@asamuzakjp/dom-selector/-/dom-selector-6.7.4.tgz", - "integrity": "sha512-buQDjkm+wDPXd6c13534URWZqbz0RP5PAhXZ+LIoa5LgwInT9HVJvGIJivg75vi8I13CxDGdTnz+aY5YUJlIAA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@asamuzakjp/nwsapi": "^2.3.9", - "bidi-js": "^1.0.3", - "css-tree": "^3.1.0", - "is-potential-custom-element-name": "^1.0.1", - "lru-cache": "^11.2.2" - } - }, - "node_modules/@asamuzakjp/nwsapi": { - "version": "2.3.9", - "resolved": "https://registry.npmjs.org/@asamuzakjp/nwsapi/-/nwsapi-2.3.9.tgz", - "integrity": "sha512-n8GuYSrI9bF7FFZ/SjhwevlHc8xaVlb/7HmHelnc/PZXBD2ZR49NnN9sMMuDdEGPeeRQ5d0hqlSlEpgCX3Wl0Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/@csstools/color-helpers": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.1.0.tgz", - "integrity": "sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "license": "MIT-0", - "engines": { - "node": ">=18" - } - }, - "node_modules/@csstools/css-calc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.4.tgz", - "integrity": "sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "license": "MIT", - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4" - } - }, - "node_modules/@csstools/css-color-parser": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.1.0.tgz", - "integrity": "sha512-nbtKwh3a6xNVIp/VRuXV64yTKnb1IjTAEEh3irzS+HkKjAOYLTGNb9pmVNntZ8iVBHcWDA2Dof0QtPgFI1BaTA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "license": "MIT", - "dependencies": { - "@csstools/color-helpers": "^5.1.0", - "@csstools/css-calc": "^2.1.4" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@csstools/css-parser-algorithms": "^3.0.5", - "@csstools/css-tokenizer": "^3.0.4" - } - }, - "node_modules/@csstools/css-parser-algorithms": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.5.tgz", - "integrity": "sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "license": "MIT", - "peer": true, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@csstools/css-tokenizer": "^3.0.4" - } - }, - "node_modules/@csstools/css-syntax-patches-for-csstree": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/@csstools/css-syntax-patches-for-csstree/-/css-syntax-patches-for-csstree-1.0.16.tgz", - "integrity": "sha512-2SpS4/UaWQaGpBINyG5ZuCHnUDeVByOhvbkARwfmnfxDvTaj80yOI1cD8Tw93ICV5Fx4fnyDKWQZI1CDtcWyUg==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "license": "MIT-0", - "engines": { - "node": ">=18" - } - }, - "node_modules/@csstools/css-tokenizer": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.4.tgz", - "integrity": "sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/csstools" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } - ], - "license": "MIT", - "peer": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", - "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz", - "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", - "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz", - "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", - "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", - "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", - "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", - "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", - "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", - "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", - "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", - "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", - "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", - "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", - "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", - "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", - "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", - "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", - "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", - "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", - "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", - "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", - "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", - "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", - "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", - "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", - "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", - "dev": true, - "license": "MIT", - "dependencies": { - "eslint-visitor-keys": "^3.4.3" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" - } - }, - "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint-community/regexpp": { - "version": "4.12.2", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", - "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "node_modules/@eslint/config-array": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", - "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/object-schema": "^2.1.7", - "debug": "^4.3.1", - "minimatch": "^3.1.2" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/config-helpers": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", - "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/core": "^0.17.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/config-helpers/node_modules/@eslint/core": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", - "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@types/json-schema": "^7.0.15" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/core": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.2.tgz", - "integrity": "sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@types/json-schema": "^7.0.15" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", - "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^10.0.1", - "globals": "^14.0.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", - "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@eslint/js": { - "version": "9.39.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.1.tgz", - "integrity": "sha512-S26Stp4zCy88tH94QbBv3XCuzRQiZ9yXofEILmglYTh/Ug/a9/umqvgFtYBAo3Lp0nsI/5/qH1CCrbdK3AP1Tw==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://eslint.org/donate" - } - }, - "node_modules/@eslint/json": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/@eslint/json/-/json-0.13.2.tgz", - "integrity": "sha512-yWLyRE18rHgHXhWigRpiyv1LDPkvWtC6oa7QHXW7YdP6gosJoq7BiLZW2yCs9U7zN7X4U3ZeOJjepA10XAOIMw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/core": "^0.15.2", - "@eslint/plugin-kit": "^0.3.5", - "@humanwhocodes/momoa": "^3.3.9", - "natural-compare": "^1.4.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/markdown": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@eslint/markdown/-/markdown-7.5.1.tgz", - "integrity": "sha512-R8uZemG9dKTbru/DQRPblbJyXpObwKzo8rv1KYGGuPUPtjM4LXBYM9q5CIZAComzZupws3tWbDwam5AFpPLyJQ==", - "dev": true, - "license": "MIT", - "workspaces": [ - "examples/*" - ], - "dependencies": { - "@eslint/core": "^0.17.0", - "@eslint/plugin-kit": "^0.4.1", - "github-slugger": "^2.0.0", - "mdast-util-from-markdown": "^2.0.2", - "mdast-util-frontmatter": "^2.0.1", - "mdast-util-gfm": "^3.1.0", - "micromark-extension-frontmatter": "^2.0.0", - "micromark-extension-gfm": "^3.0.0", - "micromark-util-normalize-identifier": "^2.0.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/markdown/node_modules/@eslint/core": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", - "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@types/json-schema": "^7.0.15" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/markdown/node_modules/@eslint/plugin-kit": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", - "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/core": "^0.17.0", - "levn": "^0.4.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/object-schema": { - "version": "2.1.7", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", - "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/plugin-kit": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.5.tgz", - "integrity": "sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/core": "^0.15.2", - "levn": "^0.4.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@humanfs/core": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", - "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=18.18.0" - } - }, - "node_modules/@humanfs/node": { - "version": "0.16.7", - "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", - "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@humanfs/core": "^0.19.1", - "@humanwhocodes/retry": "^0.4.0" - }, - "engines": { - "node": ">=18.18.0" - } - }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@humanwhocodes/momoa": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/@humanwhocodes/momoa/-/momoa-3.3.10.tgz", - "integrity": "sha512-KWiFQpSAqEIyrTXko3hFNLeQvSK8zXlJQzhhxsyVn58WFRYXST99b3Nqnu+ttOtjds2Pl2grUHGpe2NzhPynuQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=18" - } - }, - "node_modules/@humanwhocodes/retry": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", - "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=18.18" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.13", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", - "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/source-map": { - "version": "0.3.11", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", - "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", - "dev": true, - "license": "MIT" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.31", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", - "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@playwright/test": { - "version": "1.56.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.56.1.tgz", - "integrity": "sha512-vSMYtL/zOcFpvJCW71Q/OEGQb7KYBPAdKh35WNSkaZA75JlAO8ED8UN6GUNTm3drWomcbcqRPFqQbLae8yBTdg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "playwright": "1.56.1" - }, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.53.2.tgz", - "integrity": "sha512-yDPzwsgiFO26RJA4nZo8I+xqzh7sJTZIWQOxn+/XOdPE31lAvLIYCKqjV+lNH/vxE2L2iH3plKxDCRK6i+CwhA==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.53.2.tgz", - "integrity": "sha512-k8FontTxIE7b0/OGKeSN5B6j25EuppBcWM33Z19JoVT7UTXFSo3D9CdU39wGTeb29NO3XxpMNauh09B+Ibw+9g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.53.2.tgz", - "integrity": "sha512-A6s4gJpomNBtJ2yioj8bflM2oogDwzUiMl2yNJ2v9E7++sHrSrsQ29fOfn5DM/iCzpWcebNYEdXpaK4tr2RhfQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.53.2.tgz", - "integrity": "sha512-e6XqVmXlHrBlG56obu9gDRPW3O3hLxpwHpLsBJvuI8qqnsrtSZ9ERoWUXtPOkY8c78WghyPHZdmPhHLWNdAGEw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.53.2.tgz", - "integrity": "sha512-v0E9lJW8VsrwPux5Qe5CwmH/CF/2mQs6xU1MF3nmUxmZUCHazCjLgYvToOk+YuuUqLQBio1qkkREhxhc656ViA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.53.2.tgz", - "integrity": "sha512-ClAmAPx3ZCHtp6ysl4XEhWU69GUB1D+s7G9YjHGhIGCSrsg00nEGRRZHmINYxkdoJehde8VIsDC5t9C0gb6yqA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.53.2.tgz", - "integrity": "sha512-EPlb95nUsz6Dd9Qy13fI5kUPXNSljaG9FiJ4YUGU1O/Q77i5DYFW5KR8g1OzTcdZUqQQ1KdDqsTohdFVwCwjqg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.53.2.tgz", - "integrity": "sha512-BOmnVW+khAUX+YZvNfa0tGTEMVVEerOxN0pDk2E6N6DsEIa2Ctj48FOMfNDdrwinocKaC7YXUZ1pHlKpnkja/Q==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.53.2.tgz", - "integrity": "sha512-Xt2byDZ+6OVNuREgBXr4+CZDJtrVso5woFtpKdGPhpTPHcNG7D8YXeQzpNbFRxzTVqJf7kvPMCub/pcGUWgBjA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.53.2.tgz", - "integrity": "sha512-+LdZSldy/I9N8+klim/Y1HsKbJ3BbInHav5qE9Iy77dtHC/pibw1SR/fXlWyAk0ThnpRKoODwnAuSjqxFRDHUQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.53.2.tgz", - "integrity": "sha512-8ms8sjmyc1jWJS6WdNSA23rEfdjWB30LH8Wqj0Cqvv7qSHnvw6kgMMXRdop6hkmGPlyYBdRPkjJnj3KCUHV/uQ==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.53.2.tgz", - "integrity": "sha512-3HRQLUQbpBDMmzoxPJYd3W6vrVHOo2cVW8RUo87Xz0JPJcBLBr5kZ1pGcQAhdZgX9VV7NbGNipah1omKKe23/g==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.53.2.tgz", - "integrity": "sha512-fMjKi+ojnmIvhk34gZP94vjogXNNUKMEYs+EDaB/5TG/wUkoeua7p7VCHnE6T2Tx+iaghAqQX8teQzcvrYpaQA==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.53.2.tgz", - "integrity": "sha512-XuGFGU+VwUUV5kLvoAdi0Wz5Xbh2SrjIxCtZj6Wq8MDp4bflb/+ThZsVxokM7n0pcbkEr2h5/pzqzDYI7cCgLQ==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.53.2.tgz", - "integrity": "sha512-w6yjZF0P+NGzWR3AXWX9zc0DNEGdtvykB03uhonSHMRa+oWA6novflo2WaJr6JZakG2ucsyb+rvhrKac6NIy+w==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.53.2.tgz", - "integrity": "sha512-yo8d6tdfdeBArzC7T/PnHd7OypfI9cbuZzPnzLJIyKYFhAQ8SvlkKtKBMbXDxe1h03Rcr7u++nFS7tqXz87Gtw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.53.2.tgz", - "integrity": "sha512-ah59c1YkCxKExPP8O9PwOvs+XRLKwh/mV+3YdKqQ5AMQ0r4M4ZDuOrpWkUaqO7fzAHdINzV9tEVu8vNw48z0lA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.53.2.tgz", - "integrity": "sha512-4VEd19Wmhr+Zy7hbUsFZ6YXEiP48hE//KPLCSVNY5RMGX2/7HZ+QkN55a3atM1C/BZCGIgqN+xrVgtdak2S9+A==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ] - }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.53.2.tgz", - "integrity": "sha512-IlbHFYc/pQCgew/d5fslcy1KEaYVCJ44G8pajugd8VoOEI8ODhtb/j8XMhLpwHCMB3yk2J07ctup10gpw2nyMA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.53.2.tgz", - "integrity": "sha512-lNlPEGgdUfSzdCWU176ku/dQRnA7W+Gp8d+cWv73jYrb8uT7HTVVxq62DUYxjbaByuf1Yk0RIIAbDzp+CnOTFg==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.53.2.tgz", - "integrity": "sha512-S6YojNVrHybQis2lYov1sd+uj7K0Q05NxHcGktuMMdIQ2VixGwAfbJ23NnlvvVV1bdpR2m5MsNBViHJKcA4ADw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.53.2.tgz", - "integrity": "sha512-k+/Rkcyx//P6fetPoLMb8pBeqJBNGx81uuf7iljX9++yNBVRDQgD04L+SVXmXmh5ZP4/WOp4mWF0kmi06PW2tA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@types/chai": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", - "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/deep-eql": "*", - "assertion-error": "^2.0.1" - } - }, - "node_modules/@types/debug": { - "version": "4.1.12", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", - "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/ms": "*" - } - }, - "node_modules/@types/deep-eql": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", - "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/estree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/mdast": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", - "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/unist": "*" - } - }, - "node_modules/@types/ms": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", - "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/unist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", - "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/@vitest/expect": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.4.tgz", - "integrity": "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/chai": "^5.2.2", - "@vitest/spy": "3.2.4", - "@vitest/utils": "3.2.4", - "chai": "^5.2.0", - "tinyrainbow": "^2.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/mocker": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.4.tgz", - "integrity": "sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/spy": "3.2.4", - "estree-walker": "^3.0.3", - "magic-string": "^0.30.17" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "msw": "^2.4.9", - "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" - }, - "peerDependenciesMeta": { - "msw": { - "optional": true - }, - "vite": { - "optional": true - } - } - }, - "node_modules/@vitest/pretty-format": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.4.tgz", - "integrity": "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==", - "dev": true, - "license": "MIT", - "dependencies": { - "tinyrainbow": "^2.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/runner": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.4.tgz", - "integrity": "sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/utils": "3.2.4", - "pathe": "^2.0.3", - "strip-literal": "^3.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/snapshot": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.4.tgz", - "integrity": "sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/pretty-format": "3.2.4", - "magic-string": "^0.30.17", - "pathe": "^2.0.3" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/spy": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.4.tgz", - "integrity": "sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==", - "dev": true, - "license": "MIT", - "dependencies": { - "tinyspy": "^4.0.3" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/utils": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.4.tgz", - "integrity": "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/pretty-format": "3.2.4", - "loupe": "^3.1.4", - "tinyrainbow": "^2.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/acorn": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", - "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", - "dev": true, - "license": "MIT", - "peer": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/agent-base": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", - "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true, - "license": "Python-2.0" - }, - "node_modules/assertion-error": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", - "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/bidi-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/bidi-js/-/bidi-js-1.0.3.tgz", - "integrity": "sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==", - "dev": true, - "license": "MIT", - "dependencies": { - "require-from-string": "^2.0.2" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/cac": { - "version": "6.7.14", - "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", - "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/ccount": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", - "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", - "dev": true, - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/chai": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", - "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", - "dev": true, - "license": "MIT", - "dependencies": { - "assertion-error": "^2.0.1", - "check-error": "^2.1.1", - "deep-eql": "^5.0.1", - "loupe": "^3.1.0", - "pathval": "^2.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/character-entities": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", - "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", - "dev": true, - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/check-error": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", - "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 16" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "license": "MIT" - }, - "node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/css-tree": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-3.1.0.tgz", - "integrity": "sha512-0eW44TGN5SQXU1mWSkKwFstI/22X2bG1nYzZTYMAWjylYURhse752YgbE4Cx46AC+bAvI+/dYTPRk1LqSUnu6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "mdn-data": "2.12.2", - "source-map-js": "^1.0.1" - }, - "engines": { - "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" - } - }, - "node_modules/cssstyle": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-5.3.3.tgz", - "integrity": "sha512-OytmFH+13/QXONJcC75QNdMtKpceNk3u8ThBjyyYjkEcy/ekBwR1mMAuNvi3gdBPW3N5TlCzQ0WZw8H0lN/bDw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@asamuzakjp/css-color": "^4.0.3", - "@csstools/css-syntax-patches-for-csstree": "^1.0.14", - "css-tree": "^3.1.0" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/data-urls": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-6.0.0.tgz", - "integrity": "sha512-BnBS08aLUM+DKamupXs3w2tJJoqU+AkaE/+6vQxi/G/DPmIZFJJp9Dkb1kM03AZx8ADehDUZgsNxju3mPXZYIA==", - "dev": true, - "license": "MIT", - "dependencies": { - "whatwg-mimetype": "^4.0.0", - "whatwg-url": "^15.0.0" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/decimal.js": { - "version": "10.6.0", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz", - "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", - "dev": true, - "license": "MIT" - }, - "node_modules/decode-named-character-reference": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.2.0.tgz", - "integrity": "sha512-c6fcElNV6ShtZXmsgNgFFV5tVX2PaV4g+MOAkb8eXHvn6sryJBrZa9r0zV6+dtTyoCKxtDy5tyQ5ZwQuidtd+Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "character-entities": "^2.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/deep-eql": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", - "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/dequal": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", - "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/devlop": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", - "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", - "dev": true, - "license": "MIT", - "dependencies": { - "dequal": "^2.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/entities": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", - "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, - "node_modules/es-module-lexer": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", - "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", - "dev": true, - "license": "MIT" - }, - "node_modules/esbuild": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", - "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.25.12", - "@esbuild/android-arm": "0.25.12", - "@esbuild/android-arm64": "0.25.12", - "@esbuild/android-x64": "0.25.12", - "@esbuild/darwin-arm64": "0.25.12", - "@esbuild/darwin-x64": "0.25.12", - "@esbuild/freebsd-arm64": "0.25.12", - "@esbuild/freebsd-x64": "0.25.12", - "@esbuild/linux-arm": "0.25.12", - "@esbuild/linux-arm64": "0.25.12", - "@esbuild/linux-ia32": "0.25.12", - "@esbuild/linux-loong64": "0.25.12", - "@esbuild/linux-mips64el": "0.25.12", - "@esbuild/linux-ppc64": "0.25.12", - "@esbuild/linux-riscv64": "0.25.12", - "@esbuild/linux-s390x": "0.25.12", - "@esbuild/linux-x64": "0.25.12", - "@esbuild/netbsd-arm64": "0.25.12", - "@esbuild/netbsd-x64": "0.25.12", - "@esbuild/openbsd-arm64": "0.25.12", - "@esbuild/openbsd-x64": "0.25.12", - "@esbuild/openharmony-arm64": "0.25.12", - "@esbuild/sunos-x64": "0.25.12", - "@esbuild/win32-arm64": "0.25.12", - "@esbuild/win32-ia32": "0.25.12", - "@esbuild/win32-x64": "0.25.12" - } - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint": { - "version": "9.39.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.1.tgz", - "integrity": "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.8.0", - "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.21.1", - "@eslint/config-helpers": "^0.4.2", - "@eslint/core": "^0.17.0", - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "9.39.1", - "@eslint/plugin-kit": "^0.4.1", - "@humanfs/node": "^0.16.6", - "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.4.2", - "@types/estree": "^1.0.6", - "ajv": "^6.12.4", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.6", - "debug": "^4.3.2", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.4.0", - "eslint-visitor-keys": "^4.2.1", - "espree": "^10.4.0", - "esquery": "^1.5.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^8.0.0", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "ignore": "^5.2.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://eslint.org/donate" - }, - "peerDependencies": { - "jiti": "*" - }, - "peerDependenciesMeta": { - "jiti": { - "optional": true - } - } - }, - "node_modules/eslint-scope": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", - "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", - "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint/node_modules/@eslint/core": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", - "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@types/json-schema": "^7.0.15" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/eslint/node_modules/@eslint/plugin-kit": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", - "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/core": "^0.17.0", - "levn": "^0.4.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/espree": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", - "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "acorn": "^8.15.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.2.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/esquery": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", - "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expect-type": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.2.2.tgz", - "integrity": "sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true, - "license": "MIT" - }, - "node_modules/fault": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fault/-/fault-2.0.1.tgz", - "integrity": "sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "format": "^0.2.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/fdir": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", - "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/file-entry-cache": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", - "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "flat-cache": "^4.0.0" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "license": "MIT", - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat-cache": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", - "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", - "dev": true, - "license": "MIT", - "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.4" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/flatted": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", - "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", - "dev": true, - "license": "ISC" - }, - "node_modules/format": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz", - "integrity": "sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==", - "dev": true, - "engines": { - "node": ">=0.4.x" - } - }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/github-slugger": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz", - "integrity": "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==", - "dev": true, - "license": "ISC" - }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/globals": { - "version": "16.5.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-16.5.0.tgz", - "integrity": "sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/html-encoding-sniffer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", - "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "whatwg-encoding": "^3.1.1" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/http-proxy-agent": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", - "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.0", - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/https-proxy-agent": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", - "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ignore": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", - "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", - "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-potential-custom-element-name": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", - "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "license": "ISC" - }, - "node_modules/js-tokens": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", - "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/js-yaml": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", - "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/jsdom": { - "version": "27.2.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-27.2.0.tgz", - "integrity": "sha512-454TI39PeRDW1LgpyLPyURtB4Zx1tklSr6+OFOipsxGUH1WMTvk6C65JQdrj455+DP2uJ1+veBEHTGFKWVLFoA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@acemir/cssom": "^0.9.23", - "@asamuzakjp/dom-selector": "^6.7.4", - "cssstyle": "^5.3.3", - "data-urls": "^6.0.0", - "decimal.js": "^10.6.0", - "html-encoding-sniffer": "^4.0.0", - "http-proxy-agent": "^7.0.2", - "https-proxy-agent": "^7.0.6", - "is-potential-custom-element-name": "^1.0.1", - "parse5": "^8.0.0", - "saxes": "^6.0.0", - "symbol-tree": "^3.2.4", - "tough-cookie": "^6.0.0", - "w3c-xmlserializer": "^5.0.0", - "webidl-conversions": "^8.0.0", - "whatwg-encoding": "^3.1.1", - "whatwg-mimetype": "^4.0.0", - "whatwg-url": "^15.1.0", - "ws": "^8.18.3", - "xml-name-validator": "^5.0.0" - }, - "engines": { - "node": "^20.19.0 || ^22.12.0 || >=24.0.0" - }, - "peerDependencies": { - "canvas": "^3.0.0" - }, - "peerDependenciesMeta": { - "canvas": { - "optional": true - } - } - }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true, - "license": "MIT" - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/keyv": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", - "dev": true, - "license": "MIT", - "dependencies": { - "json-buffer": "3.0.1" - } - }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/longest-streak": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", - "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", - "dev": true, - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/loupe": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz", - "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/lru-cache": { - "version": "11.2.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.2.tgz", - "integrity": "sha512-F9ODfyqML2coTIsQpSkRHnLSZMtkU8Q+mSfcaIyKwy58u+8k5nvAYeiNhsyMARvzNcXJ9QfWVrcPsC9e9rAxtg==", - "dev": true, - "license": "ISC", - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/magic-string": { - "version": "0.30.21", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", - "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.5" - } - }, - "node_modules/markdown-table": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.4.tgz", - "integrity": "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==", - "dev": true, - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/mdast-util-find-and-replace": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.2.tgz", - "integrity": "sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "escape-string-regexp": "^5.0.0", - "unist-util-is": "^6.0.0", - "unist-util-visit-parents": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mdast-util-from-markdown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.2.tgz", - "integrity": "sha512-uZhTV/8NBuw0WHkPTrCqDOl0zVe1BIng5ZtHoDk49ME1qqcjYmmLmOf0gELgcRMxN4w2iuIeVso5/6QymSrgmA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "@types/unist": "^3.0.0", - "decode-named-character-reference": "^1.0.0", - "devlop": "^1.0.0", - "mdast-util-to-string": "^4.0.0", - "micromark": "^4.0.0", - "micromark-util-decode-numeric-character-reference": "^2.0.0", - "micromark-util-decode-string": "^2.0.0", - "micromark-util-normalize-identifier": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0", - "unist-util-stringify-position": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-frontmatter": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/mdast-util-frontmatter/-/mdast-util-frontmatter-2.0.1.tgz", - "integrity": "sha512-LRqI9+wdgC25P0URIJY9vwocIzCcksduHQ9OF2joxQoyTNVduwLAFUzjoopuRJbJAReaKrNQKAZKL3uCMugWJA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "devlop": "^1.0.0", - "escape-string-regexp": "^5.0.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0", - "micromark-extension-frontmatter": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-frontmatter/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mdast-util-gfm": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.1.0.tgz", - "integrity": "sha512-0ulfdQOM3ysHhCJ1p06l0b0VKlhU0wuQs3thxZQagjcjPrlFRqY215uZGHHJan9GEAXd9MbfPjFJz+qMkVR6zQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-gfm-autolink-literal": "^2.0.0", - "mdast-util-gfm-footnote": "^2.0.0", - "mdast-util-gfm-strikethrough": "^2.0.0", - "mdast-util-gfm-table": "^2.0.0", - "mdast-util-gfm-task-list-item": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-gfm-autolink-literal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.1.tgz", - "integrity": "sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "ccount": "^2.0.0", - "devlop": "^1.0.0", - "mdast-util-find-and-replace": "^3.0.0", - "micromark-util-character": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-gfm-footnote": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.1.0.tgz", - "integrity": "sha512-sqpDWlsHn7Ac9GNZQMeUzPQSMzR6Wv0WKRNvQRg0KqHh02fpTz69Qc1QSseNX29bhz1ROIyNyxExfawVKTm1GQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "devlop": "^1.1.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0", - "micromark-util-normalize-identifier": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-gfm-strikethrough": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz", - "integrity": "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-gfm-table": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz", - "integrity": "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "devlop": "^1.0.0", - "markdown-table": "^3.0.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-gfm-task-list-item": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz", - "integrity": "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "devlop": "^1.0.0", - "mdast-util-from-markdown": "^2.0.0", - "mdast-util-to-markdown": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-phrasing": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", - "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "unist-util-is": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-to-markdown": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.2.tgz", - "integrity": "sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0", - "@types/unist": "^3.0.0", - "longest-streak": "^3.0.0", - "mdast-util-phrasing": "^4.0.0", - "mdast-util-to-string": "^4.0.0", - "micromark-util-classify-character": "^2.0.0", - "micromark-util-decode-string": "^2.0.0", - "unist-util-visit": "^5.0.0", - "zwitch": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdast-util-to-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", - "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/mdast": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/mdn-data": { - "version": "2.12.2", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.12.2.tgz", - "integrity": "sha512-IEn+pegP1aManZuckezWCO+XZQDplx1366JoVhTpMpBB1sPey/SbveZQUosKiKiGYjg1wH4pMlNgXbCiYgihQA==", - "dev": true, - "license": "CC0-1.0" - }, - "node_modules/micromark": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz", - "integrity": "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "@types/debug": "^4.0.0", - "debug": "^4.0.0", - "decode-named-character-reference": "^1.0.0", - "devlop": "^1.0.0", - "micromark-core-commonmark": "^2.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-chunked": "^2.0.0", - "micromark-util-combine-extensions": "^2.0.0", - "micromark-util-decode-numeric-character-reference": "^2.0.0", - "micromark-util-encode": "^2.0.0", - "micromark-util-normalize-identifier": "^2.0.0", - "micromark-util-resolve-all": "^2.0.0", - "micromark-util-sanitize-uri": "^2.0.0", - "micromark-util-subtokenize": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-core-commonmark": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.3.tgz", - "integrity": "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "decode-named-character-reference": "^1.0.0", - "devlop": "^1.0.0", - "micromark-factory-destination": "^2.0.0", - "micromark-factory-label": "^2.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-factory-title": "^2.0.0", - "micromark-factory-whitespace": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-chunked": "^2.0.0", - "micromark-util-classify-character": "^2.0.0", - "micromark-util-html-tag-name": "^2.0.0", - "micromark-util-normalize-identifier": "^2.0.0", - "micromark-util-resolve-all": "^2.0.0", - "micromark-util-subtokenize": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-extension-frontmatter": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-frontmatter/-/micromark-extension-frontmatter-2.0.0.tgz", - "integrity": "sha512-C4AkuM3dA58cgZha7zVnuVxBhDsbttIMiytjgsM2XbHAB2faRVaHRle40558FBN+DJcrLNCoqG5mlrpdU4cRtg==", - "dev": true, - "license": "MIT", - "dependencies": { - "fault": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz", - "integrity": "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==", - "dev": true, - "license": "MIT", - "dependencies": { - "micromark-extension-gfm-autolink-literal": "^2.0.0", - "micromark-extension-gfm-footnote": "^2.0.0", - "micromark-extension-gfm-strikethrough": "^2.0.0", - "micromark-extension-gfm-table": "^2.0.0", - "micromark-extension-gfm-tagfilter": "^2.0.0", - "micromark-extension-gfm-task-list-item": "^2.0.0", - "micromark-util-combine-extensions": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-autolink-literal": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.1.0.tgz", - "integrity": "sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==", - "dev": true, - "license": "MIT", - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-sanitize-uri": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-footnote": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.1.0.tgz", - "integrity": "sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw==", - "dev": true, - "license": "MIT", - "dependencies": { - "devlop": "^1.0.0", - "micromark-core-commonmark": "^2.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-normalize-identifier": "^2.0.0", - "micromark-util-sanitize-uri": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-strikethrough": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.1.0.tgz", - "integrity": "sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw==", - "dev": true, - "license": "MIT", - "dependencies": { - "devlop": "^1.0.0", - "micromark-util-chunked": "^2.0.0", - "micromark-util-classify-character": "^2.0.0", - "micromark-util-resolve-all": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-table": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.1.tgz", - "integrity": "sha512-t2OU/dXXioARrC6yWfJ4hqB7rct14e8f7m0cbI5hUmDyyIlwv5vEtooptH8INkbLzOatzKuVbQmAYcbWoyz6Dg==", - "dev": true, - "license": "MIT", - "dependencies": { - "devlop": "^1.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-tagfilter": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz", - "integrity": "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==", - "dev": true, - "license": "MIT", - "dependencies": { - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-extension-gfm-task-list-item": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.1.0.tgz", - "integrity": "sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw==", - "dev": true, - "license": "MIT", - "dependencies": { - "devlop": "^1.0.0", - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/micromark-factory-destination": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz", - "integrity": "sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-factory-label": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz", - "integrity": "sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "devlop": "^1.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-factory-space": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz", - "integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-factory-title": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz", - "integrity": "sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-factory-whitespace": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz", - "integrity": "sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-factory-space": "^2.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-util-character": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", - "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-util-chunked": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz", - "integrity": "sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-symbol": "^2.0.0" - } - }, - "node_modules/micromark-util-classify-character": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz", - "integrity": "sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-util-combine-extensions": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz", - "integrity": "sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-chunked": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-util-decode-numeric-character-reference": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz", - "integrity": "sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-symbol": "^2.0.0" - } - }, - "node_modules/micromark-util-decode-string": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.1.tgz", - "integrity": "sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "decode-named-character-reference": "^1.0.0", - "micromark-util-character": "^2.0.0", - "micromark-util-decode-numeric-character-reference": "^2.0.0", - "micromark-util-symbol": "^2.0.0" - } - }, - "node_modules/micromark-util-encode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz", - "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/micromark-util-html-tag-name": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz", - "integrity": "sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/micromark-util-normalize-identifier": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz", - "integrity": "sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-symbol": "^2.0.0" - } - }, - "node_modules/micromark-util-resolve-all": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz", - "integrity": "sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-util-sanitize-uri": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz", - "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-character": "^2.0.0", - "micromark-util-encode": "^2.0.0", - "micromark-util-symbol": "^2.0.0" - } - }, - "node_modules/micromark-util-subtokenize": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.1.0.tgz", - "integrity": "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "devlop": "^1.0.0", - "micromark-util-chunked": "^2.0.0", - "micromark-util-symbol": "^2.0.0", - "micromark-util-types": "^2.0.0" - } - }, - "node_modules/micromark-util-symbol": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", - "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/micromark-util-types": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz", - "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==", - "dev": true, - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, - "node_modules/nanoid": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", - "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, - "license": "MIT" - }, - "node_modules/optionator": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", - "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", - "dev": true, - "license": "MIT", - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.5" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "license": "MIT", - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/parse5": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-8.0.0.tgz", - "integrity": "sha512-9m4m5GSgXjL4AjumKzq1Fgfp3Z8rsvjRNbnkVwfu2ImRqE5D0LnY2QfDen18FSY9C573YU5XxSapdHZTZ2WolA==", - "dev": true, - "license": "MIT", - "dependencies": { - "entities": "^6.0.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/pathe": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", - "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", - "dev": true, - "license": "MIT" - }, - "node_modules/pathval": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", - "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14.16" - } - }, - "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, - "license": "ISC" - }, - "node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/playwright": { - "version": "1.56.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.56.1.tgz", - "integrity": "sha512-aFi5B0WovBHTEvpM3DzXTUaeN6eN0qWnTkKx4NQaH4Wvcmc153PdaY2UBdSYKaGYw+UyWXSVyxDUg5DoPEttjw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "playwright-core": "1.56.1" - }, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "fsevents": "2.3.2" - } - }, - "node_modules/playwright-core": { - "version": "1.56.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.56.1.tgz", - "integrity": "sha512-hutraynyn31F+Bifme+Ps9Vq59hKuUCz7H1kDOcBs+2oGguKkWTU50bBWrtz34OUWmIwpBTWDxaRPXrIXkgvmQ==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "playwright-core": "cli.js" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/postcss": { - "version": "8.5.6", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", - "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "nanoid": "^3.3.11", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/rollup": { - "version": "4.53.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.53.2.tgz", - "integrity": "sha512-MHngMYwGJVi6Fmnk6ISmnk7JAHRNF0UkuucA0CUW3N3a4KnONPEZz+vUanQP/ZC/iY1Qkf3bwPWzyY84wEks1g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "1.0.8" - }, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.53.2", - "@rollup/rollup-android-arm64": "4.53.2", - "@rollup/rollup-darwin-arm64": "4.53.2", - "@rollup/rollup-darwin-x64": "4.53.2", - "@rollup/rollup-freebsd-arm64": "4.53.2", - "@rollup/rollup-freebsd-x64": "4.53.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.53.2", - "@rollup/rollup-linux-arm-musleabihf": "4.53.2", - "@rollup/rollup-linux-arm64-gnu": "4.53.2", - "@rollup/rollup-linux-arm64-musl": "4.53.2", - "@rollup/rollup-linux-loong64-gnu": "4.53.2", - "@rollup/rollup-linux-ppc64-gnu": "4.53.2", - "@rollup/rollup-linux-riscv64-gnu": "4.53.2", - "@rollup/rollup-linux-riscv64-musl": "4.53.2", - "@rollup/rollup-linux-s390x-gnu": "4.53.2", - "@rollup/rollup-linux-x64-gnu": "4.53.2", - "@rollup/rollup-linux-x64-musl": "4.53.2", - "@rollup/rollup-openharmony-arm64": "4.53.2", - "@rollup/rollup-win32-arm64-msvc": "4.53.2", - "@rollup/rollup-win32-ia32-msvc": "4.53.2", - "@rollup/rollup-win32-x64-gnu": "4.53.2", - "@rollup/rollup-win32-x64-msvc": "4.53.2", - "fsevents": "~2.3.2" - } - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true, - "license": "MIT" - }, - "node_modules/saxes": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", - "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", - "dev": true, - "license": "ISC", - "dependencies": { - "xmlchars": "^2.2.0" - }, - "engines": { - "node": ">=v12.22.7" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/siginfo": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", - "dev": true, - "license": "ISC" - }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "license": "MIT", - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/stackback": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", - "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", - "dev": true, - "license": "MIT" - }, - "node_modules/std-env": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", - "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", - "dev": true, - "license": "MIT" - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/strip-literal": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-3.1.0.tgz", - "integrity": "sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==", - "dev": true, - "license": "MIT", - "dependencies": { - "js-tokens": "^9.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/symbol-tree": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", - "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", - "dev": true, - "license": "MIT" - }, - "node_modules/terser": { - "version": "5.44.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.44.1.tgz", - "integrity": "sha512-t/R3R/n0MSwnnazuPpPNVO60LX0SKL45pyl9YlvxIdkH0Of7D5qM2EVe+yASRIlY5pZ73nclYJfNANGWPwFDZw==", - "dev": true, - "license": "BSD-2-Clause", - "peer": true, - "dependencies": { - "@jridgewell/source-map": "^0.3.3", - "acorn": "^8.15.0", - "commander": "^2.20.0", - "source-map-support": "~0.5.20" - }, - "bin": { - "terser": "bin/terser" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/tinybench": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", - "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", - "dev": true, - "license": "MIT" - }, - "node_modules/tinyexec": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", - "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", - "dev": true, - "license": "MIT" - }, - "node_modules/tinyglobby": { - "version": "0.2.15", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", - "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "fdir": "^6.5.0", - "picomatch": "^4.0.3" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/SuperchupuDev" - } - }, - "node_modules/tinypool": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", - "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.0.0 || >=20.0.0" - } - }, - "node_modules/tinyrainbow": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz", - "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/tinyspy": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.4.tgz", - "integrity": "sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/tldts": { - "version": "7.0.18", - "resolved": "https://registry.npmjs.org/tldts/-/tldts-7.0.18.tgz", - "integrity": "sha512-lCcgTAgMxQ1JKOWrVGo6E69Ukbnx4Gc1wiYLRf6J5NN4HRYJtCby1rPF8rkQ4a6qqoFBK5dvjJ1zJ0F7VfDSvw==", - "dev": true, - "license": "MIT", - "dependencies": { - "tldts-core": "^7.0.18" - }, - "bin": { - "tldts": "bin/cli.js" - } - }, - "node_modules/tldts-core": { - "version": "7.0.18", - "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-7.0.18.tgz", - "integrity": "sha512-jqJC13oP4FFAahv4JT/0WTDrCF9Okv7lpKtOZUGPLiAnNbACcSg8Y8T+Z9xthOmRBqi/Sob4yi0TE0miRCvF7Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/tough-cookie": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-6.0.0.tgz", - "integrity": "sha512-kXuRi1mtaKMrsLUxz3sQYvVl37B0Ns6MzfrtV5DvJceE9bPyspOqk9xxv7XbZWcfLWbFmm997vl83qUWVJA64w==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "tldts": "^7.0.5" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/tr46": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-6.0.0.tgz", - "integrity": "sha512-bLVMLPtstlZ4iMQHpFHTR7GAGj2jxi8Dg0s2h2MafAE4uSWF98FC/3MomU51iQAMf8/qDUbKWf5GxuvvVcXEhw==", - "dev": true, - "license": "MIT", - "dependencies": { - "punycode": "^2.3.1" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "license": "MIT", - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/unist-util-is": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz", - "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-stringify-position": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", - "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-visit": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", - "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0", - "unist-util-visit-parents": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/unist-util-visit-parents": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz", - "integrity": "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/vite": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/vite/-/vite-7.2.2.tgz", - "integrity": "sha512-BxAKBWmIbrDgrokdGZH1IgkIk/5mMHDreLDmCJ0qpyJaAteP8NvMhkwr/ZCQNqNH97bw/dANTE9PDzqwJghfMQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild": "^0.25.0", - "fdir": "^6.5.0", - "picomatch": "^4.0.3", - "postcss": "^8.5.6", - "rollup": "^4.43.0", - "tinyglobby": "^0.2.15" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^20.19.0 || >=22.12.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^20.19.0 || >=22.12.0", - "jiti": ">=1.21.0", - "less": "^4.0.0", - "lightningcss": "^1.21.0", - "sass": "^1.70.0", - "sass-embedded": "^1.70.0", - "stylus": ">=0.54.8", - "sugarss": "^5.0.0", - "terser": "^5.16.0", - "tsx": "^4.8.1", - "yaml": "^2.4.2" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "jiti": { - "optional": true - }, - "less": { - "optional": true - }, - "lightningcss": { - "optional": true - }, - "sass": { - "optional": true - }, - "sass-embedded": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - }, - "tsx": { - "optional": true - }, - "yaml": { - "optional": true - } - } - }, - "node_modules/vite-node": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.2.4.tgz", - "integrity": "sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==", - "dev": true, - "license": "MIT", - "dependencies": { - "cac": "^6.7.14", - "debug": "^4.4.1", - "es-module-lexer": "^1.7.0", - "pathe": "^2.0.3", - "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" - }, - "bin": { - "vite-node": "vite-node.mjs" - }, - "engines": { - "node": "^18.0.0 || ^20.0.0 || >=22.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/vite-plugin-banner": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/vite-plugin-banner/-/vite-plugin-banner-0.8.1.tgz", - "integrity": "sha512-0+gGguHk3MH0HvzMSOCJC6fGgH4+jtY9KlKVZh+hwwE+PBkGVzY8xe657JL74vEgbeUJD37XjVqTrmve8XvZBQ==", - "license": "MIT" - }, - "node_modules/vite/node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/vitest": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.4.tgz", - "integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/chai": "^5.2.2", - "@vitest/expect": "3.2.4", - "@vitest/mocker": "3.2.4", - "@vitest/pretty-format": "^3.2.4", - "@vitest/runner": "3.2.4", - "@vitest/snapshot": "3.2.4", - "@vitest/spy": "3.2.4", - "@vitest/utils": "3.2.4", - "chai": "^5.2.0", - "debug": "^4.4.1", - "expect-type": "^1.2.1", - "magic-string": "^0.30.17", - "pathe": "^2.0.3", - "picomatch": "^4.0.2", - "std-env": "^3.9.0", - "tinybench": "^2.9.0", - "tinyexec": "^0.3.2", - "tinyglobby": "^0.2.14", - "tinypool": "^1.1.1", - "tinyrainbow": "^2.0.0", - "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0", - "vite-node": "3.2.4", - "why-is-node-running": "^2.3.0" - }, - "bin": { - "vitest": "vitest.mjs" - }, - "engines": { - "node": "^18.0.0 || ^20.0.0 || >=22.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "@edge-runtime/vm": "*", - "@types/debug": "^4.1.12", - "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", - "@vitest/browser": "3.2.4", - "@vitest/ui": "3.2.4", - "happy-dom": "*", - "jsdom": "*" - }, - "peerDependenciesMeta": { - "@edge-runtime/vm": { - "optional": true - }, - "@types/debug": { - "optional": true - }, - "@types/node": { - "optional": true - }, - "@vitest/browser": { - "optional": true - }, - "@vitest/ui": { - "optional": true - }, - "happy-dom": { - "optional": true - }, - "jsdom": { - "optional": true - } - } - }, - "node_modules/w3c-xmlserializer": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", - "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", - "dev": true, - "license": "MIT", - "dependencies": { - "xml-name-validator": "^5.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/webidl-conversions": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-8.0.0.tgz", - "integrity": "sha512-n4W4YFyz5JzOfQeA8oN7dUYpR+MBP3PIUsn2jLjWXwK5ASUzt0Jc/A5sAUZoCYFJRGF0FBKJ+1JjN43rNdsQzA==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=20" - } - }, - "node_modules/whatwg-encoding": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", - "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "iconv-lite": "0.6.3" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/whatwg-mimetype": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", - "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - } - }, - "node_modules/whatwg-url": { - "version": "15.1.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-15.1.0.tgz", - "integrity": "sha512-2ytDk0kiEj/yu90JOAp44PVPUkO9+jVhyf+SybKlRHSDlvOOZhdPIrr7xTH64l4WixO2cP+wQIcgujkGBPPz6g==", - "dev": true, - "license": "MIT", - "dependencies": { - "tr46": "^6.0.0", - "webidl-conversions": "^8.0.0" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/why-is-node-running": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", - "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", - "dev": true, - "license": "MIT", - "dependencies": { - "siginfo": "^2.0.0", - "stackback": "0.0.2" - }, - "bin": { - "why-is-node-running": "cli.js" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ws": { - "version": "8.18.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", - "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/xml-name-validator": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", - "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=18" - } - }, - "node_modules/xmlchars": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", - "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", - "dev": true, - "license": "MIT" - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/zwitch": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", - "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", - "dev": true, - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - } - } -} diff --git a/package.json b/package.json index 4c038e8..98440cb 100644 --- a/package.json +++ b/package.json @@ -1,32 +1,49 @@ { - "name": "blapy2", - "version": "2.0.2", - "description": "", + "name": "klapy", + "version": "2.1.2", + "description": "klapy is an optimised blapy version by Karibsen", "main": "index.js", "scripts": { "test:units": "vitest tests/units", "test:e2e": "playwright test tests/e2e", - "build": "vite build", - "build:watch": "nodemon --watch src --ext js --exec \"pnpm vite build\"", + "build": "vite build && vite build --config vite.blapymotion.config.ts && vite build --config vite.blapysocket.config.ts", + "build:watch": "vite build --watch", "ws": "nodemon demos/websocket/server.js" }, "keywords": [], - "author": "E.PODVIN", + "author": { + "name": "", + "url": "https://karibsen.fr" + }, "license": "DonationWare", "devDependencies": { "@eslint/js": "^9.32.0", "@eslint/json": "^0.13.1", "@eslint/markdown": "^7.1.0", "@playwright/test": "^1.54.2", + "@types/mustache": "^4.2.6", "eslint": "^9.32.0", "globals": "^16.3.0", + "jsdom": "latest", "playwright": "^1.54.2", "terser": "^5.43.1", "vite": "^7.0.6", - "vitest": "^3.2.4", - "jsdom": "latest" + "vitest": "^3.2.4" }, "dependencies": { + "@types/node": "^25.4.0", + "json5": "^2.2.3", + "mustache": "^4.2.0", + "navigo": "^8.11.1", + "node-json2html": "^3.3.3", + "typescript": "^5.9.3", "vite-plugin-banner": "^0.8.1" - } + }, + "exports": { + "./shared": "./src/shared/*.js" + }, + "imports": { + "#shared/*": "./src/shared/*/index.ts" + }, + "packageManager": "pnpm@9.15.2+sha512.93e57b0126f0df74ce6bff29680394c0ba54ec47246b9cf321f0121d8d9bb03f750a705f24edc3c1180853afd7c2c3b94196d0a3d53d3e069d9e2793ef11f321" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5f7db96..829361f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,24 @@ importers: .: dependencies: + '@types/node': + specifier: ^25.4.0 + version: 25.4.0 + json5: + specifier: ^2.2.3 + version: 2.2.3 + mustache: + specifier: ^4.2.0 + version: 4.2.0 + navigo: + specifier: ^8.11.1 + version: 8.11.1 + node-json2html: + specifier: ^3.3.3 + version: 3.3.3 + typescript: + specifier: ^5.9.3 + version: 5.9.3 vite-plugin-banner: specifier: ^0.8.1 version: 0.8.1 @@ -24,6 +42,9 @@ importers: '@playwright/test': specifier: ^1.54.2 version: 1.54.2 + '@types/mustache': + specifier: ^4.2.6 + version: 4.2.6 eslint: specifier: ^9.32.0 version: 9.32.0 @@ -41,10 +62,10 @@ importers: version: 5.43.1 vite: specifier: ^7.0.6 - version: 7.0.6(terser@5.43.1) + version: 7.0.6(@types/node@25.4.0)(terser@5.43.1) vitest: specifier: ^3.2.4 - version: 3.2.4(@types/debug@4.1.12)(jsdom@26.1.0)(terser@5.43.1) + version: 3.2.4(@types/debug@4.1.12)(@types/node@25.4.0)(jsdom@26.1.0)(terser@5.43.1) packages: @@ -447,6 +468,12 @@ packages: '@types/ms@2.1.0': resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==} + '@types/mustache@4.2.6': + resolution: {integrity: sha512-t+8/QWTAhOFlrF1IVZqKnMRJi84EgkIK5Kh0p2JV4OLywUvCwJPFxbJAl7XAow7DVIHsF+xW9f1MVzg0L6Szjw==} + + '@types/node@25.4.0': + resolution: {integrity: sha512-9wLpoeWuBlcbBpOY3XmzSTG3oscB6xjBEEtn+pYXTfhyXhIxC5FsBer2KTopBlvKEiW9l13po9fq+SJY/5lkhw==} + '@types/unist@3.0.3': resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} @@ -800,6 +827,11 @@ packages: json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + json5@2.2.3: + resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} + engines: {node: '>=6'} + hasBin: true + keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} @@ -958,6 +990,10 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + mustache@4.2.0: + resolution: {integrity: sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==} + hasBin: true + nanoid@3.3.11: resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -966,6 +1002,12 @@ packages: natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + navigo@8.11.1: + resolution: {integrity: sha512-e3sc1UzakF+bWquC8/dbPCgo7LgPEW1ekgwb4pmEcl8tOc/I7lML8r7HBql+b0VRk7tJWTZqtkeObwJAVR1pxg==} + + node-json2html@3.3.3: + resolution: {integrity: sha512-IO/sloXjdpWhjLrRvlI+73LpPXnKuUXaBYFNdbDEnl5LoNfTWcwmy/WsiCJl1wvF2aMMSxZoyovwBLouyvOebw==} + nwsapi@2.2.21: resolution: {integrity: sha512-o6nIY3qwiSXl7/LuOU0Dmuctd34Yay0yeuZRLFmDPrrdHpXKFndPj3hM+YEPVHYC5fx2otBx4Ilc/gyYSAUaIA==} @@ -1139,6 +1181,14 @@ packages: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + engines: {node: '>=14.17'} + hasBin: true + + undici-types@7.18.2: + resolution: {integrity: sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==} + unist-util-is@6.0.0: resolution: {integrity: sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==} @@ -1580,6 +1630,12 @@ snapshots: '@types/ms@2.1.0': {} + '@types/mustache@4.2.6': {} + + '@types/node@25.4.0': + dependencies: + undici-types: 7.18.2 + '@types/unist@3.0.3': {} '@vitest/expect@3.2.4': @@ -1590,13 +1646,13 @@ snapshots: chai: 5.2.1 tinyrainbow: 2.0.0 - '@vitest/mocker@3.2.4(vite@7.0.6(terser@5.43.1))': + '@vitest/mocker@3.2.4(vite@7.0.6(@types/node@25.4.0)(terser@5.43.1))': dependencies: '@vitest/spy': 3.2.4 estree-walker: 3.0.3 magic-string: 0.30.17 optionalDependencies: - vite: 7.0.6(terser@5.43.1) + vite: 7.0.6(@types/node@25.4.0)(terser@5.43.1) '@vitest/pretty-format@3.2.4': dependencies: @@ -1965,6 +2021,8 @@ snapshots: json-stable-stringify-without-jsonify@1.0.1: {} + json5@2.2.3: {} + keyv@4.5.4: dependencies: json-buffer: 3.0.1 @@ -2309,10 +2367,16 @@ snapshots: ms@2.1.3: {} + mustache@4.2.0: {} + nanoid@3.3.11: {} natural-compare@1.4.0: {} + navigo@8.11.1: {} + + node-json2html@3.3.3: {} + nwsapi@2.2.21: {} optionator@0.9.4: @@ -2479,6 +2543,10 @@ snapshots: dependencies: prelude-ls: 1.2.1 + typescript@5.9.3: {} + + undici-types@7.18.2: {} + unist-util-is@6.0.0: dependencies: '@types/unist': 3.0.3 @@ -2502,13 +2570,13 @@ snapshots: dependencies: punycode: 2.3.1 - vite-node@3.2.4(terser@5.43.1): + vite-node@3.2.4(@types/node@25.4.0)(terser@5.43.1): dependencies: cac: 6.7.14 debug: 4.4.1 es-module-lexer: 1.7.0 pathe: 2.0.3 - vite: 7.0.6(terser@5.43.1) + vite: 7.0.6(@types/node@25.4.0)(terser@5.43.1) transitivePeerDependencies: - '@types/node' - jiti @@ -2525,7 +2593,7 @@ snapshots: vite-plugin-banner@0.8.1: {} - vite@7.0.6(terser@5.43.1): + vite@7.0.6(@types/node@25.4.0)(terser@5.43.1): dependencies: esbuild: 0.25.8 fdir: 6.4.6(picomatch@4.0.3) @@ -2534,14 +2602,15 @@ snapshots: rollup: 4.46.2 tinyglobby: 0.2.14 optionalDependencies: + '@types/node': 25.4.0 fsevents: 2.3.3 terser: 5.43.1 - vitest@3.2.4(@types/debug@4.1.12)(jsdom@26.1.0)(terser@5.43.1): + vitest@3.2.4(@types/debug@4.1.12)(@types/node@25.4.0)(jsdom@26.1.0)(terser@5.43.1): dependencies: '@types/chai': 5.2.2 '@vitest/expect': 3.2.4 - '@vitest/mocker': 3.2.4(vite@7.0.6(terser@5.43.1)) + '@vitest/mocker': 3.2.4(vite@7.0.6(@types/node@25.4.0)(terser@5.43.1)) '@vitest/pretty-format': 3.2.4 '@vitest/runner': 3.2.4 '@vitest/snapshot': 3.2.4 @@ -2559,11 +2628,12 @@ snapshots: tinyglobby: 0.2.14 tinypool: 1.1.1 tinyrainbow: 2.0.0 - vite: 7.0.6(terser@5.43.1) - vite-node: 3.2.4(terser@5.43.1) + vite: 7.0.6(@types/node@25.4.0)(terser@5.43.1) + vite-node: 3.2.4(@types/node@25.4.0)(terser@5.43.1) why-is-node-running: 2.3.0 optionalDependencies: '@types/debug': 4.1.12 + '@types/node': 25.4.0 jsdom: 26.1.0 transitivePeerDependencies: - jiti diff --git a/readme.md b/readme.md index 823268c..5fc53a8 100644 --- a/readme.md +++ b/readme.md @@ -2,11 +2,12 @@ > If you like Blapy2, I'll be pleased that you star it :-) -Blapy2 is a modern ES6 JavaScript framework that helps you create and manage AJAX and single-page web applications (SPA) with minimal JavaScript coding. This is the modernized version of the original Blapy framework, built with ES6 modules, improved architecture, and enhanced developer experience. +Blapy2 is a modern ES6 JavaScript framework that helps you create and manage AJAX and single-page web applications (SPA) with minimal JavaScript coding. It is the modernized version of the original Blapy framework, rebuilt with ES6 modules, an improved architecture, and an enhanced developer experience. -Your web application is built the usual way of generating web pages (like with PHP or any standard CMS), and Blapy2 will transform it into a dynamic web application with ajaxified content updates. +Your web application is built in the usual way, by generating web pages on the server (for example with PHP or any standard CMS), and Blapy2 transforms it into a dynamic web application with AJAX-powered content updates. + +Blapy2 speeds up page loading by updating only the requested content blocks instead of reloading entire pages, while maintaining full SEO compatibility through standard URLs and server-side rendering. -Blapy2 speeds up your page loads as it only updates the requested content blocks rather than reloading entire pages, while maintaining full SEO compliance through normal URLs and server-side rendering. # Have a look on the "Hello World" demo and other demos @@ -99,11 +100,11 @@ As an "Hello world" example: * [Problem resolutions](#problem-resolutions) * [Contact](#contact) - # Who may need it? +# Who may need it? - Everyone using a CMS that generates web pages from a server and would like to transform his website to a client application-like website, ie that does not reload each page during the user navigation but only the needed blocks within the page. +Anyone using a CMS that generates web pages from a server and who would like to transform their website into a client-application-like website, i.e. one that does not reload each page during navigation but only updates the necessary blocks within the page. -Everyone who... +Anyone who... - would like to keep the way he builds websites but would like to have it behaves like an ajax web application. - gave up with Angular and other javascript frameworks to build web app... like me ;-) @@ -114,22 +115,22 @@ Everyone who... # Why would I use that?! -The concept of a web application getting data through REST Api with a client application that is doing the job of connecting the whole to build an application is quite a difficult job with a steep learning curve... +The concept of a web application retrieving data through a REST API, with a client application assembling everything to build the final interface, is quite complex and usually comes with a steep learning curve. -Whereas PHP -or whatever web server languages- websites built on a standard CMS are easier to handle... Any standard CMS does the page rendering job quite naturally for years... Except that it reloads pages when clicking a link... or it needs to develop ajax calls to dynamically update parts of the page... +In contrast, PHP — or any other server-side language — used with a standard CMS makes website development much easier to handle. CMS platforms have been rendering pages naturally for years. The limitation is that pages are reloaded when a user clicks a link, unless additional AJAX calls are developed to update parts of the page dynamically. -So, the idea is to provide a simple environment that don't change your habits when creating your website without having the hassle of creating ajax calls. +The idea behind Blapy is to provide a simple environment that does not change your usual way of building a website, while avoiding the hassle of writing AJAX calls. -The benefits of using Blapy? +## The benefits of using Blapy -- no difficult framework to understand how to build a web application -- no REST or Ajax url end points to develop. Of course, you can do that if you like to have your application that way ;-) -- no change in your habit to develop website: building the pages with Blapy don't change from the "static" usual way of doing a website, meaning you can continue to use your standard LAMP and CMS environement -- configuration is simple and quite natural: it uses html5 "data" attributes to configure the Blapy configuration and there is quite nothing to do from an existing website :-) -- the ajax things are done behind the scene with no js lines of code to implement them -- the history of browsing is kept as any smart framework -- completly compliant with any existing html/js code -- SEO compliant as the server keeps the control on the application behaviour on the loaded pages and blocks, and so it is able to deliver correct contents to search engines as google. +- No complex framework to learn in order to build a web application +- No REST or AJAX endpoints to develop. Of course, you can still use them if you want your application to work that way +- No change in your usual development workflow: building pages with Blapy is the same as building a traditional “static” website. You can continue using your standard LAMP and CMS environment +- Simple and natural configuration: it relies on HTML5 `data-*` attributes to configure Blapy, and very little setup is required for an existing website +- AJAX operations are handled behind the scenes, without writing any JavaScript code +- Browsing history is preserved, as with modern frameworks +- Fully compatible with existing HTML and JavaScript code +- SEO-friendly: the server remains in control of the application behavior and page rendering, allowing search engines such as Google to receive the correct content for indexing # How does it work? @@ -577,7 +578,7 @@ Triggered after JSON data has been successfully appended to a block using `data- - **totalItems**: total number of items now present in the block - **data**: the complete merged JSON data array after append operation -## BlapySocket_Broadcast +## BlapySocket_Broadcast Triggered when a WebSocket broadcast message is received by Blapy. This event is sent to the Blapy Block (or globally, depending on configuration) targeted by the broadcast message. @@ -892,7 +893,7 @@ The prototype of an animation plugin function is : myAnimationFunction(oldContainer,newContainer) {} ``` -Have a look in the dist/Blapymotion.js and add your new functions in it inspired by the existing functions. +Have a look in the dist/Blapymotion.ts and add your new functions in it inspired by the existing functions. # BlapySocket Plugin @@ -1722,4 +1723,4 @@ npm run build # Contact If you have any ideas, feedback, requests or bug reports, you can reach me at github@intersel.org, -or via my website: http://www.intersel.fr +or via my website: http://www.intersel.fr \ No newline at end of file diff --git a/src/blapymotion-entry.ts b/src/blapymotion-entry.ts new file mode 100644 index 0000000..b71a662 --- /dev/null +++ b/src/blapymotion-entry.ts @@ -0,0 +1,8 @@ +// Standalone browser build entry for the optional animation module. +// Loading `' - templateManager._injectFinalHtml(htmlWithScript, container, mockBlapy, template) + templateManager.injectFinalHtml(htmlWithScript, container, mockBlapy, template) const scripts = container.querySelectorAll('script') expect(scripts).toHaveLength(1) @@ -752,7 +696,7 @@ describe('TemplateManager', () => { it('should handle script tags with src attribute', () => { const htmlWithScript = '
          Content
          ' - templateManager._injectFinalHtml(htmlWithScript, container, mockBlapy, template) + templateManager.injectFinalHtml(htmlWithScript, container, mockBlapy, template) const scripts = container.querySelectorAll('script') expect(scripts).toHaveLength(1) @@ -773,7 +717,7 @@ describe('TemplateManager', () => { allTemplates: [template1, template2] } - templateManager._injectFinalHtml('
          Generated
          ', container, mockBlapy, templateWithAll) + templateManager.injectFinalHtml('
          Generated
          ', container, mockBlapy, templateWithAll) expect(container.innerHTML).toContain('Template 1') expect(container.innerHTML).toContain('Template 2') @@ -797,13 +741,10 @@ describe('TemplateManager', () => { const aBlapyContainer = document.createElement('div') aBlapyContainer.innerHTML = 'invalid json {' - global.$ = vi.fn(() => ({ - html: vi.fn(() => 'invalid json {') - })) JSON.parse = vi.fn(() => { throw new Error('Malformed JSON') }) - await templateManager.processJsonUpdate(null, container, aBlapyContainer, JSON, mockBlapy) + await templateManager.processJsonUpdate(null, container, aBlapyContainer, mockBlapy) expect(mockLogger.error).toHaveBeenCalledWith( 'Erreur dans processJsonUpdate: Parsing JSON impossible', @@ -844,13 +785,10 @@ describe('TemplateManager', () => { const aBlapyContainer = document.createElement('div') aBlapyContainer.innerHTML = JSON.stringify(testData) - global.$ = vi.fn(() => ({ - html: vi.fn(() => JSON.stringify(testData)) - })) document.body.appendChild(container) - await templateManager.processJsonUpdate(null, container, aBlapyContainer, JSON, mockBlapy) + await templateManager.processJsonUpdate(null, container, aBlapyContainer, mockBlapy) expect(container.innerHTML).toContain('xmp') }) @@ -891,11 +829,8 @@ describe('TemplateManager', () => { const aBlapyContainer = document.createElement('div') aBlapyContainer.innerHTML = '' - global.$ = vi.fn(() => ({ - html: vi.fn(() => '') - })) - await templateManager.processJsonUpdate(null, container, aBlapyContainer, JSON, mockBlapy) + await templateManager.processJsonUpdate(null, container, aBlapyContainer, mockBlapy) expect(mockLogger.error).toHaveBeenCalled() }) @@ -903,17 +838,17 @@ describe('TemplateManager', () => { it('should handle null/undefined values in data transformations', () => { const container = document.createElement('div') - const result1 = templateManager._applyInitFromProperty(null, container) + const result1 = templateManager.applyInitFromProperty(null, container) expect(result1).toBeNull() - const result2 = templateManager._applyInitSearch(undefined, container) + const result2 = templateManager.applyInitSearch(undefined, container) expect(result2).toBeUndefined() }) it('should handle containers without required attributes', () => { const container = document.createElement('div') - templateManager._initializeJsonBlock(container, false, mockBlapy) + templateManager.initializeJsonBlock(container, mockBlapy, false) expect(mockBlapy.trigger).not.toHaveBeenCalledWith('Blapy_templateReady', { detail: container }) }) @@ -925,7 +860,7 @@ describe('TemplateManager', () => { email: `user${i}@example.com` })) - const result = templateManager._addBlapyIndices([...largeDataset]) + const result = templateManager.addBlapyIndices([...largeDataset]) expect(result).toHaveLength(1000) expect(result[0].blapyFirst).toBe(true) @@ -936,7 +871,7 @@ describe('TemplateManager', () => { it('should handle special characters in template content', () => { const content = '
          Special chars: àéîôù & < > " \'
          ' - const result = templateManager._prepareTemplateContent(content) + const result = templateManager.prepareTemplateContent(content) expect(result).toContain('Special chars: àéîôù & < > " \'') }) @@ -946,7 +881,7 @@ describe('TemplateManager', () => { circularData.self = circularData expect(() => { - templateManager._extractBlapyData(circularData) + templateManager.extractBlapyData(circularData) }).not.toThrow() }) }) From 67280675435a2951f755aca86db09b13ed5b555a Mon Sep 17 00:00:00 2001 From: d3ller Date: Wed, 1 Jul 2026 15:17:40 +0200 Subject: [PATCH 08/10] test: exclude the nested Blapy2/ reference clone from vitest so its stale tests don't double/pollute the unit run --- vite.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vite.config.ts b/vite.config.ts index 09be8bf..3f275e0 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -38,6 +38,6 @@ export default defineConfig({ plugins: [banner(copyright)], test: { environment: 'jsdom', - exclude: ['tests/e2e/**', 'node_modules/**'], + exclude: ['tests/e2e/**', 'node_modules/**', 'Blapy2/**', '**/Blapy2/**'], }, }); \ No newline at end of file From 7aac902c08f9aeb6b37107584a39a5588c873fa8 Mon Sep 17 00:00:00 2001 From: d3ller Date: Wed, 1 Jul 2026 15:17:40 +0200 Subject: [PATCH 09/10] docs: update README for the modern bundle (single dist/blapy.umd.js, no jQuery, optional BlapyMotion/BlapySocket, bundled deps) --- readme.md | 137 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 71 insertions(+), 66 deletions(-) diff --git a/readme.md b/readme.md index 5fc53a8..f259b3f 100644 --- a/readme.md +++ b/readme.md @@ -25,7 +25,16 @@ We invite you to have a deep look in the code source of the demos as they use qu # How to install -As it is a modern ES6 framework... download the pre-built Blapy V2 files, include the required dependencies, then import the Blapy class and initialize your application... and you're done... +The modern build is a single self-contained bundle: **`dist/blapy.umd.js`** ships +its own dependencies (Mustache, Navigo, JSON5, json2html) and needs **no jQuery**. +Include it, then initialize your application with `.Blapy()` — and you're done. + +Two optional modules are shipped as separate standalone scripts and are +**auto-detected** by the core when loaded (see [Blapy animation plugin functions](#blapy-animation-plugin-functions) +and [BlapySocket Plugin](#blapysocket-plugin)): + +- `dist/BlapyMotion.js` — content-transition animations (`fadeInOut`, `rightOutIn`) +- `dist/BlapySocket.js` — real-time updates over WebSocket As an "Hello world" example: @@ -33,16 +42,10 @@ As an "Hello world" example: - - - - - - - - - - + + + +
          - - - - - - - - - + + + + +``` + +Each animation is then usable as a `data-blapy-update` value on a Blapy block +(the module provides `fadeInOut` and `rightOutIn`). If `BlapyMotion.js` is not +loaded, blocks using those values simply update without animation. + +You can also inject a provider explicitly (useful for the ESM build) via the +`animation` option: `element.Blapy({ animation: new Blapymotion() })`. It is also a way to hook features on the content that will be placed in a Blapy block... -The prototype of an animation plugin function is : +The prototype of an animation plugin function is: ```javascript -myAnimationFunction(oldContainer,newContainer) {} +myAnimationFunction(oldContainer, newContainer) {} ``` -Have a look in the dist/Blapymotion.ts and add your new functions in it inspired by the existing functions. +Have a look at `src/modules/BlapyMotion.ts` and add your new functions inspired by +the existing ones. # BlapySocket Plugin @@ -909,11 +919,13 @@ The BlapySocket plugin enables real-time communication between your Blapy applic ## Installation -Include the BlapySocket module after Blapy: +BlapySocket is **optional** and **not bundled** into the core. Include the +standalone `dist/BlapySocket.js` alongside the core — the core auto-detects the +global and instantiates it as soon as you pass a non-empty `websocketOptions`: ```html - - + + ``` ## Basic Usage @@ -1056,35 +1068,20 @@ BlapySocket requires WebSocket API support: # LIBRARY DEPENDENCIES -To work properly, you need to include the following javascript libraries: - -- jQuery (>= 3.x) - - `` -- [iFSM by intersel](https://github.com/intersel/iFSM/) - - this library manages finite state machines and needs these libraries: - - **doTimeout** by ["Cowboy" Ben Alman](http://benalman.com/projects/jquery-dotimeout-plugin/) - - this library brings some very usefull feature on the usual javascript setTimeout function like Debouncing, Delays & Polling Loops, Hover Intent... - - `` - - **attrchange** by [Selvakumar Arumugam](http://meetselva.github.io/attrchange/) - - a simple jQuery function to bind a listener function to any HTML element on attribute change - - `` -- [json2html](http://json2html.com/) (optional if blapy block does not use json feature or use "Mustache" template engine) - - json2html is a javascript HTML templating library used to transform JSON objects into HTML using a template. - - used for json parsing and templating - - `` -- [Mustache](http://mustache.github.io/) (optional if blapy block does not use json feature or use "json2html" template engine) - - Mustache is a javascript HTML templating library used to transform JSON objects into HTML using a template. - - used for json parsing and templating - - `` -- [Navigo](https://github.com/krasimir/navigo) (optional if you don't need routing management) - - Navigo is a small framework to make web application providing simple but efficient 'route' services - - `` -- [json5](https://json5.org/) (optional if your json are "straight" json) - - expands the syntax of JSON in order to be able to process less strict json input (made by humans for example) - - `` -- [jquery.appear](http://morr.github.io/appear.html) (optional if you don't need to init blocks when they become visible after a scroll) - - - `` +**The modern build has no external runtime dependencies.** `dist/blapy.umd.js` +bundles everything it needs, so you only include that one file (no jQuery): + +- [Mustache](http://mustache.github.io/) — bundled — HTML templating for json blocks (`{{ }}` syntax) +- [json2html](http://json2html.com/) — bundled — HTML templating for json blocks (`${ }` syntax) +- [Navigo](https://github.com/krasimir/navigo) — bundled — routing management +- [json5](https://json5.org/) — bundled — lenient JSON parsing +- Finite state machine — bundled — `kFSM` replaces the old jQuery-based iFSM +- Visibility detection — native `IntersectionObserver` replaces the old jQuery.appear + +Optional modules, shipped as separate standalone scripts (auto-detected when loaded): + +- `dist/BlapyMotion.js` — content-transition animations (`fadeInOut`, `rightOutIn`) +- `dist/BlapySocket.js` — real-time updates over WebSocket # FAQ @@ -1687,14 +1684,16 @@ As the file is parsed as HTML, img tag will try to load the image that does not To fix this, simply wrap your html template with the tag "xmp" which will neutralize html analysis. -## My Blapy block does not appear when I change its style from "display:off" to "display:block" when "data-blapy-updateblock-ondisplay" is set +## My Blapy block does not appear when I change its style from "display:none" to "display:block" when "data-blapy-updateblock-ondisplay" is set -The jquery.appear object is not aware of a change in the display... +The modern build detects visibility with the native +[`IntersectionObserver`](https://developer.mozilla.org/docs/Web/API/IntersectionObserver), +which reacts to elements entering the viewport. If a block was hidden and you +reveal it while it is already within the viewport, force a re-check by scrolling +the window slightly: -In order to alert it, you can simulate a scroll on the window just after changing the display status of your block with : - -```Javascript -$(window).scroll(); +```javascript +window.dispatchEvent(new Event('scroll')); ``` # How to locally compile blapy 'dist' @@ -1720,6 +1719,12 @@ npm install npm run build ``` +This produces, in `dist/`: + +- `blapy.umd.js` / `blapy.mjs` — the core bundle (UMD for `