{
"version": 3,
"sources": ["../build/lib/lw-expr-parser.js", "../build/lib/lw-event-bus.js", "../build/lib/lw-element.js", "../build/components/root/ast.js", "../build/components/root/root.js", "../build/components/block/ast.js", "../build/components/block/block.js", "../build/components/header/ast.js", "../build/components/header/header.js", "../build/components/footer/ast.js", "../build/components/footer/footer.js"],
"sourcesContent": ["const binaryOperations = {\n '==': (a, b) => a == b,\n '!=': (a, b) => a != b,\n '===': (a, b) => a === b,\n '!==': (a, b) => a !== b,\n '<': (a, b) => a < b,\n '<=': (a, b) => a <= b,\n '>': (a, b) => a > b,\n '>=': (a, b) => a >= b,\n '<<': (a, b) => a << b,\n '>>': (a, b) => a >> b,\n '>>>': (a, b) => a >>> b,\n '+': (a, b) => a + b,\n '-': (a, b) => a - b,\n '*': (a, b) => a * b,\n '/': (a, b) => a / b,\n '%': (a, b) => a % b,\n '**': (a, b) => a ** b,\n '|': (a, b) => a | b,\n '^': (a, b) => a ^ b,\n '&': (a, b) => a & b,\n 'in': (a, b) => a in b,\n 'instanceof': (a, b) => a instanceof b,\n // '|>': (a, b) => a |> b,\n};\n\nconst assignmentOperations = {\n '=': (c, a, b) => { c[a] = b; },\n '+=': (c, a, b) => { c[a] += b; },\n '-=': (c, a, b) => { c[a] -= b; },\n '*=': (c, a, b) => { c[a] *= b; },\n '/=': (c, a, b) => { c[a] /= b; },\n '%=': (c, a, b) => { c[a] %= b; },\n '**=': (c, a, b) => { c[a] **= b; },\n '&&=': (c, a, b) => { c[a] &&= b; },\n '??=': (c, a, b) => { c[a] ??= b; },\n '||=': (c, a, b) => { c[a] ||= b; },\n '>>=': (c, a, b) => { c[a] >>= b; },\n '>>>=': (c, a, b) => { c[a] >>>= b; },\n '<<=': (c, a, b) => { c[a] <<= b; },\n '&=': (c, a, b) => { c[a] &= b; },\n '|=': (c, a, b) => { c[a] |= b; },\n '^=': (c, a, b) => { c[a] ^= b; },\n};\n\nconst logicalOperators = {\n '||': (a, b) => a || b,\n '&&': (a, b) => a && b,\n '??': (a, b) => a ?? b,\n};\n\nconst unaryOperators = {\n '-': a => -a,\n '+': a => +a,\n '!': a => !a,\n '~': a => ~a,\n 'typeof': a => typeof a,\n 'void': a => void a,\n // 'delete': a => delete a,\n 'throw': a => { throw a; },\n};\n\nconst updateOperators = (operator, prefix) => {\n if (operator === '++') {\n return (c, a) => prefix ? ++c[a] : c[a]++;\n } else if (operator === '--') {\n return (c, a) => prefix ? --c[a] : c[a]--;\n }\n};\n\nconst callFunction = (node, context) => {\n const callee = evalNode(node.callee, context);\n if (node.callee.type === 'OptionalMemberExpression' && (callee === void 0 || callee === null)) {\n return void 0;\n }\n const args = [];\n node.arguments.map(argument => {\n if (argument.type === 'SpreadElement') {\n args.push(...evalNode(argument, context));\n } else {\n args.push(evalNode(argument, context));\n }\n });\n return callee(...args);\n};\n\nconst nodeHandlers = {\n 'NumericLiteral': (node, context) => node.value,\n 'StringLiteral': (node, context) => node.value,\n 'BooleanLiteral': (node, context) => node.value,\n 'NullLiteral': (node, context) => null,\n\n 'RegExpLiteral': (node, context) => new RegExp(node.pattern, node.flags),\n\n 'ExpressionStatement': (node, context) => evalNode(node.expression, context),\n 'BinaryExpression': (node, context) => binaryOperations[node.operator](evalNode(node.left, context), evalNode(node.right, context)),\n 'AssignmentExpression': (node, context) => {\n const immediateCtx = immediateContext(node.left, context);\n assignmentOperations[node.operator](immediateCtx, node.left.name, evalNode(node.right, context));\n },\n 'LogicalExpression': (node, context) => logicalOperators[node.operator](evalNode(node.left, context), evalNode(node.right, context)),\n 'UnaryExpression': (node, context) => unaryOperators[node.operator](evalNode(node.argument, context)),\n 'UpdateExpression': (node, context) => {\n const immediateCtx = immediateContext(node.argument, context);\n updateOperators(node.operator, node.prefix)(immediateCtx, node.argument.name, evalNode(node.argument, context));\n },\n 'ConditionalExpression': (node, context) => {\n const test = evalNode(node.test, context);\n const consequent = evalNode(node.consequent, context);\n const alternate = evalNode(node.alternate, context);\n return test ? consequent : alternate;\n },\n 'MemberExpression': (node, context) => {\n const object = evalNode(node.object, context);\n const member = node.computed ? object[evalNode(node.property, context)] : object[node.property.name];\n if (typeof member === 'function') {\n return member.bind(object);\n }\n return member;\n },\n 'OptionalMemberExpression': (node, context) => {\n const object = evalNode(node.object, context);\n if (object === void 0 || object === null) {\n return void 0;\n }\n const member = node.computed ? (object[evalNode(node.property, context)]) : (object[node.property.name]);\n if (typeof member === 'function') {\n return member.bind(object);\n }\n return member;\n },\n\n 'ArrayExpression': (node, context) => {\n const arr = [];\n node.elements.map(elem => {\n if (elem.type === 'SpreadElement') {\n arr.push(...evalNode(elem, context));\n } else {\n arr.push(evalNode(elem, context));\n }\n });\n return arr;\n },\n 'ObjectExpression': (node, context) => node.properties.reduce((acc, prop) => ({ ...acc, ...evalNode(prop, context) }), {}),\n 'ObjectProperty': (node, context) => ({ [evalNode(node.key, context)]: evalNode(node.value, context) }),\n 'SpreadElement': (node, context) => evalNode(node.argument, context),\n\n 'Identifier': (node, context) => {\n if (Array.isArray(context)) {\n const hitContext = context.find(contextObj => node.name in contextObj);\n return hitContext ? hitContext[node.name] : undefined;\n } else if (typeof context === 'object') {\n return context[node.name];\n }\n },\n 'ThisExpression': (node, context) => {\n if (Array.isArray(context)) {\n const hitContext = context.find(contextObj => 'this' in contextObj);\n return hitContext ? hitContext['this'] : undefined;\n } else if (typeof context === 'object') {\n return context['this'];\n }\n },\n\n 'CallExpression': (node, context) => callFunction(node, context),\n 'OptionalCallExpression': (node, context) => callFunction(node, context),\n 'NewExpression': (node, context) => callFunction(node, context),\n\n 'Directive': (node, context) => evalNode(node.value, context),\n 'DirectiveLiteral': (node, context) => node.value,\n};\n\nconst immediateContext = (node, context) => {\n if (Array.isArray(context)) {\n if (context.length === 0) {\n return null;\n }\n const qualifiedContext = context.filter(contextObj => !(('$event' in contextObj && '$node' in contextObj) || 'this' in contextObj));\n return context.find(contextObj => node.name in contextObj) ?? qualifiedContext[0];\n } else if (typeof context === 'object') {\n return context;\n }\n}\n\nconst evalNode = (node, context) => nodeHandlers[node.type](node, context);\n\nconst evaluate = (ast, context = {}, loc = {}) => {\n try {\n return ast.map(astNode => evalNode(astNode, context));\n } catch (e) {\n throw { error: e.message, location: loc, ast, context };\n }\n};\n\nexport { evaluate };\n\n// module.exports = { evaluate };\n// const parser = require('@babel/parser');\n// const ast = parser.parse(\"name?.toUpperCase()\").program.body;\n// console.log(ast);\n// const result = evaluate(JSON.parse(JSON.stringify(ast)), { name: 'hello' });\n// console.log(result);", "class LWEvent {\n constructor(eventName, data) {\n this.eventName = eventName;\n this.data = data;\n }\n}\n\nclass LWEventListener {\n static key = 0;\n constructor(eventName, callback) {\n this.eventName = eventName;\n this.callback = callback;\n this.key = ++LWEventListener.key;\n }\n}\n\n// const listeners = {\n// event0: {\n// key0: listener0,\n// key1: listener1,\n// },\n// event0: {},\n// event0: {},\n// };\n\nexport default class LWEventBus {\n constructor() {\n this.listeners = {};\n }\n\n addEventListener(eventName, callback) {\n const listener = new LWEventListener(eventName, callback);\n this.listeners[listener.eventName] = this.listeners[listener.eventName] || {};\n const events = this.listeners[listener.eventName];\n events[listener.key] = listener;\n return listener;\n }\n\n removeEventListener(listener) {\n if (this.listeners[listener.eventName]) {\n delete this.listeners[listener.eventName][listener.key];\n }\n }\n\n dispatchEvent(eventName, data = null) {\n if (this.listeners[eventName]) {\n Object.values(this.listeners[eventName]).forEach(listener => {\n setTimeout(() => {\n listener.callback.call(void 0, new LWEvent(eventName, data));\n });\n });\n }\n }\n}", "import * as parser from './lw-expr-parser.js';\nimport LWEventBus from './lw-event-bus.js';\n\nglobalThis.leanweb = globalThis.leanweb ?? {\n componentsListeningOnUrlChanges: [],\n eventBus: new LWEventBus(),\n updateComponents(...tagNames) {\n if (tagNames?.length) {\n tagNames.forEach(tagName => {\n leanweb.eventBus.dispatchEvent(tagName);\n });\n } else {\n leanweb.eventBus.dispatchEvent('update');\n }\n },\n\n set urlHash(hash) {\n location.hash = hash;\n },\n\n get urlHash() {\n return location.hash;\n },\n\n set urlHashPath(hashPath) {\n const s = this.urlHash.split('?');\n if (s.length === 1) {\n this.urlHash = hashPath;\n } else if (s.length > 1) {\n this.urlHash = hashPath + '?' + s[1];\n }\n },\n\n get urlHashPath() {\n return this.urlHash.split('?')[0];\n },\n\n set urlHashParams(hashParams) {\n if (!hashParams) {\n return;\n }\n\n const paramArray = [];\n Object.keys(hashParams).forEach(key => {\n const value = hashParams[key];\n if (Array.isArray(value)) {\n value.forEach(v => {\n paramArray.push(key + '=' + encodeURIComponent(v));\n });\n } else {\n paramArray.push(key + '=' + encodeURIComponent(value));\n }\n });\n this.urlHash = this.urlHashPath + '?' + paramArray.join('&');\n },\n\n get urlHashParams() {\n const ret = {};\n const s = this.urlHash.split('?');\n if (s.length > 1) {\n const p = new URLSearchParams(s[1]);\n p.forEach((v, k) => {\n if (ret[k] === undefined) {\n ret[k] = v;\n } else if (Array.isArray(ret[k])) {\n ret[k].push(v);\n } else {\n ret[k] = [ret[k], v];\n }\n });\n }\n return ret;\n }\n};\n\nglobalThis.addEventListener('hashchange', () => {\n leanweb.componentsListeningOnUrlChanges.forEach(component => {\n setTimeout(() => {\n component?.urlHashChanged?.call(component);\n component?.update?.call(component);\n });\n });\n}, false);\n\nconst hasMethod = (obj, name) => {\n const desc = Object.getOwnPropertyDescriptor(obj, name);\n return !!desc && typeof desc.value === 'function';\n}\n\nconst nextAllSiblings = (el, selector) => {\n const siblings = [];\n while (el = el.nextSibling) {\n if (el.nodeType === Node.ELEMENT_NODE && (!selector || el.matches(selector))) {\n siblings.push(el);\n }\n }\n return siblings;\n};\n\nexport default class LWElement extends HTMLElement {\n constructor(ast) {\n super();\n this.ast = ast;\n\n leanweb.runtimeVersion = ast.runtimeVersion;\n leanweb.builderVersion = ast.builderVersion;\n\n const node = document.createElement('template');\n node.innerHTML = `${ast.html}`;\n this.attachShadow({ mode: 'open' }).appendChild(node.content);\n\n this._bindMethods();\n setTimeout(() => {\n this.update(this.shadowRoot);\n setTimeout(() => {\n this.domReady?.call(this);\n });\n });\n\n if (this.urlHashChanged && typeof this.urlHashChanged === 'function') {\n leanweb.componentsListeningOnUrlChanges.push(this);\n }\n\n leanweb.eventBus.addEventListener('update', _ => {\n this.update();\n });\n\n leanweb.eventBus.addEventListener(ast.componentFullName, _ => {\n this.update();\n });\n }\n\n _getNodeContext(node) {\n const contextNode = node.closest('[lw-context]');\n return contextNode?.['lw-context'] ?? [{ 'this': this }, this, globalThis];\n }\n\n update(rootNode = this.shadowRoot) {\n if (rootNode !== this.shadowRoot) {\n if (rootNode.hasAttribute('lw-elem')) {\n if (rootNode.hasAttribute('lw-elem-bind')) {\n this._bindModels(rootNode);\n this._bindEvents(rootNode);\n this._bindInputs(rootNode);\n }\n if (rootNode.hasAttribute('lw-if')) {\n this.updateIf(rootNode);\n }\n if (!rootNode.hasAttribute('lw-false')) {\n this.updateEval(rootNode);\n this.updateClass(rootNode);\n this.updateBind(rootNode);\n this.updateModel(rootNode);\n if (rootNode.hasAttribute('lw-for')) {\n this.updateFor(rootNode);\n }\n }\n }\n }\n const treeWalker = document.createTreeWalker(rootNode, NodeFilter.SHOW_ELEMENT, {\n acceptNode: node => {\n if (node.hasAttribute('lw-elem')) {\n if (node.hasAttribute('lw-for')) {\n this.updateFor(node);\n return NodeFilter.FILTER_REJECT;\n }\n if (node.hasAttribute('lw-for-parent')) {\n return NodeFilter.FILTER_REJECT;\n }\n if (node.hasAttribute('lw-elem-bind')) {\n this._bindModels(node);\n this._bindEvents(node);\n this._bindInputs(node);\n }\n if (node.hasAttribute('lw-if')) {\n this.updateIf(node);\n }\n if (node.hasAttribute('lw-false')) {\n return NodeFilter.FILTER_REJECT;\n }\n this.updateEval(node);\n this.updateClass(node);\n this.updateBind(node);\n this.updateModel(node);\n }\n return NodeFilter.FILTER_ACCEPT;\n }\n });\n while (treeWalker.nextNode()) { }\n }\n\n _bindMethods() {\n const methodNames = ['update'];\n const proto = Object.getPrototypeOf(this);\n methodNames.push(...Object.getOwnPropertyNames(proto).filter(name => hasMethod(proto, name)));\n methodNames.push(...Object.getOwnPropertyNames(this).filter(name => hasMethod(this, name)));\n methodNames.filter(name => name !== 'constructor').forEach(name => {\n this[name] = this[name].bind(this);\n });\n }\n\n // properties:\n // lw_input_bound: boolean\n _bindInputs(inputNode) {\n if (inputNode['lw_input_bound']) {\n return;\n }\n inputNode['lw_input_bound'] = true;\n for (const attr of inputNode.attributes) {\n const attrName = attr.name;\n const attrValue = attr.value;\n if (attrName.startsWith('lw-input:')) {\n const interpolation = this.ast[attrValue];\n const context = this._getNodeContext(inputNode);\n const parsed = parser.evaluate(interpolation.ast, context, interpolation.loc);\n inputNode[interpolation.lwValue] = parsed[0];\n }\n }\n inputNode?.inputReady?.call(this);\n inputNode?.update?.call(this);\n }\n\n // properties:\n // lw_event_bound: boolean\n _bindEvents(eventNode) {\n if (eventNode['lw_event_bound']) {\n return;\n }\n eventNode['lw_event_bound'] = true;\n const me = this;\n for (const attr of eventNode.attributes) {\n const attrName = attr.name;\n const attrValue = attr.value;\n if (attrName.startsWith('lw-on:')) {\n const interpolation = this.ast[attrValue];\n interpolation.lwValue.split(',').forEach(eventType => {\n eventNode.addEventListener(eventType.trim(), (event => {\n const context = this._getNodeContext(eventNode);\n const eventContext = { '$event': event, '$node': eventNode };\n const parsed = parser.evaluate(interpolation.ast, [eventContext, ...context], interpolation.loc);\n const promises = parsed.filter(p => typeof p?.then === 'function' && typeof p?.finally === 'function');\n if (parsed.length > promises.length) {\n me.update();\n }\n promises.forEach(p => {\n p?.finally(() => {\n me.update();\n });\n });\n }).bind(me));\n });\n }\n }\n }\n\n // properties:\n // lw_model_bound: boolean\n _bindModels(modelNode) {\n const key = modelNode.getAttribute('lw-model');\n if (!key) {\n return;\n }\n if (modelNode['lw_model_bound']) {\n return;\n }\n modelNode['lw_model_bound'] = true;\n const interpolation = this.ast[key];\n modelNode.addEventListener('input', (event => {\n const context = this._getNodeContext(modelNode);\n const astModel = interpolation.ast[0].expression;\n let object;\n let propertyExpr;\n if (astModel.type === 'MemberExpression') {\n // . false and [] true\n propertyExpr = astModel.computed ? parser.evaluate([astModel.property], context, interpolation.loc)[0] : astModel.property.name;\n object = parser.evaluate([astModel.object], context, interpolation.loc)[0];\n } else if (astModel.type === 'Identifier') {\n object = this;\n propertyExpr = astModel.name;\n }\n\n if (modelNode.type === 'number' || modelNode.type === 'range') {\n // set do_not_update mark for cases when user inputs 0.01, 0.0 will not be evaluated prematurely\n modelNode.do_not_update = true;\n object[propertyExpr] = modelNode.value * 1;\n } else if (modelNode.type === 'checkbox') {\n if (Array.isArray(object[propertyExpr])) {\n if (modelNode.checked) {\n object[propertyExpr].push(modelNode.value);\n } else {\n const index = object[propertyExpr].indexOf(modelNode.value);\n if (index > -1) {\n object[propertyExpr].splice(index, 1);\n }\n }\n } else {\n object[propertyExpr] = modelNode.checked;\n }\n } else if (modelNode.type === 'select-multiple') {\n if (!Array.isArray(object[propertyExpr])) {\n object[propertyExpr] = [];\n }\n object[propertyExpr].length = 0;\n for (let i = 0; i < modelNode.options.length; ++i) {\n const option = modelNode.options[i];\n if (option.selected) {\n object[propertyExpr].push(option.value);\n }\n }\n } else {\n object[propertyExpr] = modelNode.value;\n }\n this.update();\n delete modelNode.do_not_update;\n }).bind(this));\n }\n\n updateModel(modelNode) {\n if (modelNode.do_not_update && modelNode.type === 'number') {\n return;\n }\n const key = modelNode.getAttribute('lw-model');\n if (!key) {\n return;\n }\n const context = this._getNodeContext(modelNode);\n const interpolation = this.ast[key];\n const parsed = parser.evaluate(interpolation.ast, context, interpolation.loc);\n if (modelNode.type === 'checkbox') {\n if (Array.isArray(parsed[0])) {\n modelNode.checked = parsed[0].includes?.(modelNode.value);\n } else {\n modelNode.checked = !!parsed[0];\n }\n } else if (modelNode.type === 'radio') {\n modelNode.checked = parsed[0] === modelNode.value;\n } else if (modelNode.type === 'select-multiple') {\n for (let i = 0; i < modelNode.options.length; ++i) {\n const option = modelNode.options[i];\n if (parsed[0]) {\n option.selected = parsed[0].includes(option.value);\n }\n }\n } else {\n const newValue = parsed[0] ?? '';\n if (modelNode.value !== newValue) {\n modelNode.value = newValue;\n }\n }\n }\n\n // attribute: lw: astKey\n // property: lw-eval-value-$key\n updateEval(evalNode) {\n const key = evalNode.getAttribute('lw');\n if (!key) {\n return;\n }\n const context = this._getNodeContext(evalNode);\n const interpolation = this.ast[key];\n const parsed = parser.evaluate(interpolation.ast, context, interpolation.loc);\n if (evalNode['lw-eval-value-' + key] !== parsed[0] || typeof parsed[0] === 'object') {\n evalNode['lw-eval-value-' + key] = parsed[0];\n evalNode.innerText = parsed[0] ?? '';\n }\n }\n\n // attribute: lw-if: astKey\n // lw-false: '' (if false)\n updateIf(ifNode) {\n const key = ifNode.getAttribute('lw-if');\n if (!key) {\n return;\n }\n const context = this._getNodeContext(ifNode);\n const interpolation = this.ast[key];\n const parsed = parser.evaluate(interpolation.ast, context, interpolation.loc);\n\n const hasLwFalse = ifNode.hasAttribute('lw-false');\n if (parsed[0] !== false && parsed[0] !== undefined && parsed[0] !== null) {\n hasLwFalse && ifNode.removeAttribute('lw-false');\n setTimeout(() => {\n ifNode.turnedOn?.call(ifNode);\n });\n } else {\n !hasLwFalse && ifNode.setAttribute('lw-false', '');\n setTimeout(() => {\n ifNode.turnedOff?.call(ifNode);\n });\n }\n }\n\n // attribute: lw-class: astKey\n updateClass(classNode) {\n const context = this._getNodeContext(classNode);\n for (const attr of classNode.attributes) {\n const attrName = attr.name;\n const attrValue = attr.value;\n if (attrName.startsWith('lw-class:')) {\n const interpolation = this.ast[attrValue];\n const parsed = parser.evaluate(interpolation.ast, context, interpolation.loc);\n\n if (!parsed[0]) {\n classNode.classList.remove(interpolation.lwValue);\n } else {\n classNode.classList.add(interpolation.lwValue);\n }\n }\n }\n }\n\n updateBind(bindNode) {\n const context = this._getNodeContext(bindNode);\n for (const attr of bindNode.attributes) {\n const attrName = attr.name;\n const attrValue = attr.value;\n if (attrName.startsWith('lw-bind:')) {\n const interpolation = this.ast[attrValue];\n const parsed = parser.evaluate(interpolation.ast, context, interpolation.loc);\n\n if (interpolation.lwValue === 'class') {\n const initClass = bindNode.getAttribute('lw-init-class');\n if (!parsed[0]) {\n bindNode.classList.remove(parsed[0]);\n } else {\n bindNode.classList = initClass + ' ' + parsed[0];\n }\n } else {\n if (parsed[0] !== false && parsed[0] !== undefined && parsed[0] !== null) {\n bindNode.setAttribute(interpolation.lwValue, parsed[0]);\n } else {\n bindNode.removeAttribute(interpolation.lwValue);\n }\n }\n }\n }\n }\n\n // parent attribytes:\n // lw-for: $astKey\n\n // child attributes:\n // lw-context: ''\n // lw-for-parent: $astKey\n\n // child propery:\n // lw-context: localContext\n updateFor(forNode) {\n const key = forNode.getAttribute('lw-for');\n if (!key) {\n return;\n }\n const context = this._getNodeContext(forNode);\n const interpolation = this.ast[key];\n const items = parser.evaluate(interpolation.astItems, context, interpolation.loc)[0] ?? [];\n const rendered = nextAllSiblings(forNode, `[lw-for-parent=\"${key}\"]`);\n for (let i = items.length; i < rendered.length; ++i) {\n rendered[i].remove();\n }\n\n let currentNode = forNode;\n items.forEach((item, index) => {\n let node;\n if (rendered.length > index) {\n node = rendered[index];\n } else {\n node = forNode.cloneNode(true);\n node.removeAttribute('lw-for');\n // node.removeAttribute('lw-elem');\n node.setAttribute('lw-for-parent', key);\n node.setAttribute('lw-context', '');\n currentNode.insertAdjacentElement('afterend', node);\n }\n if (item && typeof item === 'object') {\n item.getDom = () => node;\n }\n currentNode = node;\n const itemContext = { [interpolation.itemExpr]: item };\n if (interpolation.indexExpr) {\n itemContext[interpolation.indexExpr] = index;\n }\n\n node['lw-context'] = [itemContext, ...context];\n this.update(node);\n });\n }\n}", "export default {\"1\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"MemberExpression\",\"object\":{\"type\":\"Identifier\",\"name\":\"ip6\"},\"computed\":false,\"property\":{\"type\":\"Identifier\",\"name\":\"normalize\"}}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"fn\"},\"2\":{\"ast\":[{\"type\":\"Directive\",\"value\":{\"type\":\"DirectiveLiteral\",\"extra\":{\"rawValue\":\"Expand an Address\",\"raw\":\"'Expand an Address'\",\"expressionValue\":\"Expand an Address\"},\"value\":\"Expand an Address\"}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"name\"},\"3\":{\"ast\":[{\"type\":\"Directive\",\"value\":{\"type\":\"DirectiveLiteral\",\"extra\":{\"rawValue\":\"2001:db8::\",\"raw\":\"'2001:db8::'\",\"expressionValue\":\"2001:db8::\"},\"value\":\"2001:db8::\"}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"input\"},\"4\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"MemberExpression\",\"object\":{\"type\":\"Identifier\",\"name\":\"ip6\"},\"computed\":false,\"property\":{\"type\":\"Identifier\",\"name\":\"abbreviate\"}}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"fn\"},\"5\":{\"ast\":[{\"type\":\"Directive\",\"value\":{\"type\":\"DirectiveLiteral\",\"extra\":{\"rawValue\":\"Compress an Address\",\"raw\":\"'Compress an Address'\",\"expressionValue\":\"Compress an Address\"},\"value\":\"Compress an Address\"}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"name\"},\"6\":{\"ast\":[{\"type\":\"Directive\",\"value\":{\"type\":\"DirectiveLiteral\",\"extra\":{\"rawValue\":\"2001:0db8:0000:0000:0000:0000:0000:0000\",\"raw\":\"'2001:0db8:0000:0000:0000:0000:0000:0000'\",\"expressionValue\":\"2001:0db8:0000:0000:0000:0000:0000:0000\"},\"value\":\"2001:0db8:0000:0000:0000:0000:0000:0000\"}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"input\"},\"7\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"MemberExpression\",\"object\":{\"type\":\"Identifier\",\"name\":\"ip6\"},\"computed\":false,\"property\":{\"type\":\"Identifier\",\"name\":\"divideSubnet\"}}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"fn\"},\"8\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"Identifier\",\"name\":\"subnetRange\"}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"range\"},\"9\":{\"ast\":[{\"type\":\"Directive\",\"value\":{\"type\":\"DirectiveLiteral\",\"extra\":{\"rawValue\":\"Divide Subnet\",\"raw\":\"'Divide Subnet'\",\"expressionValue\":\"Divide Subnet\"},\"value\":\"Divide Subnet\"}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"name\"},\"10\":{\"ast\":[{\"type\":\"Directive\",\"value\":{\"type\":\"DirectiveLiteral\",\"extra\":{\"rawValue\":\"2001:db8::\",\"raw\":\"'2001:db8::'\",\"expressionValue\":\"2001:db8::\"},\"value\":\"2001:db8::\"}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"input\"},\"11\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"NumericLiteral\",\"extra\":{\"rawValue\":32,\"raw\":\"32\"},\"value\":32}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"from\"},\"12\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"NumericLiteral\",\"extra\":{\"rawValue\":64,\"raw\":\"64\"},\"value\":64}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"to\"},\"13\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"NumericLiteral\",\"extra\":{\"rawValue\":8,\"raw\":\"8\"},\"value\":8}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"limit\"},\"14\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"NumericLiteral\",\"extra\":{\"rawValue\":0,\"raw\":\"0\"},\"value\":0}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"form\"},\"15\":{\"ast\":[{\"type\":\"Directive\",\"value\":{\"type\":\"DirectiveLiteral\",\"extra\":{\"rawValue\":\"Text\",\"raw\":\"'Text'\",\"expressionValue\":\"Text\"},\"value\":\"Text\"}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"format\"},\"16\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"BooleanLiteral\",\"value\":true}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"showformat\"},\"17\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"MemberExpression\",\"object\":{\"type\":\"Identifier\",\"name\":\"ip6\"},\"computed\":false,\"property\":{\"type\":\"Identifier\",\"name\":\"randomSubnet\"}}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"fn\"},\"18\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"Identifier\",\"name\":\"subnetRange\"}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"range\"},\"19\":{\"ast\":[{\"type\":\"Directive\",\"value\":{\"type\":\"DirectiveLiteral\",\"extra\":{\"rawValue\":\"Random Subnet\",\"raw\":\"'Random Subnet'\",\"expressionValue\":\"Random Subnet\"},\"value\":\"Random Subnet\"}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"name\"},\"20\":{\"ast\":[{\"type\":\"Directive\",\"value\":{\"type\":\"DirectiveLiteral\",\"extra\":{\"rawValue\":\"2001:db8::\",\"raw\":\"'2001:db8::'\",\"expressionValue\":\"2001:db8::\"},\"value\":\"2001:db8::\"}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"input\"},\"21\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"NumericLiteral\",\"extra\":{\"rawValue\":32,\"raw\":\"32\"},\"value\":32}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"from\"},\"22\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"NumericLiteral\",\"extra\":{\"rawValue\":64,\"raw\":\"64\"},\"value\":64}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"to\"},\"23\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"NumericLiteral\",\"extra\":{\"rawValue\":8,\"raw\":\"8\"},\"value\":8}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"limit\"},\"24\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"NumericLiteral\",\"extra\":{\"rawValue\":0,\"raw\":\"0\"},\"value\":0}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"form\"},\"25\":{\"ast\":[{\"type\":\"Directive\",\"value\":{\"type\":\"DirectiveLiteral\",\"extra\":{\"rawValue\":\"Text\",\"raw\":\"'Text'\",\"expressionValue\":\"Text\"},\"value\":\"Text\"}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"format\"},\"26\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"BooleanLiteral\",\"value\":true}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"showformat\"},\"27\":{\"ast\":[{\"type\":\"Directive\",\"value\":{\"type\":\"DirectiveLiteral\",\"extra\":{\"rawValue\":\"Roll\",\"raw\":\"'Roll'\",\"expressionValue\":\"Roll\"},\"value\":\"Roll\"}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"runbuttontext\"},\"28\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"MemberExpression\",\"object\":{\"type\":\"Identifier\",\"name\":\"ip6\"},\"computed\":false,\"property\":{\"type\":\"Identifier\",\"name\":\"rangeBigInt\"}}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"fn\"},\"29\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"Identifier\",\"name\":\"subnetRange\"}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"range\"},\"30\":{\"ast\":[{\"type\":\"Directive\",\"value\":{\"type\":\"DirectiveLiteral\",\"extra\":{\"rawValue\":\"Range\",\"raw\":\"'Range'\",\"expressionValue\":\"Range\"},\"value\":\"Range\"}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"name\"},\"31\":{\"ast\":[{\"type\":\"Directive\",\"value\":{\"type\":\"DirectiveLiteral\",\"extra\":{\"rawValue\":\"2001:db8::\",\"raw\":\"'2001:db8::'\",\"expressionValue\":\"2001:db8::\"},\"value\":\"2001:db8::\"}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"input\"},\"32\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"NumericLiteral\",\"extra\":{\"rawValue\":32,\"raw\":\"32\"},\"value\":32}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"from\"},\"33\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"NumericLiteral\",\"extra\":{\"rawValue\":64,\"raw\":\"64\"},\"value\":64}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"to\"},\"34\":{\"ast\":[{\"type\":\"Directive\",\"value\":{\"type\":\"DirectiveLiteral\",\"extra\":{\"rawValue\":\"JSON\",\"raw\":\"'JSON'\",\"expressionValue\":\"JSON\"},\"value\":\"JSON\"}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"format\"},\"35\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"MemberExpression\",\"object\":{\"type\":\"Identifier\",\"name\":\"ip6\"},\"computed\":false,\"property\":{\"type\":\"Identifier\",\"name\":\"ptr\"}}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"fn\"},\"36\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"Identifier\",\"name\":\"ptrRange\"}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"range\"},\"37\":{\"ast\":[{\"type\":\"Directive\",\"value\":{\"type\":\"DirectiveLiteral\",\"extra\":{\"rawValue\":\"PTR\",\"raw\":\"'PTR'\",\"expressionValue\":\"PTR\"},\"value\":\"PTR\"}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"name\"},\"38\":{\"ast\":[{\"type\":\"Directive\",\"value\":{\"type\":\"DirectiveLiteral\",\"extra\":{\"rawValue\":\"2001:db8::cafe:babe:dead:beef\",\"raw\":\"'2001:db8::cafe:babe:dead:beef'\",\"expressionValue\":\"2001:db8::cafe:babe:dead:beef\"},\"value\":\"2001:db8::cafe:babe:dead:beef\"}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"input\"},\"39\":{\"ast\":[{\"type\":\"ExpressionStatement\",\"expression\":{\"type\":\"NumericLiteral\",\"extra\":{\"rawValue\":64,\"raw\":\"64\"},\"value\":64}}],\"loc\":{\"startLine\":1,\"endLine\":1},\"lwType\":\"lw-input\",\"lwValue\":\"from\"},\"html\":\"