From c1445dcf62c945b1ec5d654dc6e0ea617b47898d Mon Sep 17 00:00:00 2001 From: Kristofer Baxter Date: Fri, 21 Sep 2018 09:57:05 -0700 Subject: [PATCH] Remove checked in distributables --- dist/index.js | 10 -------- dist/index.js.map | 1 - dist/index.mjs | 10 -------- dist/index.mjs.map | 1 - dist/index.safe.js | 31 ----------------------- dist/index.safe.js.map | 1 - dist/index.safe.mjs | 34 -------------------------- dist/index.safe.mjs.map | 1 - dist/worker.js | 51 -------------------------------------- dist/worker.js.map | 1 - dist/worker.mjs | 41 ------------------------------- dist/worker.mjs.map | 1 - dist/worker.safe.js | 53 ---------------------------------------- dist/worker.safe.js.map | 1 - dist/worker.safe.mjs | 42 ------------------------------- dist/worker.safe.mjs.map | 1 - 16 files changed, 280 deletions(-) delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 dist/index.mjs delete mode 100644 dist/index.mjs.map delete mode 100644 dist/index.safe.js delete mode 100644 dist/index.safe.js.map delete mode 100644 dist/index.safe.mjs delete mode 100644 dist/index.safe.mjs.map delete mode 100644 dist/worker.js delete mode 100644 dist/worker.js.map delete mode 100644 dist/worker.mjs delete mode 100644 dist/worker.mjs.map delete mode 100644 dist/worker.safe.js delete mode 100644 dist/worker.safe.js.map delete mode 100644 dist/worker.safe.mjs delete mode 100644 dist/worker.safe.mjs.map diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index 291f8428e..000000000 --- a/dist/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict';var MainThread=function(z){function f(a){return r.get(a)||""}function H(a){t=new Map([[1,a],[2,a]]);A=a}function k(a){return 3===("nodeType"in a?a.nodeType:a[0])}function u(a){if(k(a)){var b=document.createTextNode(f(a[5]));n(b,a[7]);return b}b=(b=void 0!==a[6]?f(a[6]):void 0)?document.createElementNS(b,f(a[1])):document.createElement(f(a[1]));n(b,a[7]);return b}function l(a){return(a=t.get(a))&&"BODY"===a.nodeName?A:a}function n(a,b){a._index_=b;t.set(b,a)}function I(a,b){return Promise.all([fetch(a).then(function(a){return a.text()}), -fetch(b).then(function(a){return a.text()})]).then(function(a){var d=a[0];a=a[1];var c=[],e;for(e in document.body.style)c.push("'"+e+"'");d="\n 'use strict';\n "+d+"\n (function() {\n var self = this;\n var window = this;\n var document = this.document;\n var localStorage = this.localStorage;\n var location = this.location;\n var defaultView = document.defaultView;\n var Node = defaultView.Node;\n var Text = defaultView.Text;\n var Element = defaultView.Element;\n var SVGElement = defaultView.SVGElement;\n var Document = defaultView.Document;\n var Event = defaultView.Event;\n var MutationObserver = defaultView.MutationObserver;\n\n function addEventListener(type, handler) {\n return document.addEventListener(type, handler);\n }\n function removeEventListener(type, handler) {\n return document.removeEventListener(type, handler);\n }\n this.appendKeys(["+ -c+"]);\n "+a+"\n }).call(WorkerThread.workerDOM);\n//# sourceURL="+encodeURI(b);return new Worker(URL.createObjectURL(new Blob([d])))}).catch(function(a){return null})}function J(a,b){var c=l(b[10]);(b[21]||[]).forEach(function(b){v(a,c,!1,f(b[9]),b[33])});(b[20]||[]).forEach(function(b){v(a,c,!0,f(b[9]),b[33])})}function v(a,b,c,d,g){var e=null!==b.onchange,m=w(b),f="change"===d;c?(f&&(e=!0,b.onchange=null),b.addEventListener(d,B[g]=K(a,b._index_))):(f&&(e=!1),b.removeEventListener(d, -B[g]));m&&!e&&p(a,b)}function C(a){return 0Text node\n * createNode({ nodeType:3, data:'foo' })\n * @example Element node\n * createNode({ nodeType:1, nodeName:'div', attributes:[{ name:'a', value:'b' }], childNodes:[ ... ] })\n */\nexport function createNode(skeleton) {\n if (isTextNode(skeleton)) {\n const node = document.createTextNode(getString(skeleton[5 /* textContent */]));\n storeNode(node, skeleton[7 /* _index_ */]);\n return node;\n }\n const namespace = skeleton[6 /* namespaceURI */] !== undefined ? getString(skeleton[6 /* namespaceURI */]) : undefined;\n const node = namespace\n ? document.createElementNS(namespace, getString(skeleton[1 /* nodeName */]))\n : document.createElement(getString(skeleton[1 /* nodeName */]));\n // TODO(KB): Restore Properties\n // skeleton.properties.forEach(property => {\n // node[`${property.name}`] = property.value;\n // });\n // ((skeleton as TransferrableElement)[TransferrableKeys.childNodes] || []).forEach(childNode => {\n // if (childNode[TransferrableKeys.transferred] === NumericBoolean.FALSE) {\n // node.appendChild(createNode(childNode as TransferrableNode));\n // }\n // });\n storeNode(node, skeleton[7 /* _index_ */]);\n return node;\n}\n/**\n * Returns the real DOM Element corresponding to a serialized Element object.\n * @param id\n * @return\n */\nexport function getNode(id) {\n const node = NODES.get(id);\n if (node && node.nodeName === 'BODY') {\n // If the node requested is the \"BODY\"\n // Then we return the base node this specific comes from.\n // This encapsulates each node.\n return BASE_ELEMENT;\n }\n return node;\n}\n/**\n * Establish link between DOM `node` and worker-generated identifier `id`.\n *\n * These _shouldn't_ collide between instances of since\n * each element creates it's own pool on both sides of the worker\n * communication bridge.\n * @param node\n * @param id\n */\nexport function storeNode(node, id) {\n node._index_ = id;\n NODES.set(id, node);\n}\n//# sourceMappingURL=nodes.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// TODO(KB): Fetch Polyfill for IE11.\nexport function createWorker(workerDomURL, authorScriptURL) {\n return Promise.all([fetch(workerDomURL).then(response => response.text()), fetch(authorScriptURL).then(response => response.text())])\n .then(([workerScript, authorScript]) => {\n // TODO(KB): Minify this output during build process.\n const keys = [];\n for (let key in document.body.style) {\n keys.push(`'${key}'`);\n }\n const code = `\n 'use strict';\n ${workerScript}\n (function() {\n var self = this;\n var window = this;\n var document = this.document;\n var localStorage = this.localStorage;\n var location = this.location;\n var defaultView = document.defaultView;\n var Node = defaultView.Node;\n var Text = defaultView.Text;\n var Element = defaultView.Element;\n var SVGElement = defaultView.SVGElement;\n var Document = defaultView.Document;\n var Event = defaultView.Event;\n var MutationObserver = defaultView.MutationObserver;\n\n function addEventListener(type, handler) {\n return document.addEventListener(type, handler);\n }\n function removeEventListener(type, handler) {\n return document.removeEventListener(type, handler);\n }\n this.appendKeys([${keys}]);\n ${authorScript}\n }).call(WorkerThread.workerDOM);\n//# sourceURL=${encodeURI(authorScriptURL)}`;\n return new Worker(URL.createObjectURL(new Blob([code])));\n })\n .catch(error => {\n return null;\n });\n}\nexport function messageToWorker(worker, message) {\n worker.postMessage(message);\n}\n//# sourceMappingURL=worker.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { messageToWorker } from './worker';\nimport { getNode } from './nodes';\nimport { getString } from './strings';\nconst KNOWN_LISTENERS = [];\n/**\n * Instead of a whitelist of elements that need their value tracked, use the existence\n * of a property called value to drive the decision.\n * @param node node to check if values should be tracked.\n * @return boolean if the node should have its value property tracked.\n */\nconst shouldTrackChanges = (node) => node && 'value' in node;\n/**\n * When a node that has a value needing synced doesn't already have an event listener\n * listening for changed values, ensure the value is synced with a default listener.\n * @param worker whom to dispatch value toward.\n * @param node node to listen to value changes on.\n */\nexport const applyDefaultChangeListener = (worker, node) => {\n shouldTrackChanges(node) && node.onchange === null && (node.onchange = () => fireValueChange(worker, node));\n};\n/**\n * Tell the worker DOM what the value is for a Node.\n * @param worker whom to dispatch value toward.\n * @param node where to get the value from.\n */\nconst fireValueChange = (worker, node) => {\n messageToWorker(worker, {\n [9 /* type */]: 5 /* SYNC */,\n [38 /* sync */]: {\n [7 /* _index_ */]: node._index_,\n [18 /* value */]: node.value,\n },\n });\n};\n/**\n * Register an event handler for dispatching events to worker thread\n * @param worker whom to dispatch events toward\n * @param _index_ node index the event comes from (used to dispatchEvent in worker thread).\n * @return eventHandler function consuming event and dispatching to worker thread\n */\nconst eventHandler = (worker, _index_) => (event) => {\n if (shouldTrackChanges(event.currentTarget)) {\n fireValueChange(worker, event.currentTarget);\n }\n messageToWorker(worker, {\n [9 /* type */]: 1 /* EVENT */,\n [37 /* event */]: {\n [7 /* _index_ */]: _index_,\n [22 /* bubbles */]: event.bubbles,\n [23 /* cancelable */]: event.cancelable,\n [24 /* cancelBubble */]: event.cancelBubble,\n [25 /* currentTarget */]: {\n [7 /* _index_ */]: event.currentTarget._index_,\n [8 /* transferred */]: 1 /* TRUE */,\n },\n [26 /* defaultPrevented */]: event.defaultPrevented,\n [27 /* eventPhase */]: event.eventPhase,\n [28 /* isTrusted */]: event.isTrusted,\n [29 /* returnValue */]: event.returnValue,\n [10 /* target */]: {\n [7 /* _index_ */]: event.target._index_,\n [8 /* transferred */]: 1 /* TRUE */,\n },\n [30 /* timeStamp */]: event.timeStamp,\n [9 /* type */]: event.type,\n [32 /* keyCode */]: 'keyCode' in event ? event.keyCode : undefined,\n },\n });\n};\n/**\n * Process commands transfered from worker thread to main thread.\n * @param nodesInstance nodes instance to execute commands against.\n * @param worker whom to dispatch events toward.\n * @param mutation mutation record containing commands to execute.\n */\nexport function process(worker, mutation) {\n const _index_ = mutation[10 /* target */];\n const target = getNode(_index_);\n (mutation[21 /* removedEvents */] || []).forEach(eventSub => {\n processListenerChange(worker, target, false, getString(eventSub[9 /* type */]), eventSub[33 /* index */]);\n });\n (mutation[20 /* addedEvents */] || []).forEach(eventSub => {\n processListenerChange(worker, target, true, getString(eventSub[9 /* type */]), eventSub[33 /* index */]);\n });\n}\n/**\n * If the worker requests to add an event listener to 'change' for something the foreground thread is already listening to\n * ensure that only a single 'change' event is attached to prevent sending values multiple times.\n * @param worker worker issuing listener changes\n * @param target node to change listeners on\n * @param addEvent is this an 'addEvent' or 'removeEvent' change\n * @param type event type requested to change\n * @param index number in the listeners array this event corresponds to.\n */\nexport function processListenerChange(worker, target, addEvent, type, index) {\n let changeEventSubscribed = target.onchange !== null;\n const shouldTrack = shouldTrackChanges(target);\n const isChangeEvent = type === 'change';\n if (addEvent) {\n if (isChangeEvent) {\n changeEventSubscribed = true;\n target.onchange = null;\n }\n target.addEventListener(type, (KNOWN_LISTENERS[index] = eventHandler(worker, target._index_)));\n }\n else {\n if (isChangeEvent) {\n changeEventSubscribed = false;\n }\n target.removeEventListener(type, KNOWN_LISTENERS[index]);\n }\n if (shouldTrack && !changeEventSubscribed) {\n applyDefaultChangeListener(worker, target);\n }\n}\n//# sourceMappingURL=command.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { storeNode, getNode, createNode, isTextNode } from './nodes';\nimport { storeString, getString } from './strings';\nimport { applyDefaultChangeListener, processListenerChange } from './command';\nfunction allTextNodes(nodes) {\n return nodes.length > 0 && [].every.call(nodes, isTextNode);\n}\n/**\n * Replace all the children with the ones from the HydrateableNode.\n * Used when we're certain the content won't break the page.\n * @param nodes HydrateableNodes containing content to potentially overwrite main thread content.\n * @param parent Node in the main thread that will be the parent of the passed nodes.\n * @param worker worker that issued the request for hydration.\n */\nfunction replaceNodes(nodes, parent, worker) {\n [].forEach.call(parent.childNodes, (childNode) => childNode.remove());\n nodes.forEach((node, index) => {\n const newNode = createNode(node);\n (node[2 /* attributes */] || []).forEach(attribute => {\n const namespaceURI = getString(attribute[0]);\n if (namespaceURI !== 'null') {\n newNode.setAttributeNS(namespaceURI, getString(attribute[1]), getString(attribute[2]));\n }\n else {\n newNode.setAttribute(getString(attribute[1]), getString(attribute[2]));\n }\n });\n parent.appendChild(newNode);\n applyDefaultChangeListener(worker, newNode);\n replaceNodes(node[4 /* childNodes */] || [], parent.childNodes[index], worker);\n });\n}\n/**\n * Hydrate a single node and it's children safely.\n * Attempt to ensure content is a rough match so content doesn't shift between the document representation\n * and client side generated content.\n * @param transferNode root of the background thread content (document.body from worker-thread).\n * @param node root for the foreground thread content (element upgraded to background driven).\n * @param worker worker that issued the request for hydration.\n */\nfunction hydrateNode(transferNode, node, worker) {\n const transferIsText = isTextNode(transferNode);\n const nodeIsText = isTextNode(node);\n if (!transferIsText && !nodeIsText) {\n const childNodes = transferNode[4 /* childNodes */] || [];\n if (childNodes.length !== node.childNodes.length) {\n // If this parent node has an unequal number of childNodes, we need to ensure its for an allowable reason.\n if (allTextNodes(childNodes) && allTextNodes(node.childNodes)) {\n // Offset due to a differing number of text nodes.\n // replace the current DOM with the text nodes from the hydration.\n replaceNodes(childNodes, node, worker);\n }\n else {\n const filteredTransfer = childNodes.filter(childNode => !isTextNode(childNode));\n const filteredNodes = [].filter.call(node.childNodes, (childNode) => !isTextNode(childNode));\n // Empty text nodes are used by frameworks as placeholders for future dom content.\n if (filteredTransfer.length === filteredNodes.length) {\n storeNode(node, transferNode[7 /* _index_ */]);\n replaceNodes(childNodes, node, worker);\n }\n }\n }\n else {\n storeNode(node, transferNode[7 /* _index_ */]);\n applyDefaultChangeListener(worker, node);\n // Same number of children, hydrate them.\n childNodes.forEach((childNode, index) => hydrateNode(childNode, node.childNodes[index], worker));\n }\n }\n else if (transferIsText && nodeIsText) {\n // Singular text node, no children.\n storeNode(node, transferNode[7 /* _index_ */]);\n node.textContent = getString(transferNode[5 /* textContent */]);\n applyDefaultChangeListener(worker, node);\n }\n}\n/**\n * Hydrate a root from the worker thread by comparing with the main thread representation.\n * @param skeleton root of the background thread content.\n * @param addEvents events needing subscription from the background thread content.\n * @param baseElement root of the main thread content to compare against.\n * @param worker worker issuing the upgrade request.\n */\nexport function hydrate(skeleton, stringValues, addEvents, baseElement, worker) {\n // Process String Additions\n stringValues.forEach(value => storeString(value));\n // Process Node Addition / Removal\n hydrateNode(skeleton, baseElement, worker);\n // Process Event Addition\n addEvents.forEach(event => {\n const node = getNode(event[7 /* _index_ */]);\n node && processListenerChange(worker, node, true, getString(event[9 /* type */]), event[33 /* index */]);\n });\n}\n//# sourceMappingURL=hydrator.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNode, createNode } from './nodes';\nimport { storeString, getString } from './strings';\nimport { process } from './command';\nlet MUTATION_QUEUE = [];\nlet PENDING_MUTATIONS = false;\nlet worker;\nexport function prepareMutate(passedWorker) {\n worker = passedWorker;\n}\nconst mutators = {\n [2 /* CHILD_LIST */](mutation, target, sanitizer) {\n (mutation[12 /* removedNodes */] || []).forEach(node => getNode(node[7 /* _index_ */]).remove());\n const addedNodes = mutation[11 /* addedNodes */];\n const nextSibling = mutation[14 /* nextSibling */];\n if (addedNodes) {\n addedNodes.forEach(node => {\n let newChild = getNode(node[7 /* _index_ */]);\n if (!newChild) {\n newChild = createNode(node);\n if (sanitizer) {\n sanitizer.sanitize(newChild); // TODO(choumx): Inform worker?\n }\n }\n target.insertBefore(newChild, (nextSibling && getNode(nextSibling[7 /* _index_ */])) || null);\n });\n }\n },\n [0 /* ATTRIBUTES */](mutation, target, sanitizer) {\n const attributeName = mutation[15 /* attributeName */] !== undefined ? getString(mutation[15 /* attributeName */]) : null;\n const value = mutation[18 /* value */] !== undefined ? getString(mutation[18 /* value */]) : null;\n if (attributeName != null && value != null) {\n if (!sanitizer || sanitizer.validAttribute(target.nodeName, attributeName, value)) {\n target.setAttribute(attributeName, value);\n }\n else {\n // TODO(choumx): Inform worker?\n }\n }\n },\n [1 /* CHARACTER_DATA */](mutation, target) {\n const value = mutation[18 /* value */];\n if (value) {\n // Sanitization not necessary for textContent.\n target.textContent = getString(value);\n }\n },\n [3 /* PROPERTIES */](mutation, target, sanitizer) {\n const propertyName = mutation[17 /* propertyName */] !== undefined ? getString(mutation[17 /* propertyName */]) : null;\n const value = mutation[18 /* value */] !== undefined ? getString(mutation[18 /* value */]) : null;\n if (propertyName && value) {\n if (!sanitizer || sanitizer.validProperty(target.nodeName, propertyName, value)) {\n target[propertyName] = value;\n }\n else {\n // TODO(choumx): Inform worker?\n }\n }\n },\n [4 /* COMMAND */](mutation) {\n process(worker, mutation);\n },\n};\n/**\n * Process MutationRecords from worker thread applying changes to the existing DOM.\n * @param nodes New nodes to add in the main thread with the incoming mutations.\n * @param mutations Changes to apply in both graph shape and content of Elements.\n * @param sanitizer Sanitizer to apply to content if needed.\n */\nexport function mutate(nodes, stringValues, mutations, sanitizer) {\n //mutations: TransferrableMutationRecord[]): void {\n // TODO(KB): Restore signature requiring lastMutationTime. (lastGestureTime: number, mutations: TransferrableMutationRecord[])\n // if (performance.now() || Date.now() - lastGestureTime > GESTURE_TO_MUTATION_THRESHOLD) {\n // return;\n // }\n // this.lastGestureTime = lastGestureTime;\n stringValues.forEach(value => storeString(value));\n nodes.forEach(node => createNode(node));\n MUTATION_QUEUE = MUTATION_QUEUE.concat(mutations);\n if (!PENDING_MUTATIONS) {\n PENDING_MUTATIONS = true;\n requestAnimationFrame(() => syncFlush(sanitizer));\n }\n}\n/**\n * Apply all stored mutations syncronously. This method works well, but can cause jank if there are too many\n * mutations to apply in a single frame.\n *\n * Investigations in using asyncFlush to resolve are worth considering.\n */\nfunction syncFlush(sanitizer) {\n MUTATION_QUEUE.forEach(mutation => {\n mutators[mutation[9 /* type */]](mutation, getNode(mutation[10 /* target */]), sanitizer);\n });\n MUTATION_QUEUE = [];\n PENDING_MUTATIONS = false;\n}\n//# sourceMappingURL=mutator.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { hydrate } from './hydrator';\nimport { prepareMutate, mutate } from './mutator';\nimport { createWorker } from './worker';\nimport { prepare as prepareNodes } from './nodes';\nexport function install(baseElement, workerDOMUrl, sanitizer) {\n const authorURL = baseElement.getAttribute('src');\n if (authorURL === null) {\n return;\n }\n createWorker(workerDOMUrl, authorURL).then(worker => {\n if (worker === null) {\n return;\n }\n prepareNodes(baseElement);\n prepareMutate(worker);\n worker.onmessage = ({ data }) => {\n switch (data[9 /* type */]) {\n case 2 /* HYDRATE */:\n // console.info(`hydration from worker: ${data.type}`, data);\n hydrate(data[35 /* nodes */], data[39 /* strings */], data[20 /* addedEvents */], baseElement, worker);\n break;\n case 3 /* MUTATE */:\n // console.info(`mutation from worker: ${data.type}`, data);\n mutate(data[35 /* nodes */], data[39 /* strings */], data[34 /* mutations */], sanitizer);\n break;\n }\n };\n });\n}\n//# sourceMappingURL=install.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { install } from './install';\nexport function upgradeElement(baseElement, workerDOMUrl) {\n install(baseElement, workerDOMUrl);\n}\n//# sourceMappingURL=index.js.map"],"names":["getString","index","STRINGS","get","prepare","baseElement","NODES","Map","BASE_ELEMENT","isTextNode","node","nodeType","createNode","skeleton","_node","document","createTextNode","storeNode","namespace","undefined","createElementNS","createElement","getNode","id","nodeName","_index_","set","createWorker","workerDomURL","authorScriptURL","Promise","all","fetch","then","response","text","workerScript","authorScript","keys","key","body","style","push","code","encodeURI","Worker","URL","createObjectURL","Blob","catch","error","process","worker","mutation","target","eventSub","processListenerChange","addEvent","type","changeEventSubscribed","onchange","shouldTrack","shouldTrackChanges","isChangeEvent","addEventListener","KNOWN_LISTENERS","eventHandler","removeEventListener","applyDefaultChangeListener","allTextNodes","nodes","length","every","call","replaceNodes","parent","childNodes","childNode","remove","forEach","newNode","attribute","namespaceURI","setAttributeNS","setAttribute","appendChild","hydrateNode","transferNode","transferIsText","nodeIsText","textContent","filteredTransfer","filter","filteredNodes","hydrate","stringValues","addEvents","value","count","event","mutate","mutations","sanitizer","MUTATION_QUEUE","concat","PENDING_MUTATIONS","requestAnimationFrame","syncFlush","mutators","install","workerDOMUrl","authorURL","getAttribute","prepareNodes","onmessage","worker.onmessage","data","node.onchange","fireValueChange","postMessage","message","currentTarget","bubbles","cancelable","cancelBubble","defaultPrevented","eventPhase","isTrusted","returnValue","timeStamp","keyCode","addedNodes","nextSibling","newChild","sanitize","insertBefore","attributeName","validAttribute","propertyName","validProperty","upgradeElement"],"mappings":"wCAwBMA,QAAUA,EAAV,CAAoBC,CAApB,CAAiC,OAC9BC,EAAAC,IAAA,CAAYF,CAAZ,GAAsB,EADQ,CCCjCG,QAAUA,EAAV,C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AAR,EAGZC,CAAAoC,YAAA,CAAqB1F,CAAA,CAAUiG,CAAV,CAJ2E,IAOpG,YAAgC5C,EAAuCC,EAA2BgD,EAAqB,KAC/GoC,EACyCvH,IAAAA,EAA7C,GAAAkC,CAAA,CAAQ,EAAR,CAAA,CAAyDrD,CAAA,CAAUqD,CAAA,CAAQ,EAAR,CAAV,CAAzD,CAAyH,IACrH4C,EAAAA,CAA8C9E,IAAAA,EAAtC,GAAAkC,CAAA,CAAQ,EAAR,CAAA,CAAkDrD,CAAA,CAAUqD,CAAA,CAAQ,EAAR,CAAV,CAAlD;AAA2G,IACrHqF,IAAgBzC,IACd,CAACK,GAAaA,CAAAqC,cAAA,CAAwBrF,CAAA9B,SAAxB,CAAyCkH,CAAzC,CAAuDzC,CAAvD,KAChB3C,CAAA,CAAOoF,CAAP,EAAuBzC,EAN0F,IAYvH,YAA6B5C,EAAqC,CAChEF,CAAA,CAAQC,CAAR,CAAgBC,CAAhB,CADgE,GApD9DuD,mBEfAgC,QAAA,CAAyBvI,CAAzB,CAA+CyG,CAA/C,CAAmE,CACvED,CAAA,CAAQxG,CAAR,CAAoCyG,CAApC,CADuE;"} \ No newline at end of file diff --git a/dist/index.mjs b/dist/index.mjs deleted file mode 100644 index e073d8c5c..000000000 --- a/dist/index.mjs +++ /dev/null @@ -1,10 +0,0 @@ -let e=0;const g=new Map;function h(a){return g.get(a)||""}let k,m;function n(a){k=new Map([[1,a],[2,a]]);m=a}function p(a){return 3===("nodeType"in a?a.nodeType:a[0])}function q(a){if(p(a)){var b=document.createTextNode(h(a[5]));r(b,a[7]);return b}b=(b=void 0!==a[6]?h(a[6]):void 0)?document.createElementNS(b,h(a[1])):document.createElement(h(a[1]));r(b,a[7]);return b}function t(a){return(a=k.get(a))&&"BODY"===a.nodeName?m:a}function r(a,b){a._index_=b;k.set(b,a)} -function u(a,b){return Promise.all([fetch(a).then((a)=>a.text()),fetch(b).then((a)=>a.text())]).then(([a,c])=>{const d=[];for(let a in document.body.style)d.push(`'${a}'`);a=`\n 'use strict';\n ${a}\n (function() {\n var self = this;\n var window = this;\n var document = this.document;\n var localStorage = this.localStorage;\n var location = this.location;\n var defaultView = document.defaultView;\n var Node = defaultView.Node;\n var Text = defaultView.Text;\n var Element = defaultView.Element;\n var SVGElement = defaultView.SVGElement;\n var Document = defaultView.Document;\n var Event = defaultView.Event;\n var MutationObserver = defaultView.MutationObserver;\n\n function addEventListener(type, handler) {\n return document.addEventListener(type, handler);\n }\n function removeEventListener(type, handler) {\n return document.removeEventListener(type, handler);\n }\n this.appendKeys([${d}]);\n ${c}\n }).call(WorkerThread.workerDOM);\n//# sourceURL=${encodeURI(b)}`; -return new Worker(URL.createObjectURL(new Blob([a])))}).catch(()=>null)} -const v=[],w=(a,b)=>{b&&"value"in b&&null===b.onchange&&(b.onchange=()=>{a.postMessage({9:5,38:{7:b._index_,18:b.value}})})},x=(a,b)=>(d)=>{var c=d.currentTarget;c&&"value"in c&&(c=d.currentTarget,a.postMessage({9:5,38:{7:c._index_,18:c.value}}));a.postMessage({9:1,37:{7:b,22:d.bubbles,23:d.cancelable,24:d.cancelBubble,25:{7:d.currentTarget._index_,8:1},26:d.defaultPrevented,27:d.eventPhase,28:d.isTrusted,29:d.returnValue,10:{7:d.target._index_,8:1}, -30:d.timeStamp,9:d.type,32:"keyCode"in d?d.keyCode:void 0}})};function y(a,b){const d=t(b[10]);(b[21]||[]).forEach((b)=>{A(a,d,!1,h(b[9]),b[33])});(b[20]||[]).forEach((b)=>{A(a,d,!0,h(b[9]),b[33])})}function A(a,b,d,c,f){let l=null!==b.onchange;const H=b&&"value"in b,z="change"===c;d?(z&&(l=!0,b.onchange=null),b.addEventListener(c,v[f]=x(a,b._index_))):(z&&(l=!1),b.removeEventListener(c,v[f]));H&&!l&&w(a,b)}function B(a){return 0a.remove());a.forEach((a,f)=>{const c=q(a);(a[2]||[]).forEach((a)=>{const b=h(a[0]);"null"!==b?c.setAttributeNS(b,h(a[1]),h(a[2])):c.setAttribute(h(a[1]),h(a[2]))});b.appendChild(c);w(d,c);C(a[4]||[],b.childNodes[f],d)})} -function D(a,b,d){var c=p(a),f=p(b);if(c||f)c&&f&&(r(b,a[7]),b.textContent=h(a[5]),w(d,b));else if(c=a[4]||[],c.length!==b.childNodes.length)if(B(c)&&B(b.childNodes))C(c,b,d);else{f=c.filter((a)=>!p(a));const l=[].filter.call(b.childNodes,(a)=>!p(a));f.length===l.length&&(r(b,a[7]),C(c,b,d))}else r(b,a[7]),w(d,b),c.forEach((a,c)=>D(a,b.childNodes[c],d))}function E(a,b,d,c,f){b.forEach((a)=>{g.set(++e,a)});D(a,c,f);d.forEach((a)=>{const b=t(a[7]);b&&A(f,b,!0,h(a[9]),a[33])})}let F=[],G=!1,I; -const J={2(a,b,d){(a[12]||[]).forEach((a)=>t(a[7]).remove());const c=a[11],f=a[14];c&&c.forEach((a)=>{let c=t(a[7]);c||(c=q(a),d&&d.sanitize(c));b.insertBefore(c,f&&t(f[7])||null)})},0(a,b,d){const c=void 0!==a[15]?h(a[15]):null;a=void 0!==a[18]?h(a[18]):null;null==c||null==a||d&&!d.validAttribute(b.nodeName,c,a)||b.setAttribute(c,a)},1(a,b){if(a=a[18])b.textContent=h(a)},3(a,b,d){const c=void 0!==a[17]?h(a[17]):null;a=void 0!==a[18]?h(a[18]):null;c&&a&&(!d||d.validProperty(b.nodeName,c,a))&& -(b[c]=a)},4(a){y(I,a)}};function K(a,b,d,c){b.forEach((a)=>{g.set(++e,a)});a.forEach((a)=>q(a));F=F.concat(d);G||(G=!0,requestAnimationFrame(()=>L(c)))}function L(a){F.forEach((b)=>{J[b[9]](b,t(b[10]),a)});F=[];G=!1}function M(a,b,d){const c=a.getAttribute("src");null!==c&&u(b,c).then((b)=>{null!==b&&(n(a),I=b,b.onmessage=({data:c})=>{switch(c[9]){case 2:E(c[35],c[39],c[20],a,b);break;case 3:K(c[35],c[39],c[34],d)}})})}var upgradeElement=function(a,b){M(a,b)};export{upgradeElement}; -//# sourceMappingURL=index.mjs.map diff --git a/dist/index.mjs.map b/dist/index.mjs.map deleted file mode 100644 index 50d4c2d48..000000000 --- a/dist/index.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.mjs","sources":["../output/main-thread/strings.js","../output/main-thread/nodes.js","../output/main-thread/worker.js","../output/main-thread/command.js","../output/main-thread/hydrator.js","../output/main-thread/mutator.js","../output/main-thread/install.js","../output/main-thread/index.js"],"sourcesContent":["/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nlet count = 0;\nconst STRINGS = new Map();\n/**\n * Return a string for the specified index.\n * @param index string index to retrieve.\n * @returns string in map for the index.\n */\nexport function getString(index) {\n return STRINGS.get(index) || '';\n}\n/**\n * Stores a string for parsing from mutation\n * @param value string to store from background thread.\n */\nexport function storeString(value) {\n STRINGS.set(++count, value);\n}\n//# sourceMappingURL=strings.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getString } from './strings';\nlet NODES;\nlet BASE_ELEMENT;\nexport function prepare(baseElement) {\n NODES = new Map([[1, baseElement], [2, baseElement]]);\n BASE_ELEMENT = baseElement;\n}\nexport function isTextNode(node) {\n return ('nodeType' in node ? node.nodeType : node[0 /* nodeType */]) === 3 /* TEXT_NODE */;\n}\n/**\n * Create a real DOM Node from a skeleton Object (`{ nodeType, nodeName, attributes, children, data }`)\n * @example Text node\n * createNode({ nodeType:3, data:'foo' })\n * @example Element node\n * createNode({ nodeType:1, nodeName:'div', attributes:[{ name:'a', value:'b' }], childNodes:[ ... ] })\n */\nexport function createNode(skeleton) {\n if (isTextNode(skeleton)) {\n const node = document.createTextNode(getString(skeleton[5 /* textContent */]));\n storeNode(node, skeleton[7 /* _index_ */]);\n return node;\n }\n const namespace = skeleton[6 /* namespaceURI */] !== undefined ? getString(skeleton[6 /* namespaceURI */]) : undefined;\n const node = namespace\n ? document.createElementNS(namespace, getString(skeleton[1 /* nodeName */]))\n : document.createElement(getString(skeleton[1 /* nodeName */]));\n // TODO(KB): Restore Properties\n // skeleton.properties.forEach(property => {\n // node[`${property.name}`] = property.value;\n // });\n // ((skeleton as TransferrableElement)[TransferrableKeys.childNodes] || []).forEach(childNode => {\n // if (childNode[TransferrableKeys.transferred] === NumericBoolean.FALSE) {\n // node.appendChild(createNode(childNode as TransferrableNode));\n // }\n // });\n storeNode(node, skeleton[7 /* _index_ */]);\n return node;\n}\n/**\n * Returns the real DOM Element corresponding to a serialized Element object.\n * @param id\n * @return\n */\nexport function getNode(id) {\n const node = NODES.get(id);\n if (node && node.nodeName === 'BODY') {\n // If the node requested is the \"BODY\"\n // Then we return the base node this specific comes from.\n // This encapsulates each node.\n return BASE_ELEMENT;\n }\n return node;\n}\n/**\n * Establish link between DOM `node` and worker-generated identifier `id`.\n *\n * These _shouldn't_ collide between instances of since\n * each element creates it's own pool on both sides of the worker\n * communication bridge.\n * @param node\n * @param id\n */\nexport function storeNode(node, id) {\n node._index_ = id;\n NODES.set(id, node);\n}\n//# sourceMappingURL=nodes.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// TODO(KB): Fetch Polyfill for IE11.\nexport function createWorker(workerDomURL, authorScriptURL) {\n return Promise.all([fetch(workerDomURL).then(response => response.text()), fetch(authorScriptURL).then(response => response.text())])\n .then(([workerScript, authorScript]) => {\n // TODO(KB): Minify this output during build process.\n const keys = [];\n for (let key in document.body.style) {\n keys.push(`'${key}'`);\n }\n const code = `\n 'use strict';\n ${workerScript}\n (function() {\n var self = this;\n var window = this;\n var document = this.document;\n var localStorage = this.localStorage;\n var location = this.location;\n var defaultView = document.defaultView;\n var Node = defaultView.Node;\n var Text = defaultView.Text;\n var Element = defaultView.Element;\n var SVGElement = defaultView.SVGElement;\n var Document = defaultView.Document;\n var Event = defaultView.Event;\n var MutationObserver = defaultView.MutationObserver;\n\n function addEventListener(type, handler) {\n return document.addEventListener(type, handler);\n }\n function removeEventListener(type, handler) {\n return document.removeEventListener(type, handler);\n }\n this.appendKeys([${keys}]);\n ${authorScript}\n }).call(WorkerThread.workerDOM);\n//# sourceURL=${encodeURI(authorScriptURL)}`;\n return new Worker(URL.createObjectURL(new Blob([code])));\n })\n .catch(error => {\n return null;\n });\n}\nexport function messageToWorker(worker, message) {\n worker.postMessage(message);\n}\n//# sourceMappingURL=worker.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { messageToWorker } from './worker';\nimport { getNode } from './nodes';\nimport { getString } from './strings';\nconst KNOWN_LISTENERS = [];\n/**\n * Instead of a whitelist of elements that need their value tracked, use the existence\n * of a property called value to drive the decision.\n * @param node node to check if values should be tracked.\n * @return boolean if the node should have its value property tracked.\n */\nconst shouldTrackChanges = (node) => node && 'value' in node;\n/**\n * When a node that has a value needing synced doesn't already have an event listener\n * listening for changed values, ensure the value is synced with a default listener.\n * @param worker whom to dispatch value toward.\n * @param node node to listen to value changes on.\n */\nexport const applyDefaultChangeListener = (worker, node) => {\n shouldTrackChanges(node) && node.onchange === null && (node.onchange = () => fireValueChange(worker, node));\n};\n/**\n * Tell the worker DOM what the value is for a Node.\n * @param worker whom to dispatch value toward.\n * @param node where to get the value from.\n */\nconst fireValueChange = (worker, node) => {\n messageToWorker(worker, {\n [9 /* type */]: 5 /* SYNC */,\n [38 /* sync */]: {\n [7 /* _index_ */]: node._index_,\n [18 /* value */]: node.value,\n },\n });\n};\n/**\n * Register an event handler for dispatching events to worker thread\n * @param worker whom to dispatch events toward\n * @param _index_ node index the event comes from (used to dispatchEvent in worker thread).\n * @return eventHandler function consuming event and dispatching to worker thread\n */\nconst eventHandler = (worker, _index_) => (event) => {\n if (shouldTrackChanges(event.currentTarget)) {\n fireValueChange(worker, event.currentTarget);\n }\n messageToWorker(worker, {\n [9 /* type */]: 1 /* EVENT */,\n [37 /* event */]: {\n [7 /* _index_ */]: _index_,\n [22 /* bubbles */]: event.bubbles,\n [23 /* cancelable */]: event.cancelable,\n [24 /* cancelBubble */]: event.cancelBubble,\n [25 /* currentTarget */]: {\n [7 /* _index_ */]: event.currentTarget._index_,\n [8 /* transferred */]: 1 /* TRUE */,\n },\n [26 /* defaultPrevented */]: event.defaultPrevented,\n [27 /* eventPhase */]: event.eventPhase,\n [28 /* isTrusted */]: event.isTrusted,\n [29 /* returnValue */]: event.returnValue,\n [10 /* target */]: {\n [7 /* _index_ */]: event.target._index_,\n [8 /* transferred */]: 1 /* TRUE */,\n },\n [30 /* timeStamp */]: event.timeStamp,\n [9 /* type */]: event.type,\n [32 /* keyCode */]: 'keyCode' in event ? event.keyCode : undefined,\n },\n });\n};\n/**\n * Process commands transfered from worker thread to main thread.\n * @param nodesInstance nodes instance to execute commands against.\n * @param worker whom to dispatch events toward.\n * @param mutation mutation record containing commands to execute.\n */\nexport function process(worker, mutation) {\n const _index_ = mutation[10 /* target */];\n const target = getNode(_index_);\n (mutation[21 /* removedEvents */] || []).forEach(eventSub => {\n processListenerChange(worker, target, false, getString(eventSub[9 /* type */]), eventSub[33 /* index */]);\n });\n (mutation[20 /* addedEvents */] || []).forEach(eventSub => {\n processListenerChange(worker, target, true, getString(eventSub[9 /* type */]), eventSub[33 /* index */]);\n });\n}\n/**\n * If the worker requests to add an event listener to 'change' for something the foreground thread is already listening to\n * ensure that only a single 'change' event is attached to prevent sending values multiple times.\n * @param worker worker issuing listener changes\n * @param target node to change listeners on\n * @param addEvent is this an 'addEvent' or 'removeEvent' change\n * @param type event type requested to change\n * @param index number in the listeners array this event corresponds to.\n */\nexport function processListenerChange(worker, target, addEvent, type, index) {\n let changeEventSubscribed = target.onchange !== null;\n const shouldTrack = shouldTrackChanges(target);\n const isChangeEvent = type === 'change';\n if (addEvent) {\n if (isChangeEvent) {\n changeEventSubscribed = true;\n target.onchange = null;\n }\n target.addEventListener(type, (KNOWN_LISTENERS[index] = eventHandler(worker, target._index_)));\n }\n else {\n if (isChangeEvent) {\n changeEventSubscribed = false;\n }\n target.removeEventListener(type, KNOWN_LISTENERS[index]);\n }\n if (shouldTrack && !changeEventSubscribed) {\n applyDefaultChangeListener(worker, target);\n }\n}\n//# sourceMappingURL=command.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { storeNode, getNode, createNode, isTextNode } from './nodes';\nimport { storeString, getString } from './strings';\nimport { applyDefaultChangeListener, processListenerChange } from './command';\nfunction allTextNodes(nodes) {\n return nodes.length > 0 && [].every.call(nodes, isTextNode);\n}\n/**\n * Replace all the children with the ones from the HydrateableNode.\n * Used when we're certain the content won't break the page.\n * @param nodes HydrateableNodes containing content to potentially overwrite main thread content.\n * @param parent Node in the main thread that will be the parent of the passed nodes.\n * @param worker worker that issued the request for hydration.\n */\nfunction replaceNodes(nodes, parent, worker) {\n [].forEach.call(parent.childNodes, (childNode) => childNode.remove());\n nodes.forEach((node, index) => {\n const newNode = createNode(node);\n (node[2 /* attributes */] || []).forEach(attribute => {\n const namespaceURI = getString(attribute[0]);\n if (namespaceURI !== 'null') {\n newNode.setAttributeNS(namespaceURI, getString(attribute[1]), getString(attribute[2]));\n }\n else {\n newNode.setAttribute(getString(attribute[1]), getString(attribute[2]));\n }\n });\n parent.appendChild(newNode);\n applyDefaultChangeListener(worker, newNode);\n replaceNodes(node[4 /* childNodes */] || [], parent.childNodes[index], worker);\n });\n}\n/**\n * Hydrate a single node and it's children safely.\n * Attempt to ensure content is a rough match so content doesn't shift between the document representation\n * and client side generated content.\n * @param transferNode root of the background thread content (document.body from worker-thread).\n * @param node root for the foreground thread content (element upgraded to background driven).\n * @param worker worker that issued the request for hydration.\n */\nfunction hydrateNode(transferNode, node, worker) {\n const transferIsText = isTextNode(transferNode);\n const nodeIsText = isTextNode(node);\n if (!transferIsText && !nodeIsText) {\n const childNodes = transferNode[4 /* childNodes */] || [];\n if (childNodes.length !== node.childNodes.length) {\n // If this parent node has an unequal number of childNodes, we need to ensure its for an allowable reason.\n if (allTextNodes(childNodes) && allTextNodes(node.childNodes)) {\n // Offset due to a differing number of text nodes.\n // replace the current DOM with the text nodes from the hydration.\n replaceNodes(childNodes, node, worker);\n }\n else {\n const filteredTransfer = childNodes.filter(childNode => !isTextNode(childNode));\n const filteredNodes = [].filter.call(node.childNodes, (childNode) => !isTextNode(childNode));\n // Empty text nodes are used by frameworks as placeholders for future dom content.\n if (filteredTransfer.length === filteredNodes.length) {\n storeNode(node, transferNode[7 /* _index_ */]);\n replaceNodes(childNodes, node, worker);\n }\n }\n }\n else {\n storeNode(node, transferNode[7 /* _index_ */]);\n applyDefaultChangeListener(worker, node);\n // Same number of children, hydrate them.\n childNodes.forEach((childNode, index) => hydrateNode(childNode, node.childNodes[index], worker));\n }\n }\n else if (transferIsText && nodeIsText) {\n // Singular text node, no children.\n storeNode(node, transferNode[7 /* _index_ */]);\n node.textContent = getString(transferNode[5 /* textContent */]);\n applyDefaultChangeListener(worker, node);\n }\n}\n/**\n * Hydrate a root from the worker thread by comparing with the main thread representation.\n * @param skeleton root of the background thread content.\n * @param addEvents events needing subscription from the background thread content.\n * @param baseElement root of the main thread content to compare against.\n * @param worker worker issuing the upgrade request.\n */\nexport function hydrate(skeleton, stringValues, addEvents, baseElement, worker) {\n // Process String Additions\n stringValues.forEach(value => storeString(value));\n // Process Node Addition / Removal\n hydrateNode(skeleton, baseElement, worker);\n // Process Event Addition\n addEvents.forEach(event => {\n const node = getNode(event[7 /* _index_ */]);\n node && processListenerChange(worker, node, true, getString(event[9 /* type */]), event[33 /* index */]);\n });\n}\n//# sourceMappingURL=hydrator.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNode, createNode } from './nodes';\nimport { storeString, getString } from './strings';\nimport { process } from './command';\nlet MUTATION_QUEUE = [];\nlet PENDING_MUTATIONS = false;\nlet worker;\nexport function prepareMutate(passedWorker) {\n worker = passedWorker;\n}\nconst mutators = {\n [2 /* CHILD_LIST */](mutation, target, sanitizer) {\n (mutation[12 /* removedNodes */] || []).forEach(node => getNode(node[7 /* _index_ */]).remove());\n const addedNodes = mutation[11 /* addedNodes */];\n const nextSibling = mutation[14 /* nextSibling */];\n if (addedNodes) {\n addedNodes.forEach(node => {\n let newChild = getNode(node[7 /* _index_ */]);\n if (!newChild) {\n newChild = createNode(node);\n if (sanitizer) {\n sanitizer.sanitize(newChild); // TODO(choumx): Inform worker?\n }\n }\n target.insertBefore(newChild, (nextSibling && getNode(nextSibling[7 /* _index_ */])) || null);\n });\n }\n },\n [0 /* ATTRIBUTES */](mutation, target, sanitizer) {\n const attributeName = mutation[15 /* attributeName */] !== undefined ? getString(mutation[15 /* attributeName */]) : null;\n const value = mutation[18 /* value */] !== undefined ? getString(mutation[18 /* value */]) : null;\n if (attributeName != null && value != null) {\n if (!sanitizer || sanitizer.validAttribute(target.nodeName, attributeName, value)) {\n target.setAttribute(attributeName, value);\n }\n else {\n // TODO(choumx): Inform worker?\n }\n }\n },\n [1 /* CHARACTER_DATA */](mutation, target) {\n const value = mutation[18 /* value */];\n if (value) {\n // Sanitization not necessary for textContent.\n target.textContent = getString(value);\n }\n },\n [3 /* PROPERTIES */](mutation, target, sanitizer) {\n const propertyName = mutation[17 /* propertyName */] !== undefined ? getString(mutation[17 /* propertyName */]) : null;\n const value = mutation[18 /* value */] !== undefined ? getString(mutation[18 /* value */]) : null;\n if (propertyName && value) {\n if (!sanitizer || sanitizer.validProperty(target.nodeName, propertyName, value)) {\n target[propertyName] = value;\n }\n else {\n // TODO(choumx): Inform worker?\n }\n }\n },\n [4 /* COMMAND */](mutation) {\n process(worker, mutation);\n },\n};\n/**\n * Process MutationRecords from worker thread applying changes to the existing DOM.\n * @param nodes New nodes to add in the main thread with the incoming mutations.\n * @param mutations Changes to apply in both graph shape and content of Elements.\n * @param sanitizer Sanitizer to apply to content if needed.\n */\nexport function mutate(nodes, stringValues, mutations, sanitizer) {\n //mutations: TransferrableMutationRecord[]): void {\n // TODO(KB): Restore signature requiring lastMutationTime. (lastGestureTime: number, mutations: TransferrableMutationRecord[])\n // if (performance.now() || Date.now() - lastGestureTime > GESTURE_TO_MUTATION_THRESHOLD) {\n // return;\n // }\n // this.lastGestureTime = lastGestureTime;\n stringValues.forEach(value => storeString(value));\n nodes.forEach(node => createNode(node));\n MUTATION_QUEUE = MUTATION_QUEUE.concat(mutations);\n if (!PENDING_MUTATIONS) {\n PENDING_MUTATIONS = true;\n requestAnimationFrame(() => syncFlush(sanitizer));\n }\n}\n/**\n * Apply all stored mutations syncronously. This method works well, but can cause jank if there are too many\n * mutations to apply in a single frame.\n *\n * Investigations in using asyncFlush to resolve are worth considering.\n */\nfunction syncFlush(sanitizer) {\n MUTATION_QUEUE.forEach(mutation => {\n mutators[mutation[9 /* type */]](mutation, getNode(mutation[10 /* target */]), sanitizer);\n });\n MUTATION_QUEUE = [];\n PENDING_MUTATIONS = false;\n}\n//# sourceMappingURL=mutator.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { hydrate } from './hydrator';\nimport { prepareMutate, mutate } from './mutator';\nimport { createWorker } from './worker';\nimport { prepare as prepareNodes } from './nodes';\nexport function install(baseElement, workerDOMUrl, sanitizer) {\n const authorURL = baseElement.getAttribute('src');\n if (authorURL === null) {\n return;\n }\n createWorker(workerDOMUrl, authorURL).then(worker => {\n if (worker === null) {\n return;\n }\n prepareNodes(baseElement);\n prepareMutate(worker);\n worker.onmessage = ({ data }) => {\n switch (data[9 /* type */]) {\n case 2 /* HYDRATE */:\n // console.info(`hydration from worker: ${data.type}`, data);\n hydrate(data[35 /* nodes */], data[39 /* strings */], data[20 /* addedEvents */], baseElement, worker);\n break;\n case 3 /* MUTATE */:\n // console.info(`mutation from worker: ${data.type}`, data);\n mutate(data[35 /* nodes */], data[39 /* strings */], data[34 /* mutations */], sanitizer);\n break;\n }\n };\n });\n}\n//# sourceMappingURL=install.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { install } from './install';\nexport function upgradeElement(baseElement, workerDOMUrl) {\n install(baseElement, workerDOMUrl);\n}\n//# sourceMappingURL=index.js.map"],"names":["count","STRINGS","Map","getString","index","get","NODES","BASE_ELEMENT","prepare","baseElement","isTextNode","node","nodeType","createNode","skeleton","document","createTextNode","storeNode","namespace","undefined","createElementNS","createElement","getNode","id","nodeName","_index_","set","createWorker","workerDomURL","authorScriptURL","Promise","all","fetch","then","response","text","workerScript","authorScript","keys","key","body","style","push","code","encodeURI","Worker","URL","createObjectURL","Blob","catch","KNOWN_LISTENERS","applyDefaultChangeListener","worker","onchange","node.onchange","postMessage","message","value","eventHandler","event","currentTarget","bubbles","cancelable","cancelBubble","defaultPrevented","eventPhase","isTrusted","returnValue","target","timeStamp","type","keyCode","process","mutation","eventSub","processListenerChange","addEvent","changeEventSubscribed","shouldTrack","isChangeEvent","addEventListener","removeEventListener","allTextNodes","nodes","length","every","call","replaceNodes","parent","childNodes","childNode","remove","forEach","newNode","attribute","namespaceURI","setAttributeNS","setAttribute","appendChild","hydrateNode","transferNode","transferIsText","nodeIsText","textContent","filteredTransfer","filter","filteredNodes","hydrate","stringValues","addEvents","MUTATION_QUEUE","PENDING_MUTATIONS","mutators","sanitizer","addedNodes","nextSibling","newChild","sanitize","insertBefore","attributeName","validAttribute","propertyName","validProperty","mutate","mutations","concat","requestAnimationFrame","syncFlush","install","workerDOMUrl","authorURL","getAttribute","prepareNodes","onmessage","data","worker.onmessage","upgradeElement"],"mappings":"aAgBA,IAAIA,EAAgB,CACpB,OAAMC,EAA+B,IAAIC,GAOnCC,SAAUA,EAAV,CAAoBC,CAApB,CAAiC,OAC9BH,EAAAI,IAAA,CAAYD,CAAZ,GAAsB,EADQ,CCLvC,IAGIE,CAHJ,CAIIC,CAEEC,SAAUA,EAAV,CAAkBC,CAAlB,CAAsC,CAC1CH,CAAA,CAAQ,IAAIJ,GAAJ,CAAQ,CAAC,CAAC,CAAD,CAAIO,CAAJ,CAAD,CAAwC,CAAC,CAAD,CAAIA,CAAJ,CAAxC,CAAR,CACRF,EAAA,CAAeE,CAF2B,CAKtCC,QAAUA,EAAV,CAAqBC,CAArB,CAAmD,OACuB,MAAtE,UAAA,EAAcA,EAAd,CAAqBA,CAAAC,SAArB,CAAqCD,CAAA,CAAI,CAAJ,EADU,CAWnDE,QAAUA,EAAV,CAAqBC,CAArB,CAAgD,IAChDJ,CAAA,CAAWI,CAAX,EAAsB,KAClBH,EAAOI,QAAAC,eAAA,CAAwBb,CAAA,CAAUW,CAAA,CAAQ,CAAR,CAAV,CAAxB,CACbG,EAAA,CAAUN,CAAV,CAAgBG,CAAA,CAAQ,CAAR,CAAhB,QACOH,EAHiB,CAQpBA,CAAAA,CAAiC,CAFjCO,CAEiC,CADQC,IAAAA,EAA7C,GAAAL,CAAA,CAAQ,CAAR,CAAA,CAAyDX,CAAA,CAAUW,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QACN,EAEE3B,CAAA,CACG2B,CAAA,CAA4B,EAA5B,CADH,CAEGA,CAAA,CAA4B,EAA5B,CAFH,CAGGA,CAAA,CAA4B,EAA5B,CAHH,CAIE7H,CAJF,CAKE2C,CALF,aAQF,EAEEuE,CAAA,CACGW,CAAA,CAA2B,EAA3B,CADH,CAEGA,CAAA,CAA2B,EAA3B,CAFH,CAGGA,CAAA,CAA2B,EAA3B,CAHH,CAIErB,CAJF,EAd6C,EARD,CAApD,CAN2F,uBCLvFuB,QAAA,CAAyB/H,CAAzB,CAA+CwH,CAA/C,CAAmE,CACvED,CAAA,CAAQvH,CAAR,CAAoCwH,CAApC,CADuE;"} \ No newline at end of file diff --git a/dist/index.safe.js b/dist/index.safe.js deleted file mode 100644 index 63ba4f089..000000000 --- a/dist/index.safe.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict';var MainThread=function(R){function g(a,b){for(var c=b.length;c--;)"string"===typeof b[c]&&(b[c]=b[c].toLowerCase()),a[b[c]]=!0;return a}function ra(a){var b={},c=void 0;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b}function p(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b

').querySelector("svg img")&&(d=!0)}catch(Ha){}try{X("</title><img>").querySelector("title").textContent.match(/<\/title/)&&(f=!0)}catch(Ha){}}var Ca=function(a){return F.call(a.ownerDocument||a,a,m.SHOW_ELEMENT| -m.SHOW_COMMENT|m.SHOW_TEXT,function(){return m.FILTER_ACCEPT},!1)},Da=function(a){return"object"===("undefined"===typeof h?"undefined":W(h))?a instanceof h:a&&"object"===("undefined"===typeof a?"undefined":W(a))&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName},r=function(a,c,d){q[a]&&q[a].forEach(function(a){a.call(b,c,d,V)})},Ea=function(a){r("beforeSanitizeElements",a,null);var c=a instanceof v||a instanceof x?!1:"string"===typeof a.nodeName&&"string"===typeof a.textContent&&"function"=== -typeof a.removeChild&&a.attributes instanceof u&&"function"===typeof a.removeAttribute&&"function"===typeof a.setAttribute?!1:!0;if(c)return ka(a),!0;c=a.nodeName.toLowerCase();r("uponSanitizeElement",a,{tagName:c,allowedTags:k});if(!k[c]||ba[c]){if(ia&&!na[c]&&"function"===typeof a.insertAdjacentHTML)try{a.insertAdjacentHTML("AfterEnd",a.innerHTML)}catch(la){}ka(a);return!0}!P||a.firstElementChild||a.content&&a.content.firstElementChild||!/</g.test(a.textContent)||(b.removed.push({element:a.cloneNode()}), -a.innerHTML=a.innerHTML?a.innerHTML.replace(/</g,"<"):a.textContent.replace(/</g,"<"));T&&3===a.nodeType&&(c=a.textContent,c=c.replace(z," "),c=c.replace(B," "),a.textContent!==c&&(b.removed.push({element:a.cloneNode()}),a.textContent=c));r("afterSanitizeElements",a,null);return!1},Fa=function(a,b,c){if(Aa&&("id"===b||"name"===b)&&(c in e||c in pa))return!1;T&&(c=c.replace(z," "),c=c.replace(B," "));if(!da||!N.test(b))if(!M||!R.test(b))if(!l[b]||ca[b]||!(Ba[b]||Z.test(c.replace(J,""))||("src"=== -b||"xlink:href"===b)&&"script"!==a&&0===c.indexOf("data:")&&oa[a]||O&&!Y.test(c.replace(J,"")))&&c)return!1;return!0},Ga=function(a){var c,d;r("beforeSanitizeAttributes",a,null);var e=a.attributes;if(e){var f={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:l};for(d=e.length;d--;){var t=c=e[d],g=t.name;t=t.namespaceURI;c=c.value.trim();var h=g.toLowerCase();f.attrName=h;f.attrValue=c;f.keepAttr=!0;r("uponSanitizeAttribute",a,f);c=f.attrValue;if("name"===h&&"IMG"===a.nodeName&&e.id){var k=e.id; -e=Array.prototype.slice.apply(e);ma("id",a);ma(g,a);e.indexOf(k)>d&&a.setAttribute("id",k.value)}else if("INPUT"!==a.nodeName||"type"!==h||"file"!==c||!l[h]&&ca[h])"id"===g&&a.setAttribute(g,""),ma(g,a);else continue;if(f.keepAttr&&(k=a.nodeName.toLowerCase(),Fa(k,h,c)))try{t?a.setAttributeNS(t,g,c):a.setAttribute(g,c),b.removed.pop()}catch(Xa){}}r("afterSanitizeAttributes",a,null)}},qa=function la(a){var b,c=Ca(a);for(r("beforeSanitizeShadowDOM",a,null);b=c.nextNode();)r("uponSanitizeShadowNode", -b,null),Ea(b)||(b.content instanceof t&&la(b.content),Ga(b));r("afterSanitizeShadowDOM",a,null)};b.sanitize=function(d,e){var f=void 0,g=void 0;d||(d="\x3c!--\x3e");if("string"!==typeof d&&!Da(d)){if("function"!==typeof d.toString)throw new TypeError("toString is not a function");d=d.toString();if("string"!==typeof d)throw new TypeError("dirty is not a string, aborting");}if(!b.isSupported){if("object"===W(a.toStaticHTML)||"function"===typeof a.toStaticHTML){if("string"===typeof d)return a.toStaticHTML(d); -if(Da(d))return a.toStaticHTML(d.outerHTML)}return d}ea||ja(e);b.removed=[];if(!U)if(d instanceof h)f=X("\x3c!--\x3e"),e=f.ownerDocument.importNode(d,!0),1===e.nodeType&&"BODY"===e.nodeName?f=e:f.appendChild(e);else{if(!D&&!C&&-1===d.indexOf("<"))return d;f=X(d);if(!f)return D?null:""}f&&fa&&ka(f.firstChild);for(var k=Ca(U?d:f);e=k.nextNode();)3===e.nodeType&&e===g||Ea(e)||(e.content instanceof t&&qa(e.content),Ga(e),g=e);if(U)return d;if(D){if(ha)for(d=H.call(f.ownerDocument);f.firstChild;)d.appendChild(f.firstChild); -else d=f;Q&&(d=I.call(c,d,!0));return d}return C?f.outerHTML:f.innerHTML};b.setConfig=function(a){ja(a);ea=!0};b.clearConfig=function(){V=null;ea=!1};b.isValidAttribute=function(a,b,c){V||ja({});a=a.toLowerCase();b=b.toLowerCase();return Fa(a,b,c)};b.addHook=function(a,b){"function"===typeof b&&(q[a]=q[a]||[],q[a].push(b))};b.removeHook=function(a){q[a]&&q[a].pop()};b.removeHooks=function(a){q[a]&&(q[a]=[])};b.removeAllHooks=function(){q={}};return b}function h(a){return F.get(a)||""}function na(a){G= -new Map([[1,a],[2,a]]);Y=a}function u(a){return 3===("nodeType"in a?a.nodeType:a[0])}function H(a){if(u(a)){var b=document.createTextNode(h(a[5]));x(b,a[7]);return b}b=(b=void 0!==a[6]?h(a[6]):void 0)?document.createElementNS(b,h(a[1])):document.createElement(h(a[1]));x(b,a[7]);return b}function v(a){return(a=G.get(a))&&"BODY"===a.nodeName?Y:a}function x(a,b){a._index_=b;G.set(b,a)}function oa(a,b){return Promise.all([fetch(a).then(function(a){return a.text()}),fetch(b).then(function(a){return a.text()})]).then(function(a){var c= -a[0];a=a[1];var f=[],e;for(e in document.body.style)f.push("'"+e+"'");c="\n 'use strict';\n "+c+"\n (function() {\n var self = this;\n var window = this;\n var document = this.document;\n var localStorage = this.localStorage;\n var location = this.location;\n var defaultView = document.defaultView;\n var Node = defaultView.Node;\n var Text = defaultView.Text;\n var Element = defaultView.Element;\n var SVGElement = defaultView.SVGElement;\n var Document = defaultView.Document;\n var Event = defaultView.Event;\n var MutationObserver = defaultView.MutationObserver;\n\n function addEventListener(type, handler) {\n return document.addEventListener(type, handler);\n }\n function removeEventListener(type, handler) {\n return document.removeEventListener(type, handler);\n }\n this.appendKeys(["+ -f+"]);\n "+a+"\n }).call(WorkerThread.workerDOM);\n//# sourceURL="+encodeURI(b);return new Worker(URL.createObjectURL(new Blob([c])))}).catch(function(a){return null})}function pa(a,b){var c=v(b[10]);(b[21]||[]).forEach(function(b){I(a,c,!1,h(b[9]),b[33])});(b[20]||[]).forEach(function(b){I(a,c,!0,h(b[9]),b[33])})}function I(a,b,c,d,f){var e=null!==b.onchange,g=z(b),h="change"===d;c?(h&&(e=!0,b.onchange=null),b.addEventListener(d,J[f]=qa(a,b._index_))):(h&&(e=!1),b.removeEventListener(d, -J[f]));g&&!e&&A(a,b)}function K(a){return 0<a.length&&[].every.call(a,u)}function B(a,b,c){[].forEach.call(b.childNodes,function(a){return a.remove()});a.forEach(function(a,f){var e=H(a);(a[2]||[]).forEach(function(a){var b=h(a[0]);"null"!==b?e.setAttributeNS(b,h(a[1]),h(a[2])):e.setAttribute(h(a[1]),h(a[2]))});b.appendChild(e);A(c,e);B(a[4]||[],b.childNodes[f],c)})}function L(a,b,c){var d=u(a),f=u(b);if(d||f)d&&f&&(x(b,a[7]),b.textContent=h(a[5]),A(c,b));else if(d=a[4]||[],d.length!==b.childNodes.length)if(K(d)&& -K(b.childNodes))B(d,b,c);else{f=d.filter(function(a){return!u(a)});var e=[].filter.call(b.childNodes,function(a){return!u(a)});f.length===e.length&&(x(b,a[7]),B(d,b,c))}else x(b,a[7]),A(c,b),d.forEach(function(a,e){return L(a,b.childNodes[e],c)})}function Pa(a,b,c,d,f){b.forEach(function(a){F.set(++M,a)});L(a,d,f);c.forEach(function(a){var b=v(a[7]);b&&I(f,b,!0,h(a[9]),a[33])})}function Qa(a,b,c,d){b.forEach(function(a){F.set(++M,a)});a.forEach(function(a){return H(a)});w=w.concat(c);N||(N=!0,requestAnimationFrame(function(){return Ra(d)}))} -function Ra(a){w.forEach(function(b){Sa[b[9]](b,v(b[10]),a)});w=[];N=!1}function Ta(a,b,c){var d=a.getAttribute("src");null!==d&&oa(b,d).then(function(b){null!==b&&(na(a),O=b,b.onmessage=function(d){d=d.data;switch(d[9]){case 2:Pa(d[35],d[39],d[20],a,b);break;case 3:Qa(d[35],d[39],d[34],c)}})})}var ta="a abbr acronym address area article aside audio b bdi bdo big blink blockquote body br button canvas caption center cite code col colgroup content data datalist dd decorator del details dfn dir div dl dt element em fieldset figcaption figure font footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i img input ins kbd label legend li main map mark marquee menu menuitem meter nav nobr ol optgroup option output p pre progress q rp rt ruby s samp section select shadow small source spacer span strike strong style sub summary sup table tbody td template textarea tfoot th thead time tr track tt u ul var video wbr".split(" "), -ua="svg a altglyph altglyphdef altglyphitem animatecolor animatemotion animatetransform audio canvas circle clippath defs desc ellipse filter font g glyph glyphref hkern image line lineargradient marker mask metadata mpath path pattern polygon polyline radialgradient rect stop style switch symbol text textpath title tref tspan video view vkern".split(" "),va="feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile feTurbulence".split(" "), -wa="math menclose merror mfenced mfrac mglyph mi mlabeledtr mmuliscripts mn mo mover mpadded mphantom mroot mrow ms mpspace msqrt mystyle msub msup msubsup mtable mtd mtext mtr munder munderover".split(" "),xa=["#text"],ya="accept action align alt autocomplete background bgcolor border cellpadding cellspacing checked cite class clear color cols colspan coords crossorigin datetime default dir disabled download enctype face for headers height hidden high href hreflang id integrity ismap label lang list loop low max maxlength media method min multiple name noshade novalidate nowrap open optimum pattern placeholder poster preload pubdate radiogroup readonly rel required rev reversed role rows rowspan spellcheck scope selected shape size sizes span srclang start src srcset step style summary tabindex title type usemap valign value width xmlns".split(" "), -aa="accent-height accumulate additivive alignment-baseline ascent attributename attributetype azimuth basefrequency baseline-shift begin bias by class clip clip-path clip-rule color color-interpolation color-interpolation-filters color-profile color-rendering cx cy d dx dy diffuseconstant direction display divisor dur edgemode elevation end fill fill-opacity fill-rule filter flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight fx fy g1 g2 glyph-name glyphref gradientunits gradienttransform height href id image-rendering in in2 k k1 k2 k3 k4 kerning keypoints keysplines keytimes lang lengthadjust letter-spacing kernelmatrix kernelunitlength lighting-color local marker-end marker-mid marker-start markerheight markerunits markerwidth maskcontentunits maskunits max mask media method mode min name numoctaves offset operator opacity order orient orientation origin overflow paint-order path pathlength patterncontentunits patterntransform patternunits points preservealpha preserveaspectratio r rx ry radius refx refy repeatcount repeatdur restart result rotate scale seed shape-rendering specularconstant specularexponent spreadmethod stddeviation stitchtiles stop-color stop-opacity stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke stroke-width style surfacescale tabindex targetx targety transform text-anchor text-decoration text-rendering textlength type u1 u2 unicode values viewbox visibility vert-adv-y vert-origin-x vert-origin-y width word-spacing wrap writing-mode xchannelselector ychannelselector x x1 x2 xmlns y y1 y2 z zoomandpan".split(" "), -za="accent accentunder align bevelled close columnsalign columnlines columnspan denomalign depth dir display displaystyle fence frame height href id largeop length linethickness lspace lquote mathbackground mathcolor mathsize mathvariant maxsize minsize movablelimits notation numalign open rowalign rowlines rowspacing rowspan rspace rquote scriptlevel scriptminsize scriptsizemultiplier selection separator separators stretchy subscriptshift supscriptshift symmetric voffset width xmlns".split(" "), -S=["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"],Ia=/\{\{[\s\S]*|[\s\S]*\}\}/gm,Ja=/<%[\s\S]*|[\s\S]*%>/gm,Ka=/^data-[\-\w.\u00B7-\uFFFF]/,La=/^aria-[\-\w]+$/,Oa=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,Ma=/^(?:\w+script|data):/i,Na=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,W="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"===typeof Symbol&& -a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},P=sa(),Ua={},Va=function(){function a(){}var b=a.prototype;b.sanitize=function(a){P.sanitize(a,{IN_PLACE:!0})};b.validAttribute=function(a,b,f){return P.isValidAttribute(a,b,f)};b.validProperty=function(a,b,f){var c=Ua[b];return c?this.validAttribute(a,c,f):this.validAttribute(a,b,f)};return a}(),M=0,F=new Map,G,Y,J=[],z=function(a){return a&&"value"in a},A=function(a,b){z(b)&&null===b.onchange&&(b.onchange=function(){return Q(a,b)})}, -Q=function(a,b){var c,d;b=(d={},d[9]=5,d[38]=(c={},c[7]=b._index_,c[18]=b.value,c),d);a.postMessage(b)},qa=function(a,b){return function(c){var d,f,e,g;z(c.currentTarget)&&Q(a,c.currentTarget);c=(g={},g[9]=1,g[37]=(e={},e[7]=b,e[22]=c.bubbles,e[23]=c.cancelable,e[24]=c.cancelBubble,e[25]=(d={},d[7]=c.currentTarget._index_,d[8]=1,d),e[26]=c.defaultPrevented,e[27]=c.eventPhase,e[28]=c.isTrusted,e[29]=c.returnValue,e[10]=(f={},f[7]=c.target._index_,f[8]=1,f),e[30]=c.timeStamp,e[9]=c.type,e[32]="keyCode"in -c?c.keyCode:void 0,e),g);a.postMessage(c)}},m,w=[],N=!1,O,Sa=(m={},m[2]=function(a,b,c){(a[12]||[]).forEach(function(a){return v(a[7]).remove()});var d=a[11],f=a[14];d&&d.forEach(function(a){var d=v(a[7]);d||(d=H(a),c&&c.sanitize(d));b.insertBefore(d,f&&v(f[7])||null)})},m[0]=function(a,b,c){var d=void 0!==a[15]?h(a[15]):null;a=void 0!==a[18]?h(a[18]):null;null==d||null==a||c&&!c.validAttribute(b.nodeName,d,a)||b.setAttribute(d,a)},m[1]=function(a,b){if(a=a[18])b.textContent=h(a)},m[3]=function(a, -b,c){var d=void 0!==a[17]?h(a[17]):null;a=void 0!==a[18]?h(a[18]):null;d&&a&&(!c||c.validProperty(b.nodeName,d,a))&&(b[d]=a)},m[4]=function(a){pa(O,a)},m);R.upgradeElement=function(a,b){Ta(a,b,new Va)};return R}({}); -//# sourceMappingURL=index.safe.js.map diff --git a/dist/index.safe.js.map b/dist/index.safe.js.map deleted file mode 100644 index ea23c8065..000000000 --- a/dist/index.safe.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.safe.js","sources":["../node_modules/dompurify/dist/purify.es.js","../output/main-thread/strings.js","../output/main-thread/nodes.js","../output/main-thread/worker.js","../output/main-thread/command.js","../output/main-thread/hydrator.js","../output/main-thread/mutator.js","../output/main-thread/install.js","../output/main-thread/DOMPurifySanitizer.js","../output/main-thread/index.safe.js"],"sourcesContent":["var html = ['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr'];\n\n// SVG\nvar svg = ['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'audio', 'canvas', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'video', 'view', 'vkern'];\n\nvar svgFilters = ['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence'];\n\nvar mathMl = ['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmuliscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mpspace', 'msqrt', 'mystyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover'];\n\nvar text = ['#text'];\n\nvar html$1 = ['accept', 'action', 'align', 'alt', 'autocomplete', 'background', 'bgcolor', 'border', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'coords', 'crossorigin', 'datetime', 'default', 'dir', 'disabled', 'download', 'enctype', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'integrity', 'ismap', 'label', 'lang', 'list', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'multiple', 'name', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns'];\n\nvar svg$1 = ['accent-height', 'accumulate', 'additivive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'tabindex', 'targetx', 'targety', 'transform', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan'];\n\nvar mathMl$1 = ['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns'];\n\nvar xml = ['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink'];\n\n/* Add properties to a lookup table */\nfunction addToSet(set, array) {\n var l = array.length;\n while (l--) {\n if (typeof array[l] === 'string') {\n array[l] = array[l].toLowerCase();\n }\n set[array[l]] = true;\n }\n return set;\n}\n\n/* Shallow clone an object */\nfunction clone(object) {\n var newObject = {};\n var property = void 0;\n for (property in object) {\n if (Object.prototype.hasOwnProperty.call(object, property)) {\n newObject[property] = object[property];\n }\n }\n return newObject;\n}\n\nvar MUSTACHE_EXPR = /\\{\\{[\\s\\S]*|[\\s\\S]*\\}\\}/gm; // Specify template detection regex for SAFE_FOR_TEMPLATES mode\nvar ERB_EXPR = /<%[\\s\\S]*|[\\s\\S]*%>/gm;\nvar DATA_ATTR = /^data-[\\-\\w.\\u00B7-\\uFFFF]/; // eslint-disable-line no-useless-escape\nvar ARIA_ATTR = /^aria-[\\-\\w]+$/; // eslint-disable-line no-useless-escape\nvar IS_ALLOWED_URI = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i; // eslint-disable-line no-useless-escape\nvar IS_SCRIPT_OR_DATA = /^(?:\\w+script|data):/i;\nvar ATTR_WHITESPACE = /[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205f\\u3000]/g; // eslint-disable-line no-control-regex\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n};\n\nfunction createDOMPurify() {\n var window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n\n var DOMPurify = function DOMPurify(root) {\n return createDOMPurify(root);\n };\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = '1.0.8';\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n\n if (!window || !window.document || window.document.nodeType !== 9) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n\n return DOMPurify;\n }\n\n var originalDocument = window.document;\n var useDOMParser = false; // See comment below\n var removeTitle = false; // See comment below\n\n var document = window.document;\n var DocumentFragment = window.DocumentFragment,\n HTMLTemplateElement = window.HTMLTemplateElement,\n Node = window.Node,\n NodeFilter = window.NodeFilter,\n _window$NamedNodeMap = window.NamedNodeMap,\n NamedNodeMap = _window$NamedNodeMap === undefined ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap,\n Text = window.Text,\n Comment = window.Comment,\n DOMParser = window.DOMParser;\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n\n if (typeof HTMLTemplateElement === 'function') {\n var template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n\n var _document = document,\n implementation = _document.implementation,\n createNodeIterator = _document.createNodeIterator,\n getElementsByTagName = _document.getElementsByTagName,\n createDocumentFragment = _document.createDocumentFragment;\n var importNode = originalDocument.importNode;\n\n\n var hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = implementation && typeof implementation.createHTMLDocument !== 'undefined' && document.documentMode !== 9;\n\n var MUSTACHE_EXPR$$1 = MUSTACHE_EXPR,\n ERB_EXPR$$1 = ERB_EXPR,\n DATA_ATTR$$1 = DATA_ATTR,\n ARIA_ATTR$$1 = ARIA_ATTR,\n IS_SCRIPT_OR_DATA$$1 = IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE$$1 = ATTR_WHITESPACE;\n var IS_ALLOWED_URI$$1 = IS_ALLOWED_URI;\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n\n var ALLOWED_TAGS = null;\n var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray(html), _toConsumableArray(svg), _toConsumableArray(svgFilters), _toConsumableArray(mathMl), _toConsumableArray(text)));\n\n /* Allowed attribute names */\n var ALLOWED_ATTR = null;\n var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(_toConsumableArray(html$1), _toConsumableArray(svg$1), _toConsumableArray(mathMl$1), _toConsumableArray(xml)));\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n var FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n var FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n var ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n var ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n var ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Output should be safe for jQuery's $() factory? */\n var SAFE_FOR_JQUERY = false;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n var SAFE_FOR_TEMPLATES = false;\n\n /* Decide if document with <html>... should be returned */\n var WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n var SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n var FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html string.\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n var RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html string */\n var RETURN_DOM_FRAGMENT = false;\n\n /* If `RETURN_DOM` or `RETURN_DOM_FRAGMENT` is enabled, decide if the returned DOM\n * `Node` is imported into the current `Document`. If this flag is not enabled the\n * `Node` will belong (its ownerDocument) to a fresh `HTMLDocument`, created by\n * DOMPurify. */\n var RETURN_DOM_IMPORT = false;\n\n /* Output should be free from DOM clobbering attacks? */\n var SANITIZE_DOM = true;\n\n /* Keep element content when removing element? */\n var KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n var IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n var USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n var FORBID_CONTENTS = addToSet({}, ['audio', 'head', 'math', 'script', 'style', 'template', 'svg', 'video']);\n\n /* Tags that are safe for data: URIs */\n var DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image']);\n\n /* Attributes safe for values like \"javascript:\" */\n var URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'summary', 'title', 'value', 'style', 'xmlns']);\n\n /* Keep a reference to config to pass to hooks */\n var CONFIG = null;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n var formElement = document.createElement('form');\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n var _parseConfig = function _parseConfig(cfg) {\n /* Shield configuration object from tampering */\n if ((typeof cfg === 'undefined' ? 'undefined' : _typeof(cfg)) !== 'object') {\n cfg = {};\n }\n /* Set configuration parameters */\n ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR) : DEFAULT_ALLOWED_ATTR;\n FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS) : {};\n FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR) : {};\n USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n SAFE_FOR_JQUERY = cfg.SAFE_FOR_JQUERY || false; // Default false\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_DOM_IMPORT = cfg.RETURN_DOM_IMPORT || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n\n IS_ALLOWED_URI$$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI$$1;\n\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray(text)));\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html);\n addToSet(ALLOWED_ATTR, html$1);\n }\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg);\n addToSet(ALLOWED_ATTR, svg$1);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg$1);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl);\n addToSet(ALLOWED_ATTR, mathMl$1);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS);\n }\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR);\n }\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (Object && 'freeze' in Object) {\n Object.freeze(cfg);\n }\n\n CONFIG = cfg;\n };\n\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n var _forceRemove = function _forceRemove(node) {\n DOMPurify.removed.push({ element: node });\n try {\n node.parentNode.removeChild(node);\n } catch (err) {\n node.outerHTML = '';\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n var _removeAttribute = function _removeAttribute(name, node) {\n try {\n DOMPurify.removed.push({\n attribute: node.getAttributeNode(name),\n from: node\n });\n } catch (err) {\n DOMPurify.removed.push({\n attribute: null,\n from: node\n });\n }\n node.removeAttribute(name);\n };\n\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n var _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n var doc = void 0;\n\n if (FORCE_BODY) {\n dirty = '<remove></remove>' + dirty;\n }\n\n /* Use DOMParser to workaround Firefox bug (see comment below) */\n if (useDOMParser) {\n try {\n doc = new DOMParser().parseFromString(dirty, 'text/html');\n } catch (err) {}\n }\n\n /* Remove title to fix an mXSS bug in older MS Edge */\n if (removeTitle) {\n addToSet(FORBID_TAGS, ['title']);\n }\n\n /* Otherwise use createHTMLDocument, because DOMParser is unsafe in\n Safari (see comment below) */\n if (!doc || !doc.documentElement) {\n doc = implementation.createHTMLDocument('');\n var _doc = doc,\n body = _doc.body;\n\n body.parentNode.removeChild(body.parentNode.firstElementChild);\n body.outerHTML = dirty;\n }\n\n /* Work on whole document or just its body */\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n };\n\n // Firefox uses a different parser for innerHTML rather than\n // DOMParser (see https://bugzilla.mozilla.org/show_bug.cgi?id=1205631)\n // which means that you *must* use DOMParser, otherwise the output may\n // not be safe if used in a document.write context later.\n //\n // So we feature detect the Firefox bug and use the DOMParser if necessary.\n //\n // MS Edge, in older versions, is affected by an mXSS behavior. The second\n // check tests for the behavior and fixes it if necessary.\n if (DOMPurify.isSupported) {\n (function () {\n try {\n var doc = _initDocument('<svg><p><style><img src=\"</style><img src=x onerror=alert(1)//\">');\n if (doc.querySelector('svg img')) {\n useDOMParser = true;\n }\n } catch (err) {}\n })();\n (function () {\n try {\n var doc = _initDocument('<x/><title></title><img>');\n if (doc.querySelector('title').textContent.match(/<\\/title/)) {\n removeTitle = true;\n }\n } catch (err) {}\n })();\n }\n\n /**\n * _createIterator\n *\n * @param {Document} root document/fragment to create iterator for\n * @return {Iterator} iterator instance\n */\n var _createIterator = function _createIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, function () {\n return NodeFilter.FILTER_ACCEPT;\n }, false);\n };\n\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n var _isClobbered = function _isClobbered(elm) {\n if (elm instanceof Text || elm instanceof Comment) {\n return false;\n }\n if (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function') {\n return true;\n }\n return false;\n };\n\n /**\n * _isNode\n *\n * @param {Node} obj object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n var _isNode = function _isNode(obj) {\n return (typeof Node === 'undefined' ? 'undefined' : _typeof(Node)) === 'object' ? obj instanceof Node : obj && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && typeof obj.nodeType === 'number' && typeof obj.nodeName === 'string';\n };\n\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n var _executeHook = function _executeHook(entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n\n hooks[entryPoint].forEach(function (hook) {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n var _sanitizeElements = function _sanitizeElements(currentNode) {\n var content = void 0;\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeElements', currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n var tagName = currentNode.nodeName.toLowerCase();\n\n /* Execute a hook if present */\n _executeHook('uponSanitizeElement', currentNode, {\n tagName: tagName,\n allowedTags: ALLOWED_TAGS\n });\n\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Keep content except for black-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName] && typeof currentNode.insertAdjacentHTML === 'function') {\n try {\n currentNode.insertAdjacentHTML('AfterEnd', currentNode.innerHTML);\n } catch (err) {}\n }\n _forceRemove(currentNode);\n return true;\n }\n\n /* Convert markup to cover jQuery behavior */\n if (SAFE_FOR_JQUERY && !currentNode.firstElementChild && (!currentNode.content || !currentNode.content.firstElementChild) && /</g.test(currentNode.textContent)) {\n DOMPurify.removed.push({ element: currentNode.cloneNode() });\n if (currentNode.innerHTML) {\n currentNode.innerHTML = currentNode.innerHTML.replace(/</g, '<');\n } else {\n currentNode.innerHTML = currentNode.textContent.replace(/</g, '<');\n }\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {\n /* Get the element's text content */\n content = currentNode.textContent;\n content = content.replace(MUSTACHE_EXPR$$1, ' ');\n content = content.replace(ERB_EXPR$$1, ' ');\n if (currentNode.textContent !== content) {\n DOMPurify.removed.push({ element: currentNode.cloneNode() });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeElements', currentNode, null);\n\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n var _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n value = value.replace(MUSTACHE_EXPR$$1, ' ');\n value = value.replace(ERB_EXPR$$1, ' ');\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && DATA_ATTR$$1.test(lcName)) {\n // This attribute is safe\n } else if (ALLOW_ARIA_ATTR && ARIA_ATTR$$1.test(lcName)) {\n // This attribute is safe\n /* Otherwise, check the name is permitted */\n } else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n return false;\n\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) {\n // This attribute is safe\n /* Check no script, data or unknown possibly unsafe URI\n unless we know URI values are safe for that attribute */\n } else if (IS_ALLOWED_URI$$1.test(value.replace(ATTR_WHITESPACE$$1, ''))) {\n // This attribute is safe\n /* Keep image data URIs alive if src/xlink:href is allowed */\n /* Further prevent gadget XSS for dynamically built script tags */\n } else if ((lcName === 'src' || lcName === 'xlink:href') && lcTag !== 'script' && value.indexOf('data:') === 0 && DATA_URI_TAGS[lcTag]) {\n // This attribute is safe\n /* Allow unknown protocols: This provides support for links that\n are handled by protocol handlers which may be unknown ahead of\n time, e.g. fb:, spotify: */\n } else if (ALLOW_UNKNOWN_PROTOCOLS && !IS_SCRIPT_OR_DATA$$1.test(value.replace(ATTR_WHITESPACE$$1, ''))) {\n // This attribute is safe\n /* Check for binary attributes */\n // eslint-disable-next-line no-negated-condition\n } else if (!value) {\n // Binary attributes are safe at this point\n /* Anything else, presume unsafe, do not add it back */\n } else {\n return false;\n }\n return true;\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} node to sanitize\n */\n // eslint-disable-next-line complexity\n var _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n var attr = void 0;\n var value = void 0;\n var lcName = void 0;\n var idAttr = void 0;\n var l = void 0;\n /* Execute a hook if present */\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n\n var attributes = currentNode.attributes;\n\n /* Check if we have attributes; if not we might have a text node */\n\n if (!attributes) {\n return;\n }\n\n var hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR\n };\n l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n attr = attributes[l];\n var _attr = attr,\n name = _attr.name,\n namespaceURI = _attr.namespaceURI;\n\n value = attr.value.trim();\n lcName = name.toLowerCase();\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n value = hookEvent.attrValue;\n\n /* Remove attribute */\n // Safari (iOS + Mac), last tested v8.0.5, crashes if you try to\n // remove a \"name\" attribute from an <img> tag that has an \"id\"\n // attribute at the time.\n if (lcName === 'name' && currentNode.nodeName === 'IMG' && attributes.id) {\n idAttr = attributes.id;\n attributes = Array.prototype.slice.apply(attributes);\n _removeAttribute('id', currentNode);\n _removeAttribute(name, currentNode);\n if (attributes.indexOf(idAttr) > l) {\n currentNode.setAttribute('id', idAttr.value);\n }\n } else if (\n // This works around a bug in Safari, where input[type=file]\n // cannot be dynamically set after type has been removed\n currentNode.nodeName === 'INPUT' && lcName === 'type' && value === 'file' && (ALLOWED_ATTR[lcName] || !FORBID_ATTR[lcName])) {\n continue;\n } else {\n // This avoids a crash in Safari v9.0 with double-ids.\n // The trick is to first set the id to be empty and then to\n // remove the attribute\n if (name === 'id') {\n currentNode.setAttribute(name, '');\n }\n _removeAttribute(name, currentNode);\n }\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n\n /* Is `value` valid for this attribute? */\n var lcTag = currentNode.nodeName.toLowerCase();\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n DOMPurify.removed.pop();\n } catch (err) {}\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n var _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n var shadowNode = void 0;\n var shadowIterator = _createIterator(fragment);\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(shadowNode);\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} configuration object\n */\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty, cfg) {\n var body = void 0;\n var importedNode = void 0;\n var currentNode = void 0;\n var oldNode = void 0;\n var returnNode = void 0;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n if (!dirty) {\n dirty = '<!-->';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n // eslint-disable-next-line no-negated-condition\n if (typeof dirty.toString !== 'function') {\n throw new TypeError('toString is not a function');\n } else {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw new TypeError('dirty is not a string, aborting');\n }\n }\n }\n\n /* Check we can run. Otherwise fall back or ignore */\n if (!DOMPurify.isSupported) {\n if (_typeof(window.toStaticHTML) === 'object' || typeof window.toStaticHTML === 'function') {\n if (typeof dirty === 'string') {\n return window.toStaticHTML(dirty);\n }\n if (_isNode(dirty)) {\n return window.toStaticHTML(dirty.outerHTML);\n }\n }\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n if (IN_PLACE) {\n /* No special handling necessary for in-place sanitization */\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('<!-->');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else {\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !WHOLE_DOCUMENT && dirty.indexOf('<') === -1) {\n return dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : '';\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n var nodeIterator = _createIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while (currentNode = nodeIterator.nextNode()) {\n /* Fix IE's strange behavior with manipulated textNodes #89 */\n if (currentNode.nodeType === 3 && currentNode === oldNode) {\n continue;\n }\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n\n oldNode = currentNode;\n }\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n\n while (body.firstChild) {\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n\n if (RETURN_DOM_IMPORT) {\n /* AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs. */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n\n return returnNode;\n }\n\n return WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function (cfg) {\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {string} tag Tag name of containing element.\n * @param {string} attr Attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n var lcTag = tag.toLowerCase();\n var lcName = attr.toLowerCase();\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n hooks[entryPoint] = hooks[entryPoint] || [];\n hooks[entryPoint].push(hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n */\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint].pop();\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n *\n */\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n\n return DOMPurify;\n}\n\nvar purify = createDOMPurify();\n\nexport default purify;\n//# sourceMappingURL=purify.es.js.map\n","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nlet count = 0;\nconst STRINGS = new Map();\n/**\n * Return a string for the specified index.\n * @param index string index to retrieve.\n * @returns string in map for the index.\n */\nexport function getString(index) {\n return STRINGS.get(index) || '';\n}\n/**\n * Stores a string for parsing from mutation\n * @param value string to store from background thread.\n */\nexport function storeString(value) {\n STRINGS.set(++count, value);\n}\n//# sourceMappingURL=strings.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getString } from './strings';\nlet NODES;\nlet BASE_ELEMENT;\nexport function prepare(baseElement) {\n NODES = new Map([[1, baseElement], [2, baseElement]]);\n BASE_ELEMENT = baseElement;\n}\nexport function isTextNode(node) {\n return ('nodeType' in node ? node.nodeType : node[0 /* nodeType */]) === 3 /* TEXT_NODE */;\n}\n/**\n * Create a real DOM Node from a skeleton Object (`{ nodeType, nodeName, attributes, children, data }`)\n * @example <caption>Text node</caption>\n * createNode({ nodeType:3, data:'foo' })\n * @example <caption>Element node</caption>\n * createNode({ nodeType:1, nodeName:'div', attributes:[{ name:'a', value:'b' }], childNodes:[ ... ] })\n */\nexport function createNode(skeleton) {\n if (isTextNode(skeleton)) {\n const node = document.createTextNode(getString(skeleton[5 /* textContent */]));\n storeNode(node, skeleton[7 /* _index_ */]);\n return node;\n }\n const namespace = skeleton[6 /* namespaceURI */] !== undefined ? getString(skeleton[6 /* namespaceURI */]) : undefined;\n const node = namespace\n ? document.createElementNS(namespace, getString(skeleton[1 /* nodeName */]))\n : document.createElement(getString(skeleton[1 /* nodeName */]));\n // TODO(KB): Restore Properties\n // skeleton.properties.forEach(property => {\n // node[`${property.name}`] = property.value;\n // });\n // ((skeleton as TransferrableElement)[TransferrableKeys.childNodes] || []).forEach(childNode => {\n // if (childNode[TransferrableKeys.transferred] === NumericBoolean.FALSE) {\n // node.appendChild(createNode(childNode as TransferrableNode));\n // }\n // });\n storeNode(node, skeleton[7 /* _index_ */]);\n return node;\n}\n/**\n * Returns the real DOM Element corresponding to a serialized Element object.\n * @param id\n * @return\n */\nexport function getNode(id) {\n const node = NODES.get(id);\n if (node && node.nodeName === 'BODY') {\n // If the node requested is the \"BODY\"\n // Then we return the base node this specific <amp-script> comes from.\n // This encapsulates each <amp-script> node.\n return BASE_ELEMENT;\n }\n return node;\n}\n/**\n * Establish link between DOM `node` and worker-generated identifier `id`.\n *\n * These _shouldn't_ collide between instances of <amp-script> since\n * each element creates it's own pool on both sides of the worker\n * communication bridge.\n * @param node\n * @param id\n */\nexport function storeNode(node, id) {\n node._index_ = id;\n NODES.set(id, node);\n}\n//# sourceMappingURL=nodes.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// TODO(KB): Fetch Polyfill for IE11.\nexport function createWorker(workerDomURL, authorScriptURL) {\n return Promise.all([fetch(workerDomURL).then(response => response.text()), fetch(authorScriptURL).then(response => response.text())])\n .then(([workerScript, authorScript]) => {\n // TODO(KB): Minify this output during build process.\n const keys = [];\n for (let key in document.body.style) {\n keys.push(`'${key}'`);\n }\n const code = `\n 'use strict';\n ${workerScript}\n (function() {\n var self = this;\n var window = this;\n var document = this.document;\n var localStorage = this.localStorage;\n var location = this.location;\n var defaultView = document.defaultView;\n var Node = defaultView.Node;\n var Text = defaultView.Text;\n var Element = defaultView.Element;\n var SVGElement = defaultView.SVGElement;\n var Document = defaultView.Document;\n var Event = defaultView.Event;\n var MutationObserver = defaultView.MutationObserver;\n\n function addEventListener(type, handler) {\n return document.addEventListener(type, handler);\n }\n function removeEventListener(type, handler) {\n return document.removeEventListener(type, handler);\n }\n this.appendKeys([${keys}]);\n ${authorScript}\n }).call(WorkerThread.workerDOM);\n//# sourceURL=${encodeURI(authorScriptURL)}`;\n return new Worker(URL.createObjectURL(new Blob([code])));\n })\n .catch(error => {\n return null;\n });\n}\nexport function messageToWorker(worker, message) {\n worker.postMessage(message);\n}\n//# sourceMappingURL=worker.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { messageToWorker } from './worker';\nimport { getNode } from './nodes';\nimport { getString } from './strings';\nconst KNOWN_LISTENERS = [];\n/**\n * Instead of a whitelist of elements that need their value tracked, use the existence\n * of a property called value to drive the decision.\n * @param node node to check if values should be tracked.\n * @return boolean if the node should have its value property tracked.\n */\nconst shouldTrackChanges = (node) => node && 'value' in node;\n/**\n * When a node that has a value needing synced doesn't already have an event listener\n * listening for changed values, ensure the value is synced with a default listener.\n * @param worker whom to dispatch value toward.\n * @param node node to listen to value changes on.\n */\nexport const applyDefaultChangeListener = (worker, node) => {\n shouldTrackChanges(node) && node.onchange === null && (node.onchange = () => fireValueChange(worker, node));\n};\n/**\n * Tell the worker DOM what the value is for a Node.\n * @param worker whom to dispatch value toward.\n * @param node where to get the value from.\n */\nconst fireValueChange = (worker, node) => {\n messageToWorker(worker, {\n [9 /* type */]: 5 /* SYNC */,\n [38 /* sync */]: {\n [7 /* _index_ */]: node._index_,\n [18 /* value */]: node.value,\n },\n });\n};\n/**\n * Register an event handler for dispatching events to worker thread\n * @param worker whom to dispatch events toward\n * @param _index_ node index the event comes from (used to dispatchEvent in worker thread).\n * @return eventHandler function consuming event and dispatching to worker thread\n */\nconst eventHandler = (worker, _index_) => (event) => {\n if (shouldTrackChanges(event.currentTarget)) {\n fireValueChange(worker, event.currentTarget);\n }\n messageToWorker(worker, {\n [9 /* type */]: 1 /* EVENT */,\n [37 /* event */]: {\n [7 /* _index_ */]: _index_,\n [22 /* bubbles */]: event.bubbles,\n [23 /* cancelable */]: event.cancelable,\n [24 /* cancelBubble */]: event.cancelBubble,\n [25 /* currentTarget */]: {\n [7 /* _index_ */]: event.currentTarget._index_,\n [8 /* transferred */]: 1 /* TRUE */,\n },\n [26 /* defaultPrevented */]: event.defaultPrevented,\n [27 /* eventPhase */]: event.eventPhase,\n [28 /* isTrusted */]: event.isTrusted,\n [29 /* returnValue */]: event.returnValue,\n [10 /* target */]: {\n [7 /* _index_ */]: event.target._index_,\n [8 /* transferred */]: 1 /* TRUE */,\n },\n [30 /* timeStamp */]: event.timeStamp,\n [9 /* type */]: event.type,\n [32 /* keyCode */]: 'keyCode' in event ? event.keyCode : undefined,\n },\n });\n};\n/**\n * Process commands transfered from worker thread to main thread.\n * @param nodesInstance nodes instance to execute commands against.\n * @param worker whom to dispatch events toward.\n * @param mutation mutation record containing commands to execute.\n */\nexport function process(worker, mutation) {\n const _index_ = mutation[10 /* target */];\n const target = getNode(_index_);\n (mutation[21 /* removedEvents */] || []).forEach(eventSub => {\n processListenerChange(worker, target, false, getString(eventSub[9 /* type */]), eventSub[33 /* index */]);\n });\n (mutation[20 /* addedEvents */] || []).forEach(eventSub => {\n processListenerChange(worker, target, true, getString(eventSub[9 /* type */]), eventSub[33 /* index */]);\n });\n}\n/**\n * If the worker requests to add an event listener to 'change' for something the foreground thread is already listening to\n * ensure that only a single 'change' event is attached to prevent sending values multiple times.\n * @param worker worker issuing listener changes\n * @param target node to change listeners on\n * @param addEvent is this an 'addEvent' or 'removeEvent' change\n * @param type event type requested to change\n * @param index number in the listeners array this event corresponds to.\n */\nexport function processListenerChange(worker, target, addEvent, type, index) {\n let changeEventSubscribed = target.onchange !== null;\n const shouldTrack = shouldTrackChanges(target);\n const isChangeEvent = type === 'change';\n if (addEvent) {\n if (isChangeEvent) {\n changeEventSubscribed = true;\n target.onchange = null;\n }\n target.addEventListener(type, (KNOWN_LISTENERS[index] = eventHandler(worker, target._index_)));\n }\n else {\n if (isChangeEvent) {\n changeEventSubscribed = false;\n }\n target.removeEventListener(type, KNOWN_LISTENERS[index]);\n }\n if (shouldTrack && !changeEventSubscribed) {\n applyDefaultChangeListener(worker, target);\n }\n}\n//# sourceMappingURL=command.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { storeNode, getNode, createNode, isTextNode } from './nodes';\nimport { storeString, getString } from './strings';\nimport { applyDefaultChangeListener, processListenerChange } from './command';\nfunction allTextNodes(nodes) {\n return nodes.length > 0 && [].every.call(nodes, isTextNode);\n}\n/**\n * Replace all the children with the ones from the HydrateableNode.\n * Used when we're certain the content won't break the page.\n * @param nodes HydrateableNodes containing content to potentially overwrite main thread content.\n * @param parent Node in the main thread that will be the parent of the passed nodes.\n * @param worker worker that issued the request for hydration.\n */\nfunction replaceNodes(nodes, parent, worker) {\n [].forEach.call(parent.childNodes, (childNode) => childNode.remove());\n nodes.forEach((node, index) => {\n const newNode = createNode(node);\n (node[2 /* attributes */] || []).forEach(attribute => {\n const namespaceURI = getString(attribute[0]);\n if (namespaceURI !== 'null') {\n newNode.setAttributeNS(namespaceURI, getString(attribute[1]), getString(attribute[2]));\n }\n else {\n newNode.setAttribute(getString(attribute[1]), getString(attribute[2]));\n }\n });\n parent.appendChild(newNode);\n applyDefaultChangeListener(worker, newNode);\n replaceNodes(node[4 /* childNodes */] || [], parent.childNodes[index], worker);\n });\n}\n/**\n * Hydrate a single node and it's children safely.\n * Attempt to ensure content is a rough match so content doesn't shift between the document representation\n * and client side generated content.\n * @param transferNode root of the background thread content (document.body from worker-thread).\n * @param node root for the foreground thread content (element upgraded to background driven).\n * @param worker worker that issued the request for hydration.\n */\nfunction hydrateNode(transferNode, node, worker) {\n const transferIsText = isTextNode(transferNode);\n const nodeIsText = isTextNode(node);\n if (!transferIsText && !nodeIsText) {\n const childNodes = transferNode[4 /* childNodes */] || [];\n if (childNodes.length !== node.childNodes.length) {\n // If this parent node has an unequal number of childNodes, we need to ensure its for an allowable reason.\n if (allTextNodes(childNodes) && allTextNodes(node.childNodes)) {\n // Offset due to a differing number of text nodes.\n // replace the current DOM with the text nodes from the hydration.\n replaceNodes(childNodes, node, worker);\n }\n else {\n const filteredTransfer = childNodes.filter(childNode => !isTextNode(childNode));\n const filteredNodes = [].filter.call(node.childNodes, (childNode) => !isTextNode(childNode));\n // Empty text nodes are used by frameworks as placeholders for future dom content.\n if (filteredTransfer.length === filteredNodes.length) {\n storeNode(node, transferNode[7 /* _index_ */]);\n replaceNodes(childNodes, node, worker);\n }\n }\n }\n else {\n storeNode(node, transferNode[7 /* _index_ */]);\n applyDefaultChangeListener(worker, node);\n // Same number of children, hydrate them.\n childNodes.forEach((childNode, index) => hydrateNode(childNode, node.childNodes[index], worker));\n }\n }\n else if (transferIsText && nodeIsText) {\n // Singular text node, no children.\n storeNode(node, transferNode[7 /* _index_ */]);\n node.textContent = getString(transferNode[5 /* textContent */]);\n applyDefaultChangeListener(worker, node);\n }\n}\n/**\n * Hydrate a root from the worker thread by comparing with the main thread representation.\n * @param skeleton root of the background thread content.\n * @param addEvents events needing subscription from the background thread content.\n * @param baseElement root of the main thread content to compare against.\n * @param worker worker issuing the upgrade request.\n */\nexport function hydrate(skeleton, stringValues, addEvents, baseElement, worker) {\n // Process String Additions\n stringValues.forEach(value => storeString(value));\n // Process Node Addition / Removal\n hydrateNode(skeleton, baseElement, worker);\n // Process Event Addition\n addEvents.forEach(event => {\n const node = getNode(event[7 /* _index_ */]);\n node && processListenerChange(worker, node, true, getString(event[9 /* type */]), event[33 /* index */]);\n });\n}\n//# sourceMappingURL=hydrator.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNode, createNode } from './nodes';\nimport { storeString, getString } from './strings';\nimport { process } from './command';\nlet MUTATION_QUEUE = [];\nlet PENDING_MUTATIONS = false;\nlet worker;\nexport function prepareMutate(passedWorker) {\n worker = passedWorker;\n}\nconst mutators = {\n [2 /* CHILD_LIST */](mutation, target, sanitizer) {\n (mutation[12 /* removedNodes */] || []).forEach(node => getNode(node[7 /* _index_ */]).remove());\n const addedNodes = mutation[11 /* addedNodes */];\n const nextSibling = mutation[14 /* nextSibling */];\n if (addedNodes) {\n addedNodes.forEach(node => {\n let newChild = getNode(node[7 /* _index_ */]);\n if (!newChild) {\n newChild = createNode(node);\n if (sanitizer) {\n sanitizer.sanitize(newChild); // TODO(choumx): Inform worker?\n }\n }\n target.insertBefore(newChild, (nextSibling && getNode(nextSibling[7 /* _index_ */])) || null);\n });\n }\n },\n [0 /* ATTRIBUTES */](mutation, target, sanitizer) {\n const attributeName = mutation[15 /* attributeName */] !== undefined ? getString(mutation[15 /* attributeName */]) : null;\n const value = mutation[18 /* value */] !== undefined ? getString(mutation[18 /* value */]) : null;\n if (attributeName != null && value != null) {\n if (!sanitizer || sanitizer.validAttribute(target.nodeName, attributeName, value)) {\n target.setAttribute(attributeName, value);\n }\n else {\n // TODO(choumx): Inform worker?\n }\n }\n },\n [1 /* CHARACTER_DATA */](mutation, target) {\n const value = mutation[18 /* value */];\n if (value) {\n // Sanitization not necessary for textContent.\n target.textContent = getString(value);\n }\n },\n [3 /* PROPERTIES */](mutation, target, sanitizer) {\n const propertyName = mutation[17 /* propertyName */] !== undefined ? getString(mutation[17 /* propertyName */]) : null;\n const value = mutation[18 /* value */] !== undefined ? getString(mutation[18 /* value */]) : null;\n if (propertyName && value) {\n if (!sanitizer || sanitizer.validProperty(target.nodeName, propertyName, value)) {\n target[propertyName] = value;\n }\n else {\n // TODO(choumx): Inform worker?\n }\n }\n },\n [4 /* COMMAND */](mutation) {\n process(worker, mutation);\n },\n};\n/**\n * Process MutationRecords from worker thread applying changes to the existing DOM.\n * @param nodes New nodes to add in the main thread with the incoming mutations.\n * @param mutations Changes to apply in both graph shape and content of Elements.\n * @param sanitizer Sanitizer to apply to content if needed.\n */\nexport function mutate(nodes, stringValues, mutations, sanitizer) {\n //mutations: TransferrableMutationRecord[]): void {\n // TODO(KB): Restore signature requiring lastMutationTime. (lastGestureTime: number, mutations: TransferrableMutationRecord[])\n // if (performance.now() || Date.now() - lastGestureTime > GESTURE_TO_MUTATION_THRESHOLD) {\n // return;\n // }\n // this.lastGestureTime = lastGestureTime;\n stringValues.forEach(value => storeString(value));\n nodes.forEach(node => createNode(node));\n MUTATION_QUEUE = MUTATION_QUEUE.concat(mutations);\n if (!PENDING_MUTATIONS) {\n PENDING_MUTATIONS = true;\n requestAnimationFrame(() => syncFlush(sanitizer));\n }\n}\n/**\n * Apply all stored mutations syncronously. This method works well, but can cause jank if there are too many\n * mutations to apply in a single frame.\n *\n * Investigations in using asyncFlush to resolve are worth considering.\n */\nfunction syncFlush(sanitizer) {\n MUTATION_QUEUE.forEach(mutation => {\n mutators[mutation[9 /* type */]](mutation, getNode(mutation[10 /* target */]), sanitizer);\n });\n MUTATION_QUEUE = [];\n PENDING_MUTATIONS = false;\n}\n//# sourceMappingURL=mutator.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { hydrate } from './hydrator';\nimport { prepareMutate, mutate } from './mutator';\nimport { createWorker } from './worker';\nimport { prepare as prepareNodes } from './nodes';\nexport function install(baseElement, workerDOMUrl, sanitizer) {\n const authorURL = baseElement.getAttribute('src');\n if (authorURL === null) {\n return;\n }\n createWorker(workerDOMUrl, authorURL).then(worker => {\n if (worker === null) {\n return;\n }\n prepareNodes(baseElement);\n prepareMutate(worker);\n worker.onmessage = ({ data }) => {\n switch (data[9 /* type */]) {\n case 2 /* HYDRATE */:\n // console.info(`hydration from worker: ${data.type}`, data);\n hydrate(data[35 /* nodes */], data[39 /* strings */], data[20 /* addedEvents */], baseElement, worker);\n break;\n case 3 /* MUTATE */:\n // console.info(`mutation from worker: ${data.type}`, data);\n mutate(data[35 /* nodes */], data[39 /* strings */], data[34 /* mutations */], sanitizer);\n break;\n }\n };\n });\n}\n//# sourceMappingURL=install.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport purify from 'dompurify';\nconst propertyToAttribute = {}; // TODO(choumx): Fill this in.\nexport class DOMPurifySanitizer {\n /**\n * @param node\n */\n sanitize(node) {\n purify.sanitize(node, { IN_PLACE: true });\n }\n /**\n * @param tag\n * @param attr\n * @param value\n */\n validAttribute(tag, attr, value) {\n return purify.isValidAttribute(tag, attr, value);\n }\n /**\n * @param tag\n * @param prop\n * @param value\n */\n validProperty(tag, prop, value) {\n const attr = propertyToAttribute[prop];\n if (attr) {\n return this.validAttribute(tag, attr, value);\n }\n else {\n return this.validAttribute(tag, prop, value);\n }\n }\n}\n//# sourceMappingURL=DOMPurifySanitizer.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DOMPurifySanitizer } from './DOMPurifySanitizer';\nimport { install } from './install';\nexport function upgradeElement(baseElement, workerDOMUrl) {\n install(baseElement, workerDOMUrl, new DOMPurifySanitizer());\n}\n//# sourceMappingURL=index.safe.js.map"],"names":["addToSet","set","array","l","length","toLowerCase","clone","object","newObject","property","Object","prototype","hasOwnProperty","call","_toConsumableArray","arr","Array","isArray","i","arr2","from","createDOMPurify","window","arguments","undefined","DOMPurify","root","version","removed","document","nodeType","isSupported","originalDocument","useDOMParser","removeTitle","DocumentFragment","Node","NodeFilter","_window$NamedNodeMap","NamedNodeMap","MozNamedAttrMap","Text","Comment","DOMParser","HTMLTemplateElement","template","createElement","content","ownerDocument","_document","implementation","createNodeIterator","getElementsByTagName","createDocumentFragment","importNode","hooks","createHTMLDocument","documentMode","MUSTACHE_EXPR$$1","MUSTACHE_EXPR","ERB_EXPR$$1","ERB_EXPR","DATA_ATTR$$1","DATA_ATTR","ARIA_ATTR$$1","ARIA_ATTR","IS_SCRIPT_OR_DATA$$1","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE$$1","ATTR_WHITESPACE","IS_ALLOWED_URI$$1","IS_ALLOWED_URI","ALLOWED_TAGS","DEFAULT_ALLOWED_TAGS","concat","html","svg","svgFilters","mathMl","text","ALLOWED_ATTR","DEFAULT_ALLOWED_ATTR","html$1","svg$1","mathMl$1","xml","FORBID_TAGS","FORBID_ATTR","ALLOW_ARIA_ATTR","ALLOW_DATA_ATTR","ALLOW_UNKNOWN_PROTOCOLS","SAFE_FOR_JQUERY","SAFE_FOR_TEMPLATES","WHOLE_DOCUMENT","SET_CONFIG","FORCE_BODY","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_DOM_IMPORT","SANITIZE_DOM","KEEP_CONTENT","IN_PLACE","USE_PROFILES","FORBID_CONTENTS","DATA_URI_TAGS","URI_SAFE_ATTRIBUTES","CONFIG","formElement","_parseConfig","cfg","_typeof","ALLOWED_URI_REGEXP","ADD_TAGS","ADD_ATTR","ADD_URI_SAFE_ATTR","table","freeze","_forceRemove","node","push","element","parentNode","removeChild","err","outerHTML","_removeAttribute","name","attribute","getAttributeNode","removeAttribute","_initDocument","dirty","doc","parseFromString","documentElement","body","firstElementChild","querySelector","textContent","match","_createIterator","SHOW_ELEMENT","SHOW_COMMENT","SHOW_TEXT","FILTER_ACCEPT","_isNode","obj","nodeName","_executeHook","entryPoint","currentNode","data","forEach","hook","_sanitizeElements","attributes","setAttribute","tagName","allowedTags","insertAdjacentHTML","innerHTML","test","cloneNode","replace","_isValidAttribute","lcTag","lcName","value","indexOf","_sanitizeAttributes","attr","hookEvent","attrName","attrValue","keepAttr","allowedAttributes","_attr","namespaceURI","trim","id","idAttr","slice","apply","setAttributeNS","pop","_sanitizeShadowDOM","fragment","shadowNode","shadowIterator","nextNode","sanitize","DOMPurify.sanitize","oldNode","toString","TypeError","toStaticHTML","importedNode","appendChild","firstChild","nodeIterator","returnNode","setConfig","DOMPurify.setConfig","clearConfig","DOMPurify.clearConfig","isValidAttribute","DOMPurify.isValidAttribute","tag","addHook","DOMPurify.addHook","hookFunction","removeHook","DOMPurify.removeHook","removeHooks","DOMPurify.removeHooks","removeAllHooks","DOMPurify.removeAllHooks","getString","index","STRINGS","get","prepare","baseElement","NODES","Map","BASE_ELEMENT","isTextNode","createNode","skeleton","_node","createTextNode","storeNode","namespace","createElementNS","getNode","_index_","createWorker","workerDomURL","authorScriptURL","Promise","all","fetch","then","response","workerScript","authorScript","keys","key","style","code","encodeURI","Worker","URL","createObjectURL","Blob","catch","error","process","worker","mutation","target","eventSub","processListenerChange","addEvent","type","changeEventSubscribed","onchange","shouldTrack","shouldTrackChanges","isChangeEvent","addEventListener","KNOWN_LISTENERS","eventHandler","removeEventListener","applyDefaultChangeListener","allTextNodes","nodes","every","replaceNodes","parent","childNodes","childNode","remove","newNode","hydrateNode","transferNode","transferIsText","nodeIsText","filteredTransfer","filter","filteredNodes","hydrate","stringValues","addEvents","count","event","mutate","mutations","sanitizer","MUTATION_QUEUE","PENDING_MUTATIONS","requestAnimationFrame","syncFlush","mutators","install","workerDOMUrl","authorURL","getAttribute","prepareNodes","onmessage","worker.onmessage","Symbol","iterator","constructor","purify","propertyToAttribute","DOMPurifySanitizer","prop","validAttribute","node.onchange","fireValueChange","postMessage","message","currentTarget","bubbles","cancelable","cancelBubble","defaultPrevented","eventPhase","isTrusted","returnValue","timeStamp","keyCode","addedNodes","nextSibling","newChild","insertBefore","attributeName","propertyName","validProperty","upgradeElement"],"mappings":"wCAoBAA,QAASA,EAAQ,CAACC,CAAD,CAAMC,CAA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B,CADgE,GApD9D4C,mBGdAqC,QAAA,CAAyBtH,CAAzB,CAA+CmF,CAA/C,CAAmE,CACvED,EAAA,CAAQlF,CAAR,CAAoCmF,CAApC,CAAkD,IAAIW,EAAtD,CADuE;"} \ No newline at end of file diff --git a/dist/index.safe.mjs b/dist/index.safe.mjs deleted file mode 100644 index 185dfad3d..000000000 --- a/dist/index.safe.mjs +++ /dev/null @@ -1,34 +0,0 @@ -var aa="a abbr acronym address area article aside audio b bdi bdo big blink blockquote body br button canvas caption center cite code col colgroup content data datalist dd decorator del details dfn dir div dl dt element em fieldset figcaption figure font footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i img input ins kbd label legend li main map mark marquee menu menuitem meter nav nobr ol optgroup option output p pre progress q rp rt ruby s samp section select shadow small source spacer span strike strong style sub summary sup table tbody td template textarea tfoot th thead time tr track tt u ul var video wbr".split(" "), -ba="svg a altglyph altglyphdef altglyphitem animatecolor animatemotion animatetransform audio canvas circle clippath defs desc ellipse filter font g glyph glyphref hkern image line lineargradient marker mask metadata mpath path pattern polygon polyline radialgradient rect stop style switch symbol text textpath title tref tspan video view vkern".split(" "),ca="feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile feTurbulence".split(" "), -da="math menclose merror mfenced mfrac mglyph mi mlabeledtr mmuliscripts mn mo mover mpadded mphantom mroot mrow ms mpspace msqrt mystyle msub msup msubsup mtable mtd mtext mtr munder munderover".split(" "),ea=["#text"],fa="accept action align alt autocomplete background bgcolor border cellpadding cellspacing checked cite class clear color cols colspan coords crossorigin datetime default dir disabled download enctype face for headers height hidden high href hreflang id integrity ismap label lang list loop low max maxlength media method min multiple name noshade novalidate nowrap open optimum pattern placeholder poster preload pubdate radiogroup readonly rel required rev reversed role rows rowspan spellcheck scope selected shape size sizes span srclang start src srcset step style summary tabindex title type usemap valign value width xmlns".split(" "), -e="accent-height accumulate additivive alignment-baseline ascent attributename attributetype azimuth basefrequency baseline-shift begin bias by class clip clip-path clip-rule color color-interpolation color-interpolation-filters color-profile color-rendering cx cy d dx dy diffuseconstant direction display divisor dur edgemode elevation end fill fill-opacity fill-rule filter flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight fx fy g1 g2 glyph-name glyphref gradientunits gradienttransform height href id image-rendering in in2 k k1 k2 k3 k4 kerning keypoints keysplines keytimes lang lengthadjust letter-spacing kernelmatrix kernelunitlength lighting-color local marker-end marker-mid marker-start markerheight markerunits markerwidth maskcontentunits maskunits max mask media method mode min name numoctaves offset operator opacity order orient orientation origin overflow paint-order path pathlength patterncontentunits patterntransform patternunits points preservealpha preserveaspectratio r rx ry radius refx refy repeatcount repeatdur restart result rotate scale seed shape-rendering specularconstant specularexponent spreadmethod stddeviation stitchtiles stop-color stop-opacity stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke stroke-width style surfacescale tabindex targetx targety transform text-anchor text-decoration text-rendering textlength type u1 u2 unicode values viewbox visibility vert-adv-y vert-origin-x vert-origin-y width word-spacing wrap writing-mode xchannelselector ychannelselector x x1 x2 xmlns y y1 y2 z zoomandpan".split(" "), -ha="accent accentunder align bevelled close columnsalign columnlines columnspan denomalign depth dir display displaystyle fence frame height href id largeop length linethickness lspace lquote mathbackground mathcolor mathsize mathvariant maxsize minsize movablelimits notation numalign open rowalign rowlines rowspacing rowspan rspace rquote scriptlevel scriptminsize scriptsizemultiplier selection separator separators stretchy subscriptshift supscriptshift symmetric voffset width xmlns".split(" "), -n=["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"];function u(a,b){for(var c=b.length;c--;)"string"===typeof b[c]&&(b[c]=b[c].toLowerCase()),a[b[c]]=!0;return a}function ia(a){var b={},c=void 0;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b} -var ja=/\{\{[\s\S]*|[\s\S]*\}\}/gm,ka=/<%[\s\S]*|[\s\S]*%>/gm,la=/^data-[\-\w.\u00B7-\uFFFF]/,ma=/^aria-[\-\w]+$/,na=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,oa=/^(?:\w+script|data):/i,pa=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,z="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"===typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}; -function A(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)} -function qa(){function a(a){var t,c;d("beforeSanitizeAttributes",a,null);var p=a.attributes;if(p){var f={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:m};for(c=p.length;c--;){var r=t=p[c],g=r.name;r=r.namespaceURI;t=t.value.trim();var h=g.toLowerCase();f.attrName=h;f.attrValue=t;f.keepAttr=!0;d("uponSanitizeAttribute",a,f);t=f.attrValue;if("name"===h&&"IMG"===a.nodeName&&p.id){var q=p.id;p=Array.prototype.slice.apply(p);w("id",a);w(g,a);p.indexOf(q)>c&&a.setAttribute("id",q.value)}else if("INPUT"!== -a.nodeName||"type"!==h||"file"!==t||!m[h]&&P[h])"id"===g&&a.setAttribute(g,""),w(g,a);else continue;if(f.keepAttr&&(q=a.nodeName.toLowerCase(),b(q,h,t)))try{r?a.setAttributeNS(r,g,t):a.setAttribute(g,t),k.removed.pop()}catch(nb){}}d("afterSanitizeAttributes",a,null)}}function b(a,b,c){if(ta&&("id"===b||"name"===b)&&(c in x||c in Qa))return!1;G&&(c=c.replace(ja," "),c=c.replace(ka," "));if(!Q||!la.test(b))if(!ua||!ma.test(b))if(!m[b]||P[b]||!(va[b]||R.test(c.replace(pa,""))||("src"===b||"xlink:href"=== -b)&&"script"!==a&&0===c.indexOf("data:")&&Ra[a]||wa&&!oa.test(c.replace(pa,"")))&&c)return!1;return!0}function c(a){d("beforeSanitizeElements",a,null);var b=a instanceof Sa||a instanceof Ta?!1:"string"===typeof a.nodeName&&"string"===typeof a.textContent&&"function"===typeof a.removeChild&&a.attributes instanceof Ua&&"function"===typeof a.removeAttribute&&"function"===typeof a.setAttribute?!1:!0;if(b)return S(a),!0;b=a.nodeName.toLowerCase();d("uponSanitizeElement",a,{tagName:b,allowedTags:h});if(!h[b]|| -T[b]){if(U&&!Va[b]&&"function"===typeof a.insertAdjacentHTML)try{a.insertAdjacentHTML("AfterEnd",a.innerHTML)}catch(O){}S(a);return!0}!xa||a.firstElementChild||a.content&&a.content.firstElementChild||!/</g.test(a.textContent)||(k.removed.push({element:a.cloneNode()}),a.innerHTML=a.innerHTML?a.innerHTML.replace(/</g,"<"):a.textContent.replace(/</g,"<"));G&&3===a.nodeType&&(b=a.textContent,b=b.replace(ja," "),b=b.replace(ka," "),a.textContent!==b&&(k.removed.push({element:a.cloneNode()}),a.textContent= -b));d("afterSanitizeElements",a,null);return!1}function d(a,b,c){v[a]&&v[a].forEach(function(a){a.call(k,b,c,H)})}function f(a){return"object"===("undefined"===typeof I?"undefined":z(I))?a instanceof I:a&&"object"===("undefined"===typeof a?"undefined":z(a))&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName}function p(a){return Wa.call(a.ownerDocument||a,a,J.SHOW_ELEMENT|J.SHOW_COMMENT|J.SHOW_TEXT,function(){return J.FILTER_ACCEPT},!1)}function r(a){var b=void 0;V&&(a="<remove></remove>"+ -a);if(ya)try{b=(new Xa).parseFromString(a,"text/html")}catch(mb){}za&&u(T,["title"]);if(!b||!b.documentElement){b=W.createHTMLDocument("");var c=b.body;c.parentNode.removeChild(c.parentNode.firstElementChild);c.outerHTML=a}return Ya.call(b,B?"html":"body")[0]}function w(a,b){try{k.removed.push({attribute:b.getAttributeNode(a),from:b})}catch(O){k.removed.push({attribute:null,from:b})}b.removeAttribute(a)}function S(a){k.removed.push({element:a});try{a.parentNode.removeChild(a)}catch(l){a.outerHTML= -""}}function X(a){"object"!==("undefined"===typeof a?"undefined":z(a))&&(a={});h="ALLOWED_TAGS"in a?u({},a.ALLOWED_TAGS):Aa;m="ALLOWED_ATTR"in a?u({},a.ALLOWED_ATTR):Ba;T="FORBID_TAGS"in a?u({},a.FORBID_TAGS):{};P="FORBID_ATTR"in a?u({},a.FORBID_ATTR):{};y="USE_PROFILES"in a?a.USE_PROFILES:!1;ua=!1!==a.ALLOW_ARIA_ATTR;Q=!1!==a.ALLOW_DATA_ATTR;wa=a.ALLOW_UNKNOWN_PROTOCOLS||!1;xa=a.SAFE_FOR_JQUERY||!1;G=a.SAFE_FOR_TEMPLATES||!1;B=a.WHOLE_DOCUMENT||!1;C=a.RETURN_DOM||!1;Y=a.RETURN_DOM_FRAGMENT||!1;Ca= -a.RETURN_DOM_IMPORT||!1;V=a.FORCE_BODY||!1;ta=!1!==a.SANITIZE_DOM;U=!1!==a.KEEP_CONTENT;K=a.IN_PLACE||!1;R=a.ALLOWED_URI_REGEXP||R;G&&(Q=!1);Y&&(C=!0);y&&(h=u({},[].concat(A(ea))),m=[],!0===y.html&&(u(h,aa),u(m,fa)),!0===y.svg&&(u(h,ba),u(m,e),u(m,n)),!0===y.svgFilters&&(u(h,ca),u(m,e),u(m,n)),!0===y.mathMl&&(u(h,da),u(m,ha),u(m,n)));a.ADD_TAGS&&(h===Aa&&(h=ia(h)),u(h,a.ADD_TAGS));a.ADD_ATTR&&(m===Ba&&(m=ia(m)),u(m,a.ADD_ATTR));a.ADD_URI_SAFE_ATTR&&u(va,a.ADD_URI_SAFE_ATTR);U&&(h["#text"]=!0);B&& -u(h,["html","head","body"]);h.table&&u(h,["tbody"]);Object&&"freeze"in Object&&Object.freeze(a);H=a}function k(a){return qa(a)}var g=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"undefined"===typeof window?null:window;k.version="1.0.8";k.removed=[];if(!g||!g.document||9!==g.document.nodeType)return k.isSupported=!1,k;var Da=g.document,ya=!1,za=!1,x=g.document,Ea=g.DocumentFragment,I=g.Node,J=g.NodeFilter,q=g.NamedNodeMap,Ua=void 0===q?g.NamedNodeMap||g.MozNamedAttrMap:q,Sa=g.Text,Ta=g.Comment, -Xa=g.DOMParser;"function"===typeof g.HTMLTemplateElement&&(q=x.createElement("template"),q.content&&q.content.ownerDocument&&(x=q.content.ownerDocument));q=x;var W=q.implementation,Wa=q.createNodeIterator,Ya=q.getElementsByTagName,Za=q.createDocumentFragment,$a=Da.importNode,v={};k.isSupported=W&&"undefined"!==typeof W.createHTMLDocument&&9!==x.documentMode;var R=na,h=null,Aa=u({},[].concat(A(aa),A(ba),A(ca),A(da),A(ea))),m=null,Ba=u({},[].concat(A(fa),A(e),A(ha),A(n))),T=null,P=null,ua=!0,Q=!0,wa= -!1,xa=!1,G=!1,B=!1,Z=!1,V=!1,C=!1,Y=!1,Ca=!1,ta=!0,U=!0,K=!1,y={},Va=u({},"audio head math script style template svg video".split(" ")),Ra=u({},["audio","video","img","source","image"]),va=u({},"alt class for id label name pattern placeholder summary title value style xmlns".split(" ")),H=null,Qa=x.createElement("form");if(k.isSupported){try{r('<svg><p><style><img src="</style><img src=x onerror=alert(1)//">').querySelector("svg img")&&(ya=!0)}catch(t){}try{r("<x/><title></title><img>").querySelector("title").textContent.match(/<\/title/)&& -(za=!0)}catch(t){}}var ab=function O(b){var l,f=p(b);for(d("beforeSanitizeShadowDOM",b,null);l=f.nextNode();)d("uponSanitizeShadowNode",l,null),c(l)||(l.content instanceof Ea&&O(l.content),a(l));d("afterSanitizeShadowDOM",b,null)};k.sanitize=function(b,d){var l=void 0,h=void 0;b||(b="\x3c!--\x3e");if("string"!==typeof b&&!f(b)){if("function"!==typeof b.toString)throw new TypeError("toString is not a function");b=b.toString();if("string"!==typeof b)throw new TypeError("dirty is not a string, aborting"); -}if(!k.isSupported){if("object"===z(g.toStaticHTML)||"function"===typeof g.toStaticHTML){if("string"===typeof b)return g.toStaticHTML(b);if(f(b))return g.toStaticHTML(b.outerHTML)}return b}Z||X(d);k.removed=[];if(!K)if(b instanceof I)l=r("\x3c!--\x3e"),d=l.ownerDocument.importNode(b,!0),1===d.nodeType&&"BODY"===d.nodeName?l=d:l.appendChild(d);else{if(!C&&!B&&-1===b.indexOf("<"))return b;l=r(b);if(!l)return C?null:""}l&&V&&S(l.firstChild);for(var m=p(K?b:l);d=m.nextNode();)3===d.nodeType&&d===h||c(d)|| -(d.content instanceof Ea&&ab(d.content),a(d),h=d);if(K)return b;if(C){if(Y)for(b=Za.call(l.ownerDocument);l.firstChild;)b.appendChild(l.firstChild);else b=l;Ca&&(b=$a.call(Da,b,!0));return b}return B?l.outerHTML:l.innerHTML};k.setConfig=function(a){X(a);Z=!0};k.clearConfig=function(){H=null;Z=!1};k.isValidAttribute=function(a,c,d){H||X({});a=a.toLowerCase();c=c.toLowerCase();return b(a,c,d)};k.addHook=function(a,b){"function"===typeof b&&(v[a]=v[a]||[],v[a].push(b))};k.removeHook=function(a){v[a]&& -v[a].pop()};k.removeHooks=function(a){v[a]&&(v[a]=[])};k.removeAllHooks=function(){v={}};return k}var ra=qa();const sa={};class Fa{sanitize(a){ra.sanitize(a,{IN_PLACE:!0})}validAttribute(a,b,c){return ra.isValidAttribute(a,b,c)}validProperty(a,b,c){const d=sa[b];return d?this.validAttribute(a,d,c):this.validAttribute(a,b,c)}}let Ga=0;const Ha=new Map;function D(a){return Ha.get(a)||""}let Ia,Ja;function Ka(a){Ia=new Map([[1,a],[2,a]]);Ja=a} -function E(a){return 3===("nodeType"in a?a.nodeType:a[0])}function La(a){if(E(a)){var b=document.createTextNode(D(a[5]));F(b,a[7]);return b}b=(b=void 0!==a[6]?D(a[6]):void 0)?document.createElementNS(b,D(a[1])):document.createElement(D(a[1]));F(b,a[7]);return b}function L(a){return(a=Ia.get(a))&&"BODY"===a.nodeName?Ja:a}function F(a,b){a._index_=b;Ia.set(b,a)} -function Ma(a,b){return Promise.all([fetch(a).then((a)=>a.text()),fetch(b).then((a)=>a.text())]).then(([a,d])=>{const c=[];for(let a in document.body.style)c.push(`'${a}'`);a=`\n 'use strict';\n ${a}\n (function() {\n var self = this;\n var window = this;\n var document = this.document;\n var localStorage = this.localStorage;\n var location = this.location;\n var defaultView = document.defaultView;\n var Node = defaultView.Node;\n var Text = defaultView.Text;\n var Element = defaultView.Element;\n var SVGElement = defaultView.SVGElement;\n var Document = defaultView.Document;\n var Event = defaultView.Event;\n var MutationObserver = defaultView.MutationObserver;\n\n function addEventListener(type, handler) {\n return document.addEventListener(type, handler);\n }\n function removeEventListener(type, handler) {\n return document.removeEventListener(type, handler);\n }\n this.appendKeys([${c}]);\n ${d}\n }).call(WorkerThread.workerDOM);\n//# sourceURL=${encodeURI(b)}`; -return new Worker(URL.createObjectURL(new Blob([a])))}).catch(()=>null)} -const Na=[],M=(a,b)=>{b&&"value"in b&&null===b.onchange&&(b.onchange=()=>{a.postMessage({9:5,38:{7:b._index_,18:b.value}})})},Oa=(a,b)=>(c)=>{var d=c.currentTarget;d&&"value"in d&&(d=c.currentTarget,a.postMessage({9:5,38:{7:d._index_,18:d.value}}));a.postMessage({9:1,37:{7:b,22:c.bubbles,23:c.cancelable,24:c.cancelBubble,25:{7:c.currentTarget._index_,8:1},26:c.defaultPrevented,27:c.eventPhase,28:c.isTrusted,29:c.returnValue,10:{7:c.target._index_,8:1}, -30:c.timeStamp,9:c.type,32:"keyCode"in c?c.keyCode:void 0}})};function Pa(a,b){const c=L(b[10]);(b[21]||[]).forEach((b)=>{bb(a,c,!1,D(b[9]),b[33])});(b[20]||[]).forEach((b)=>{bb(a,c,!0,D(b[9]),b[33])})}function bb(a,b,c,d,f){let p=null!==b.onchange;const r=b&&"value"in b,w="change"===d;c?(w&&(p=!0,b.onchange=null),b.addEventListener(d,Na[f]=Oa(a,b._index_))):(w&&(p=!1),b.removeEventListener(d,Na[f]));r&&!p&&M(a,b)}function cb(a){return 0<a.length&&[].every.call(a,E)} -function db(a,b,c){[].forEach.call(b.childNodes,(a)=>a.remove());a.forEach((a,f)=>{const d=La(a);(a[2]||[]).forEach((a)=>{const b=D(a[0]);"null"!==b?d.setAttributeNS(b,D(a[1]),D(a[2])):d.setAttribute(D(a[1]),D(a[2]))});b.appendChild(d);M(c,d);db(a[4]||[],b.childNodes[f],c)})} -function eb(a,b,c){var d=E(a),f=E(b);if(d||f)d&&f&&(F(b,a[7]),b.textContent=D(a[5]),M(c,b));else if(d=a[4]||[],d.length!==b.childNodes.length)if(cb(d)&&cb(b.childNodes))db(d,b,c);else{f=d.filter((a)=>!E(a));const p=[].filter.call(b.childNodes,(a)=>!E(a));f.length===p.length&&(F(b,a[7]),db(d,b,c))}else F(b,a[7]),M(c,b),d.forEach((a,d)=>eb(a,b.childNodes[d],c))}function fb(a,b,c,d,f){b.forEach((a)=>{Ha.set(++Ga,a)});eb(a,d,f);c.forEach((a)=>{const b=L(a[7]);b&&bb(f,b,!0,D(a[9]),a[33])})} -let N=[],gb=!1,hb; -const ib={2(a,b,c){(a[12]||[]).forEach((a)=>L(a[7]).remove());const d=a[11],f=a[14];d&&d.forEach((a)=>{let d=L(a[7]);d||(d=La(a),c&&c.sanitize(d));b.insertBefore(d,f&&L(f[7])||null)})},0(a,b,c){const d=void 0!==a[15]?D(a[15]):null;a=void 0!==a[18]?D(a[18]):null;null==d||null==a||c&&!c.validAttribute(b.nodeName,d,a)||b.setAttribute(d,a)},1(a,b){if(a=a[18])b.textContent=D(a)},3(a,b,c){const d=void 0!==a[17]?D(a[17]):null;a=void 0!==a[18]?D(a[18]):null;d&&a&&(!c||c.validProperty(b.nodeName,d, -a))&&(b[d]=a)},4(a){Pa(hb,a)}};function jb(a,b,c,d){b.forEach((a)=>{Ha.set(++Ga,a)});a.forEach((a)=>La(a));N=N.concat(c);gb||(gb=!0,requestAnimationFrame(()=>kb(d)))}function kb(a){N.forEach((b)=>{ib[b[9]](b,L(b[10]),a)});N=[];gb=!1}function lb(a,b,c){const d=a.getAttribute("src");null!==d&&Ma(b,d).then((b)=>{null!==b&&(Ka(a),hb=b,b.onmessage=({data:d})=>{switch(d[9]){case 2:fb(d[35],d[39],d[20],a,b);break;case 3:jb(d[35],d[39],d[34],c)}})})}var upgradeElement=function(a,b){lb(a,b,new Fa)};export{upgradeElement}; -//# sourceMappingURL=index.safe.mjs.map diff --git a/dist/index.safe.mjs.map b/dist/index.safe.mjs.map deleted file mode 100644 index 3debf73f9..000000000 --- a/dist/index.safe.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.safe.mjs","sources":["../node_modules/dompurify/dist/purify.es.js","../output/main-thread/DOMPurifySanitizer.js","../output/main-thread/strings.js","../output/main-thread/nodes.js","../output/main-thread/worker.js","../output/main-thread/command.js","../output/main-thread/hydrator.js","../output/main-thread/mutator.js","../output/main-thread/install.js","../output/main-thread/index.safe.js"],"sourcesContent":["var html = ['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr'];\n\n// SVG\nvar svg = ['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'audio', 'canvas', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'video', 'view', 'vkern'];\n\nvar svgFilters = ['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence'];\n\nvar mathMl = ['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmuliscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mpspace', 'msqrt', 'mystyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover'];\n\nvar text = ['#text'];\n\nvar html$1 = ['accept', 'action', 'align', 'alt', 'autocomplete', 'background', 'bgcolor', 'border', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'coords', 'crossorigin', 'datetime', 'default', 'dir', 'disabled', 'download', 'enctype', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'integrity', 'ismap', 'label', 'lang', 'list', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'multiple', 'name', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns'];\n\nvar svg$1 = ['accent-height', 'accumulate', 'additivive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'tabindex', 'targetx', 'targety', 'transform', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan'];\n\nvar mathMl$1 = ['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns'];\n\nvar xml = ['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink'];\n\n/* Add properties to a lookup table */\nfunction addToSet(set, array) {\n var l = array.length;\n while (l--) {\n if (typeof array[l] === 'string') {\n array[l] = array[l].toLowerCase();\n }\n set[array[l]] = true;\n }\n return set;\n}\n\n/* Shallow clone an object */\nfunction clone(object) {\n var newObject = {};\n var property = void 0;\n for (property in object) {\n if (Object.prototype.hasOwnProperty.call(object, property)) {\n newObject[property] = object[property];\n }\n }\n return newObject;\n}\n\nvar MUSTACHE_EXPR = /\\{\\{[\\s\\S]*|[\\s\\S]*\\}\\}/gm; // Specify template detection regex for SAFE_FOR_TEMPLATES mode\nvar ERB_EXPR = /<%[\\s\\S]*|[\\s\\S]*%>/gm;\nvar DATA_ATTR = /^data-[\\-\\w.\\u00B7-\\uFFFF]/; // eslint-disable-line no-useless-escape\nvar ARIA_ATTR = /^aria-[\\-\\w]+$/; // eslint-disable-line no-useless-escape\nvar IS_ALLOWED_URI = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i; // eslint-disable-line no-useless-escape\nvar IS_SCRIPT_OR_DATA = /^(?:\\w+script|data):/i;\nvar ATTR_WHITESPACE = /[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205f\\u3000]/g; // eslint-disable-line no-control-regex\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n};\n\nfunction createDOMPurify() {\n var window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n\n var DOMPurify = function DOMPurify(root) {\n return createDOMPurify(root);\n };\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = '1.0.8';\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n\n if (!window || !window.document || window.document.nodeType !== 9) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n\n return DOMPurify;\n }\n\n var originalDocument = window.document;\n var useDOMParser = false; // See comment below\n var removeTitle = false; // See comment below\n\n var document = window.document;\n var DocumentFragment = window.DocumentFragment,\n HTMLTemplateElement = window.HTMLTemplateElement,\n Node = window.Node,\n NodeFilter = window.NodeFilter,\n _window$NamedNodeMap = window.NamedNodeMap,\n NamedNodeMap = _window$NamedNodeMap === undefined ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap,\n Text = window.Text,\n Comment = window.Comment,\n DOMParser = window.DOMParser;\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n\n if (typeof HTMLTemplateElement === 'function') {\n var template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n\n var _document = document,\n implementation = _document.implementation,\n createNodeIterator = _document.createNodeIterator,\n getElementsByTagName = _document.getElementsByTagName,\n createDocumentFragment = _document.createDocumentFragment;\n var importNode = originalDocument.importNode;\n\n\n var hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = implementation && typeof implementation.createHTMLDocument !== 'undefined' && document.documentMode !== 9;\n\n var MUSTACHE_EXPR$$1 = MUSTACHE_EXPR,\n ERB_EXPR$$1 = ERB_EXPR,\n DATA_ATTR$$1 = DATA_ATTR,\n ARIA_ATTR$$1 = ARIA_ATTR,\n IS_SCRIPT_OR_DATA$$1 = IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE$$1 = ATTR_WHITESPACE;\n var IS_ALLOWED_URI$$1 = IS_ALLOWED_URI;\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n\n var ALLOWED_TAGS = null;\n var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray(html), _toConsumableArray(svg), _toConsumableArray(svgFilters), _toConsumableArray(mathMl), _toConsumableArray(text)));\n\n /* Allowed attribute names */\n var ALLOWED_ATTR = null;\n var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(_toConsumableArray(html$1), _toConsumableArray(svg$1), _toConsumableArray(mathMl$1), _toConsumableArray(xml)));\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n var FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n var FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n var ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n var ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n var ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Output should be safe for jQuery's $() factory? */\n var SAFE_FOR_JQUERY = false;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n var SAFE_FOR_TEMPLATES = false;\n\n /* Decide if document with <html>... should be returned */\n var WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n var SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n var FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html string.\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n var RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html string */\n var RETURN_DOM_FRAGMENT = false;\n\n /* If `RETURN_DOM` or `RETURN_DOM_FRAGMENT` is enabled, decide if the returned DOM\n * `Node` is imported into the current `Document`. If this flag is not enabled the\n * `Node` will belong (its ownerDocument) to a fresh `HTMLDocument`, created by\n * DOMPurify. */\n var RETURN_DOM_IMPORT = false;\n\n /* Output should be free from DOM clobbering attacks? */\n var SANITIZE_DOM = true;\n\n /* Keep element content when removing element? */\n var KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n var IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n var USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n var FORBID_CONTENTS = addToSet({}, ['audio', 'head', 'math', 'script', 'style', 'template', 'svg', 'video']);\n\n /* Tags that are safe for data: URIs */\n var DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image']);\n\n /* Attributes safe for values like \"javascript:\" */\n var URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'summary', 'title', 'value', 'style', 'xmlns']);\n\n /* Keep a reference to config to pass to hooks */\n var CONFIG = null;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n var formElement = document.createElement('form');\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n var _parseConfig = function _parseConfig(cfg) {\n /* Shield configuration object from tampering */\n if ((typeof cfg === 'undefined' ? 'undefined' : _typeof(cfg)) !== 'object') {\n cfg = {};\n }\n /* Set configuration parameters */\n ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR) : DEFAULT_ALLOWED_ATTR;\n FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS) : {};\n FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR) : {};\n USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n SAFE_FOR_JQUERY = cfg.SAFE_FOR_JQUERY || false; // Default false\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_DOM_IMPORT = cfg.RETURN_DOM_IMPORT || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n\n IS_ALLOWED_URI$$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI$$1;\n\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray(text)));\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html);\n addToSet(ALLOWED_ATTR, html$1);\n }\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg);\n addToSet(ALLOWED_ATTR, svg$1);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg$1);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl);\n addToSet(ALLOWED_ATTR, mathMl$1);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS);\n }\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR);\n }\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (Object && 'freeze' in Object) {\n Object.freeze(cfg);\n }\n\n CONFIG = cfg;\n };\n\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n var _forceRemove = function _forceRemove(node) {\n DOMPurify.removed.push({ element: node });\n try {\n node.parentNode.removeChild(node);\n } catch (err) {\n node.outerHTML = '';\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n var _removeAttribute = function _removeAttribute(name, node) {\n try {\n DOMPurify.removed.push({\n attribute: node.getAttributeNode(name),\n from: node\n });\n } catch (err) {\n DOMPurify.removed.push({\n attribute: null,\n from: node\n });\n }\n node.removeAttribute(name);\n };\n\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n var _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n var doc = void 0;\n\n if (FORCE_BODY) {\n dirty = '<remove></remove>' + dirty;\n }\n\n /* Use DOMParser to workaround Firefox bug (see comment below) */\n if (useDOMParser) {\n try {\n doc = new DOMParser().parseFromString(dirty, 'text/html');\n } catch (err) {}\n }\n\n /* Remove title to fix an mXSS bug in older MS Edge */\n if (removeTitle) {\n addToSet(FORBID_TAGS, ['title']);\n }\n\n /* Otherwise use createHTMLDocument, because DOMParser is unsafe in\n Safari (see comment below) */\n if (!doc || !doc.documentElement) {\n doc = implementation.createHTMLDocument('');\n var _doc = doc,\n body = _doc.body;\n\n body.parentNode.removeChild(body.parentNode.firstElementChild);\n body.outerHTML = dirty;\n }\n\n /* Work on whole document or just its body */\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n };\n\n // Firefox uses a different parser for innerHTML rather than\n // DOMParser (see https://bugzilla.mozilla.org/show_bug.cgi?id=1205631)\n // which means that you *must* use DOMParser, otherwise the output may\n // not be safe if used in a document.write context later.\n //\n // So we feature detect the Firefox bug and use the DOMParser if necessary.\n //\n // MS Edge, in older versions, is affected by an mXSS behavior. The second\n // check tests for the behavior and fixes it if necessary.\n if (DOMPurify.isSupported) {\n (function () {\n try {\n var doc = _initDocument('<svg><p><style><img src=\"</style><img src=x onerror=alert(1)//\">');\n if (doc.querySelector('svg img')) {\n useDOMParser = true;\n }\n } catch (err) {}\n })();\n (function () {\n try {\n var doc = _initDocument('<x/><title></title><img>');\n if (doc.querySelector('title').textContent.match(/<\\/title/)) {\n removeTitle = true;\n }\n } catch (err) {}\n })();\n }\n\n /**\n * _createIterator\n *\n * @param {Document} root document/fragment to create iterator for\n * @return {Iterator} iterator instance\n */\n var _createIterator = function _createIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, function () {\n return NodeFilter.FILTER_ACCEPT;\n }, false);\n };\n\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n var _isClobbered = function _isClobbered(elm) {\n if (elm instanceof Text || elm instanceof Comment) {\n return false;\n }\n if (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function') {\n return true;\n }\n return false;\n };\n\n /**\n * _isNode\n *\n * @param {Node} obj object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n var _isNode = function _isNode(obj) {\n return (typeof Node === 'undefined' ? 'undefined' : _typeof(Node)) === 'object' ? obj instanceof Node : obj && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && typeof obj.nodeType === 'number' && typeof obj.nodeName === 'string';\n };\n\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n var _executeHook = function _executeHook(entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n\n hooks[entryPoint].forEach(function (hook) {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n var _sanitizeElements = function _sanitizeElements(currentNode) {\n var content = void 0;\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeElements', currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n var tagName = currentNode.nodeName.toLowerCase();\n\n /* Execute a hook if present */\n _executeHook('uponSanitizeElement', currentNode, {\n tagName: tagName,\n allowedTags: ALLOWED_TAGS\n });\n\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Keep content except for black-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName] && typeof currentNode.insertAdjacentHTML === 'function') {\n try {\n currentNode.insertAdjacentHTML('AfterEnd', currentNode.innerHTML);\n } catch (err) {}\n }\n _forceRemove(currentNode);\n return true;\n }\n\n /* Convert markup to cover jQuery behavior */\n if (SAFE_FOR_JQUERY && !currentNode.firstElementChild && (!currentNode.content || !currentNode.content.firstElementChild) && /</g.test(currentNode.textContent)) {\n DOMPurify.removed.push({ element: currentNode.cloneNode() });\n if (currentNode.innerHTML) {\n currentNode.innerHTML = currentNode.innerHTML.replace(/</g, '<');\n } else {\n currentNode.innerHTML = currentNode.textContent.replace(/</g, '<');\n }\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {\n /* Get the element's text content */\n content = currentNode.textContent;\n content = content.replace(MUSTACHE_EXPR$$1, ' ');\n content = content.replace(ERB_EXPR$$1, ' ');\n if (currentNode.textContent !== content) {\n DOMPurify.removed.push({ element: currentNode.cloneNode() });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeElements', currentNode, null);\n\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n var _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n value = value.replace(MUSTACHE_EXPR$$1, ' ');\n value = value.replace(ERB_EXPR$$1, ' ');\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && DATA_ATTR$$1.test(lcName)) {\n // This attribute is safe\n } else if (ALLOW_ARIA_ATTR && ARIA_ATTR$$1.test(lcName)) {\n // This attribute is safe\n /* Otherwise, check the name is permitted */\n } else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n return false;\n\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) {\n // This attribute is safe\n /* Check no script, data or unknown possibly unsafe URI\n unless we know URI values are safe for that attribute */\n } else if (IS_ALLOWED_URI$$1.test(value.replace(ATTR_WHITESPACE$$1, ''))) {\n // This attribute is safe\n /* Keep image data URIs alive if src/xlink:href is allowed */\n /* Further prevent gadget XSS for dynamically built script tags */\n } else if ((lcName === 'src' || lcName === 'xlink:href') && lcTag !== 'script' && value.indexOf('data:') === 0 && DATA_URI_TAGS[lcTag]) {\n // This attribute is safe\n /* Allow unknown protocols: This provides support for links that\n are handled by protocol handlers which may be unknown ahead of\n time, e.g. fb:, spotify: */\n } else if (ALLOW_UNKNOWN_PROTOCOLS && !IS_SCRIPT_OR_DATA$$1.test(value.replace(ATTR_WHITESPACE$$1, ''))) {\n // This attribute is safe\n /* Check for binary attributes */\n // eslint-disable-next-line no-negated-condition\n } else if (!value) {\n // Binary attributes are safe at this point\n /* Anything else, presume unsafe, do not add it back */\n } else {\n return false;\n }\n return true;\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} node to sanitize\n */\n // eslint-disable-next-line complexity\n var _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n var attr = void 0;\n var value = void 0;\n var lcName = void 0;\n var idAttr = void 0;\n var l = void 0;\n /* Execute a hook if present */\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n\n var attributes = currentNode.attributes;\n\n /* Check if we have attributes; if not we might have a text node */\n\n if (!attributes) {\n return;\n }\n\n var hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR\n };\n l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n attr = attributes[l];\n var _attr = attr,\n name = _attr.name,\n namespaceURI = _attr.namespaceURI;\n\n value = attr.value.trim();\n lcName = name.toLowerCase();\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n value = hookEvent.attrValue;\n\n /* Remove attribute */\n // Safari (iOS + Mac), last tested v8.0.5, crashes if you try to\n // remove a \"name\" attribute from an <img> tag that has an \"id\"\n // attribute at the time.\n if (lcName === 'name' && currentNode.nodeName === 'IMG' && attributes.id) {\n idAttr = attributes.id;\n attributes = Array.prototype.slice.apply(attributes);\n _removeAttribute('id', currentNode);\n _removeAttribute(name, currentNode);\n if (attributes.indexOf(idAttr) > l) {\n currentNode.setAttribute('id', idAttr.value);\n }\n } else if (\n // This works around a bug in Safari, where input[type=file]\n // cannot be dynamically set after type has been removed\n currentNode.nodeName === 'INPUT' && lcName === 'type' && value === 'file' && (ALLOWED_ATTR[lcName] || !FORBID_ATTR[lcName])) {\n continue;\n } else {\n // This avoids a crash in Safari v9.0 with double-ids.\n // The trick is to first set the id to be empty and then to\n // remove the attribute\n if (name === 'id') {\n currentNode.setAttribute(name, '');\n }\n _removeAttribute(name, currentNode);\n }\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n\n /* Is `value` valid for this attribute? */\n var lcTag = currentNode.nodeName.toLowerCase();\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n DOMPurify.removed.pop();\n } catch (err) {}\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n var _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n var shadowNode = void 0;\n var shadowIterator = _createIterator(fragment);\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(shadowNode);\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} configuration object\n */\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty, cfg) {\n var body = void 0;\n var importedNode = void 0;\n var currentNode = void 0;\n var oldNode = void 0;\n var returnNode = void 0;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n if (!dirty) {\n dirty = '<!-->';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n // eslint-disable-next-line no-negated-condition\n if (typeof dirty.toString !== 'function') {\n throw new TypeError('toString is not a function');\n } else {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw new TypeError('dirty is not a string, aborting');\n }\n }\n }\n\n /* Check we can run. Otherwise fall back or ignore */\n if (!DOMPurify.isSupported) {\n if (_typeof(window.toStaticHTML) === 'object' || typeof window.toStaticHTML === 'function') {\n if (typeof dirty === 'string') {\n return window.toStaticHTML(dirty);\n }\n if (_isNode(dirty)) {\n return window.toStaticHTML(dirty.outerHTML);\n }\n }\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n if (IN_PLACE) {\n /* No special handling necessary for in-place sanitization */\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('<!-->');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else {\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !WHOLE_DOCUMENT && dirty.indexOf('<') === -1) {\n return dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : '';\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n var nodeIterator = _createIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while (currentNode = nodeIterator.nextNode()) {\n /* Fix IE's strange behavior with manipulated textNodes #89 */\n if (currentNode.nodeType === 3 && currentNode === oldNode) {\n continue;\n }\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n\n oldNode = currentNode;\n }\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n\n while (body.firstChild) {\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n\n if (RETURN_DOM_IMPORT) {\n /* AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs. */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n\n return returnNode;\n }\n\n return WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function (cfg) {\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {string} tag Tag name of containing element.\n * @param {string} attr Attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n var lcTag = tag.toLowerCase();\n var lcName = attr.toLowerCase();\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n hooks[entryPoint] = hooks[entryPoint] || [];\n hooks[entryPoint].push(hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n */\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint].pop();\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n *\n */\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n\n return DOMPurify;\n}\n\nvar purify = createDOMPurify();\n\nexport default purify;\n//# sourceMappingURL=purify.es.js.map\n","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport purify from 'dompurify';\nconst propertyToAttribute = {}; // TODO(choumx): Fill this in.\nexport class DOMPurifySanitizer {\n /**\n * @param node\n */\n sanitize(node) {\n purify.sanitize(node, { IN_PLACE: true });\n }\n /**\n * @param tag\n * @param attr\n * @param value\n */\n validAttribute(tag, attr, value) {\n return purify.isValidAttribute(tag, attr, value);\n }\n /**\n * @param tag\n * @param prop\n * @param value\n */\n validProperty(tag, prop, value) {\n const attr = propertyToAttribute[prop];\n if (attr) {\n return this.validAttribute(tag, attr, value);\n }\n else {\n return this.validAttribute(tag, prop, value);\n }\n }\n}\n//# sourceMappingURL=DOMPurifySanitizer.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nlet count = 0;\nconst STRINGS = new Map();\n/**\n * Return a string for the specified index.\n * @param index string index to retrieve.\n * @returns string in map for the index.\n */\nexport function getString(index) {\n return STRINGS.get(index) || '';\n}\n/**\n * Stores a string for parsing from mutation\n * @param value string to store from background thread.\n */\nexport function storeString(value) {\n STRINGS.set(++count, value);\n}\n//# sourceMappingURL=strings.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getString } from './strings';\nlet NODES;\nlet BASE_ELEMENT;\nexport function prepare(baseElement) {\n NODES = new Map([[1, baseElement], [2, baseElement]]);\n BASE_ELEMENT = baseElement;\n}\nexport function isTextNode(node) {\n return ('nodeType' in node ? node.nodeType : node[0 /* nodeType */]) === 3 /* TEXT_NODE */;\n}\n/**\n * Create a real DOM Node from a skeleton Object (`{ nodeType, nodeName, attributes, children, data }`)\n * @example <caption>Text node</caption>\n * createNode({ nodeType:3, data:'foo' })\n * @example <caption>Element node</caption>\n * createNode({ nodeType:1, nodeName:'div', attributes:[{ name:'a', value:'b' }], childNodes:[ ... ] })\n */\nexport function createNode(skeleton) {\n if (isTextNode(skeleton)) {\n const node = document.createTextNode(getString(skeleton[5 /* textContent */]));\n storeNode(node, skeleton[7 /* _index_ */]);\n return node;\n }\n const namespace = skeleton[6 /* namespaceURI */] !== undefined ? getString(skeleton[6 /* namespaceURI */]) : undefined;\n const node = namespace\n ? document.createElementNS(namespace, getString(skeleton[1 /* nodeName */]))\n : document.createElement(getString(skeleton[1 /* nodeName */]));\n // TODO(KB): Restore Properties\n // skeleton.properties.forEach(property => {\n // node[`${property.name}`] = property.value;\n // });\n // ((skeleton as TransferrableElement)[TransferrableKeys.childNodes] || []).forEach(childNode => {\n // if (childNode[TransferrableKeys.transferred] === NumericBoolean.FALSE) {\n // node.appendChild(createNode(childNode as TransferrableNode));\n // }\n // });\n storeNode(node, skeleton[7 /* _index_ */]);\n return node;\n}\n/**\n * Returns the real DOM Element corresponding to a serialized Element object.\n * @param id\n * @return\n */\nexport function getNode(id) {\n const node = NODES.get(id);\n if (node && node.nodeName === 'BODY') {\n // If the node requested is the \"BODY\"\n // Then we return the base node this specific <amp-script> comes from.\n // This encapsulates each <amp-script> node.\n return BASE_ELEMENT;\n }\n return node;\n}\n/**\n * Establish link between DOM `node` and worker-generated identifier `id`.\n *\n * These _shouldn't_ collide between instances of <amp-script> since\n * each element creates it's own pool on both sides of the worker\n * communication bridge.\n * @param node\n * @param id\n */\nexport function storeNode(node, id) {\n node._index_ = id;\n NODES.set(id, node);\n}\n//# sourceMappingURL=nodes.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// TODO(KB): Fetch Polyfill for IE11.\nexport function createWorker(workerDomURL, authorScriptURL) {\n return Promise.all([fetch(workerDomURL).then(response => response.text()), fetch(authorScriptURL).then(response => response.text())])\n .then(([workerScript, authorScript]) => {\n // TODO(KB): Minify this output during build process.\n const keys = [];\n for (let key in document.body.style) {\n keys.push(`'${key}'`);\n }\n const code = `\n 'use strict';\n ${workerScript}\n (function() {\n var self = this;\n var window = this;\n var document = this.document;\n var localStorage = this.localStorage;\n var location = this.location;\n var defaultView = document.defaultView;\n var Node = defaultView.Node;\n var Text = defaultView.Text;\n var Element = defaultView.Element;\n var SVGElement = defaultView.SVGElement;\n var Document = defaultView.Document;\n var Event = defaultView.Event;\n var MutationObserver = defaultView.MutationObserver;\n\n function addEventListener(type, handler) {\n return document.addEventListener(type, handler);\n }\n function removeEventListener(type, handler) {\n return document.removeEventListener(type, handler);\n }\n this.appendKeys([${keys}]);\n ${authorScript}\n }).call(WorkerThread.workerDOM);\n//# sourceURL=${encodeURI(authorScriptURL)}`;\n return new Worker(URL.createObjectURL(new Blob([code])));\n })\n .catch(error => {\n return null;\n });\n}\nexport function messageToWorker(worker, message) {\n worker.postMessage(message);\n}\n//# sourceMappingURL=worker.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { messageToWorker } from './worker';\nimport { getNode } from './nodes';\nimport { getString } from './strings';\nconst KNOWN_LISTENERS = [];\n/**\n * Instead of a whitelist of elements that need their value tracked, use the existence\n * of a property called value to drive the decision.\n * @param node node to check if values should be tracked.\n * @return boolean if the node should have its value property tracked.\n */\nconst shouldTrackChanges = (node) => node && 'value' in node;\n/**\n * When a node that has a value needing synced doesn't already have an event listener\n * listening for changed values, ensure the value is synced with a default listener.\n * @param worker whom to dispatch value toward.\n * @param node node to listen to value changes on.\n */\nexport const applyDefaultChangeListener = (worker, node) => {\n shouldTrackChanges(node) && node.onchange === null && (node.onchange = () => fireValueChange(worker, node));\n};\n/**\n * Tell the worker DOM what the value is for a Node.\n * @param worker whom to dispatch value toward.\n * @param node where to get the value from.\n */\nconst fireValueChange = (worker, node) => {\n messageToWorker(worker, {\n [9 /* type */]: 5 /* SYNC */,\n [38 /* sync */]: {\n [7 /* _index_ */]: node._index_,\n [18 /* value */]: node.value,\n },\n });\n};\n/**\n * Register an event handler for dispatching events to worker thread\n * @param worker whom to dispatch events toward\n * @param _index_ node index the event comes from (used to dispatchEvent in worker thread).\n * @return eventHandler function consuming event and dispatching to worker thread\n */\nconst eventHandler = (worker, _index_) => (event) => {\n if (shouldTrackChanges(event.currentTarget)) {\n fireValueChange(worker, event.currentTarget);\n }\n messageToWorker(worker, {\n [9 /* type */]: 1 /* EVENT */,\n [37 /* event */]: {\n [7 /* _index_ */]: _index_,\n [22 /* bubbles */]: event.bubbles,\n [23 /* cancelable */]: event.cancelable,\n [24 /* cancelBubble */]: event.cancelBubble,\n [25 /* currentTarget */]: {\n [7 /* _index_ */]: event.currentTarget._index_,\n [8 /* transferred */]: 1 /* TRUE */,\n },\n [26 /* defaultPrevented */]: event.defaultPrevented,\n [27 /* eventPhase */]: event.eventPhase,\n [28 /* isTrusted */]: event.isTrusted,\n [29 /* returnValue */]: event.returnValue,\n [10 /* target */]: {\n [7 /* _index_ */]: event.target._index_,\n [8 /* transferred */]: 1 /* TRUE */,\n },\n [30 /* timeStamp */]: event.timeStamp,\n [9 /* type */]: event.type,\n [32 /* keyCode */]: 'keyCode' in event ? event.keyCode : undefined,\n },\n });\n};\n/**\n * Process commands transfered from worker thread to main thread.\n * @param nodesInstance nodes instance to execute commands against.\n * @param worker whom to dispatch events toward.\n * @param mutation mutation record containing commands to execute.\n */\nexport function process(worker, mutation) {\n const _index_ = mutation[10 /* target */];\n const target = getNode(_index_);\n (mutation[21 /* removedEvents */] || []).forEach(eventSub => {\n processListenerChange(worker, target, false, getString(eventSub[9 /* type */]), eventSub[33 /* index */]);\n });\n (mutation[20 /* addedEvents */] || []).forEach(eventSub => {\n processListenerChange(worker, target, true, getString(eventSub[9 /* type */]), eventSub[33 /* index */]);\n });\n}\n/**\n * If the worker requests to add an event listener to 'change' for something the foreground thread is already listening to\n * ensure that only a single 'change' event is attached to prevent sending values multiple times.\n * @param worker worker issuing listener changes\n * @param target node to change listeners on\n * @param addEvent is this an 'addEvent' or 'removeEvent' change\n * @param type event type requested to change\n * @param index number in the listeners array this event corresponds to.\n */\nexport function processListenerChange(worker, target, addEvent, type, index) {\n let changeEventSubscribed = target.onchange !== null;\n const shouldTrack = shouldTrackChanges(target);\n const isChangeEvent = type === 'change';\n if (addEvent) {\n if (isChangeEvent) {\n changeEventSubscribed = true;\n target.onchange = null;\n }\n target.addEventListener(type, (KNOWN_LISTENERS[index] = eventHandler(worker, target._index_)));\n }\n else {\n if (isChangeEvent) {\n changeEventSubscribed = false;\n }\n target.removeEventListener(type, KNOWN_LISTENERS[index]);\n }\n if (shouldTrack && !changeEventSubscribed) {\n applyDefaultChangeListener(worker, target);\n }\n}\n//# sourceMappingURL=command.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { storeNode, getNode, createNode, isTextNode } from './nodes';\nimport { storeString, getString } from './strings';\nimport { applyDefaultChangeListener, processListenerChange } from './command';\nfunction allTextNodes(nodes) {\n return nodes.length > 0 && [].every.call(nodes, isTextNode);\n}\n/**\n * Replace all the children with the ones from the HydrateableNode.\n * Used when we're certain the content won't break the page.\n * @param nodes HydrateableNodes containing content to potentially overwrite main thread content.\n * @param parent Node in the main thread that will be the parent of the passed nodes.\n * @param worker worker that issued the request for hydration.\n */\nfunction replaceNodes(nodes, parent, worker) {\n [].forEach.call(parent.childNodes, (childNode) => childNode.remove());\n nodes.forEach((node, index) => {\n const newNode = createNode(node);\n (node[2 /* attributes */] || []).forEach(attribute => {\n const namespaceURI = getString(attribute[0]);\n if (namespaceURI !== 'null') {\n newNode.setAttributeNS(namespaceURI, getString(attribute[1]), getString(attribute[2]));\n }\n else {\n newNode.setAttribute(getString(attribute[1]), getString(attribute[2]));\n }\n });\n parent.appendChild(newNode);\n applyDefaultChangeListener(worker, newNode);\n replaceNodes(node[4 /* childNodes */] || [], parent.childNodes[index], worker);\n });\n}\n/**\n * Hydrate a single node and it's children safely.\n * Attempt to ensure content is a rough match so content doesn't shift between the document representation\n * and client side generated content.\n * @param transferNode root of the background thread content (document.body from worker-thread).\n * @param node root for the foreground thread content (element upgraded to background driven).\n * @param worker worker that issued the request for hydration.\n */\nfunction hydrateNode(transferNode, node, worker) {\n const transferIsText = isTextNode(transferNode);\n const nodeIsText = isTextNode(node);\n if (!transferIsText && !nodeIsText) {\n const childNodes = transferNode[4 /* childNodes */] || [];\n if (childNodes.length !== node.childNodes.length) {\n // If this parent node has an unequal number of childNodes, we need to ensure its for an allowable reason.\n if (allTextNodes(childNodes) && allTextNodes(node.childNodes)) {\n // Offset due to a differing number of text nodes.\n // replace the current DOM with the text nodes from the hydration.\n replaceNodes(childNodes, node, worker);\n }\n else {\n const filteredTransfer = childNodes.filter(childNode => !isTextNode(childNode));\n const filteredNodes = [].filter.call(node.childNodes, (childNode) => !isTextNode(childNode));\n // Empty text nodes are used by frameworks as placeholders for future dom content.\n if (filteredTransfer.length === filteredNodes.length) {\n storeNode(node, transferNode[7 /* _index_ */]);\n replaceNodes(childNodes, node, worker);\n }\n }\n }\n else {\n storeNode(node, transferNode[7 /* _index_ */]);\n applyDefaultChangeListener(worker, node);\n // Same number of children, hydrate them.\n childNodes.forEach((childNode, index) => hydrateNode(childNode, node.childNodes[index], worker));\n }\n }\n else if (transferIsText && nodeIsText) {\n // Singular text node, no children.\n storeNode(node, transferNode[7 /* _index_ */]);\n node.textContent = getString(transferNode[5 /* textContent */]);\n applyDefaultChangeListener(worker, node);\n }\n}\n/**\n * Hydrate a root from the worker thread by comparing with the main thread representation.\n * @param skeleton root of the background thread content.\n * @param addEvents events needing subscription from the background thread content.\n * @param baseElement root of the main thread content to compare against.\n * @param worker worker issuing the upgrade request.\n */\nexport function hydrate(skeleton, stringValues, addEvents, baseElement, worker) {\n // Process String Additions\n stringValues.forEach(value => storeString(value));\n // Process Node Addition / Removal\n hydrateNode(skeleton, baseElement, worker);\n // Process Event Addition\n addEvents.forEach(event => {\n const node = getNode(event[7 /* _index_ */]);\n node && processListenerChange(worker, node, true, getString(event[9 /* type */]), event[33 /* index */]);\n });\n}\n//# sourceMappingURL=hydrator.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNode, createNode } from './nodes';\nimport { storeString, getString } from './strings';\nimport { process } from './command';\nlet MUTATION_QUEUE = [];\nlet PENDING_MUTATIONS = false;\nlet worker;\nexport function prepareMutate(passedWorker) {\n worker = passedWorker;\n}\nconst mutators = {\n [2 /* CHILD_LIST */](mutation, target, sanitizer) {\n (mutation[12 /* removedNodes */] || []).forEach(node => getNode(node[7 /* _index_ */]).remove());\n const addedNodes = mutation[11 /* addedNodes */];\n const nextSibling = mutation[14 /* nextSibling */];\n if (addedNodes) {\n addedNodes.forEach(node => {\n let newChild = getNode(node[7 /* _index_ */]);\n if (!newChild) {\n newChild = createNode(node);\n if (sanitizer) {\n sanitizer.sanitize(newChild); // TODO(choumx): Inform worker?\n }\n }\n target.insertBefore(newChild, (nextSibling && getNode(nextSibling[7 /* _index_ */])) || null);\n });\n }\n },\n [0 /* ATTRIBUTES */](mutation, target, sanitizer) {\n const attributeName = mutation[15 /* attributeName */] !== undefined ? getString(mutation[15 /* attributeName */]) : null;\n const value = mutation[18 /* value */] !== undefined ? getString(mutation[18 /* value */]) : null;\n if (attributeName != null && value != null) {\n if (!sanitizer || sanitizer.validAttribute(target.nodeName, attributeName, value)) {\n target.setAttribute(attributeName, value);\n }\n else {\n // TODO(choumx): Inform worker?\n }\n }\n },\n [1 /* CHARACTER_DATA */](mutation, target) {\n const value = mutation[18 /* value */];\n if (value) {\n // Sanitization not necessary for textContent.\n target.textContent = getString(value);\n }\n },\n [3 /* PROPERTIES */](mutation, target, sanitizer) {\n const propertyName = mutation[17 /* propertyName */] !== undefined ? getString(mutation[17 /* propertyName */]) : null;\n const value = mutation[18 /* value */] !== undefined ? getString(mutation[18 /* value */]) : null;\n if (propertyName && value) {\n if (!sanitizer || sanitizer.validProperty(target.nodeName, propertyName, value)) {\n target[propertyName] = value;\n }\n else {\n // TODO(choumx): Inform worker?\n }\n }\n },\n [4 /* COMMAND */](mutation) {\n process(worker, mutation);\n },\n};\n/**\n * Process MutationRecords from worker thread applying changes to the existing DOM.\n * @param nodes New nodes to add in the main thread with the incoming mutations.\n * @param mutations Changes to apply in both graph shape and content of Elements.\n * @param sanitizer Sanitizer to apply to content if needed.\n */\nexport function mutate(nodes, stringValues, mutations, sanitizer) {\n //mutations: TransferrableMutationRecord[]): void {\n // TODO(KB): Restore signature requiring lastMutationTime. (lastGestureTime: number, mutations: TransferrableMutationRecord[])\n // if (performance.now() || Date.now() - lastGestureTime > GESTURE_TO_MUTATION_THRESHOLD) {\n // return;\n // }\n // this.lastGestureTime = lastGestureTime;\n stringValues.forEach(value => storeString(value));\n nodes.forEach(node => createNode(node));\n MUTATION_QUEUE = MUTATION_QUEUE.concat(mutations);\n if (!PENDING_MUTATIONS) {\n PENDING_MUTATIONS = true;\n requestAnimationFrame(() => syncFlush(sanitizer));\n }\n}\n/**\n * Apply all stored mutations syncronously. This method works well, but can cause jank if there are too many\n * mutations to apply in a single frame.\n *\n * Investigations in using asyncFlush to resolve are worth considering.\n */\nfunction syncFlush(sanitizer) {\n MUTATION_QUEUE.forEach(mutation => {\n mutators[mutation[9 /* type */]](mutation, getNode(mutation[10 /* target */]), sanitizer);\n });\n MUTATION_QUEUE = [];\n PENDING_MUTATIONS = false;\n}\n//# sourceMappingURL=mutator.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { hydrate } from './hydrator';\nimport { prepareMutate, mutate } from './mutator';\nimport { createWorker } from './worker';\nimport { prepare as prepareNodes } from './nodes';\nexport function install(baseElement, workerDOMUrl, sanitizer) {\n const authorURL = baseElement.getAttribute('src');\n if (authorURL === null) {\n return;\n }\n createWorker(workerDOMUrl, authorURL).then(worker => {\n if (worker === null) {\n return;\n }\n prepareNodes(baseElement);\n prepareMutate(worker);\n worker.onmessage = ({ data }) => {\n switch (data[9 /* type */]) {\n case 2 /* HYDRATE */:\n // console.info(`hydration from worker: ${data.type}`, data);\n hydrate(data[35 /* nodes */], data[39 /* strings */], data[20 /* addedEvents */], baseElement, worker);\n break;\n case 3 /* MUTATE */:\n // console.info(`mutation from worker: ${data.type}`, data);\n mutate(data[35 /* nodes */], data[39 /* strings */], data[34 /* mutations */], sanitizer);\n break;\n }\n };\n });\n}\n//# sourceMappingURL=install.js.map","/**\n * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DOMPurifySanitizer } from './DOMPurifySanitizer';\nimport { install } from './install';\nexport function upgradeElement(baseElement, workerDOMUrl) {\n install(baseElement, workerDOMUrl, new DOMPurifySanitizer());\n}\n//# sourceMappingURL=index.safe.js.map"],"names":["html","svg","svgFilters","mathMl","text","html$1","svg$1","mathMl$1","xml","addToSet","set","array","l","length","toLowerCase","clone","object","newObject","property","Object","prototype","hasOwnProperty","call","MUSTACHE_EXPR","ERB_EXPR","DATA_ATTR","ARIA_ATTR","IS_ALLOWED_URI","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE","_typeof","Symbol","iterator","obj","constructor","_toConsumableArray","arr","Array","isArray","i","arr2","from","createDOMPurify","_sanitizeAttributes","currentNode","attr","_executeHook","attributes","hookEvent","attrName","attrValue","keepAttr","allowedAttributes","ALLOWED_ATTR","_attr","name","namespaceURI","value","trim","lcName","nodeName","id","idAttr","slice","apply","_removeAttribute","indexOf","setAttribute","FORBID_ATTR","lcTag","_isValidAttribute","setAttributeNS","DOMPurify","removed","pop","err","SANITIZE_DOM","document","formElement","SAFE_FOR_TEMPLATES","replace","ALLOW_DATA_ATTR","test","ALLOW_ARIA_ATTR","URI_SAFE_ATTRIBUTES","IS_ALLOWED_URI$$1","DATA_URI_TAGS","ALLOW_UNKNOWN_PROTOCOLS","_sanitizeElements","Text","Comment","textContent","removeChild","NamedNodeMap","removeAttribute","_forceRemove","tagName","allowedTags","ALLOWED_TAGS","FORBID_TAGS","KEEP_CONTENT","FORBID_CONTENTS","insertAdjacentHTML","innerHTML","SAFE_FOR_JQUERY","firstElementChild","content","push","element","cloneNode","nodeType","entryPoint","data","hooks","forEach","hook","CONFIG","_isNode","Node","_createIterator","root","createNodeIterator","ownerDocument","NodeFilter","SHOW_ELEMENT","SHOW_COMMENT","SHOW_TEXT","FILTER_ACCEPT","_initDocument","dirty","doc","FORCE_BODY","useDOMParser","parseFromString","DOMParser","removeTitle","documentElement","implementation","createHTMLDocument","body","parentNode","outerHTML","getElementsByTagName","WHOLE_DOCUMENT","node","attribute","getAttributeNode","_parseConfig","cfg","DEFAULT_ALLOWED_TAGS","DEFAULT_ALLOWED_ATTR","USE_PROFILES","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_DOM_IMPORT","IN_PLACE","ALLOWED_URI_REGEXP","concat","ADD_TAGS","ADD_ATTR","ADD_URI_SAFE_ATTR","table","freeze","window","arguments","undefined","version","isSupported","originalDocument","DocumentFragment","_window$NamedNodeMap","MozNamedAttrMap","HTMLTemplateElement","template","createElement","_document","createDocumentFragment","importNode","documentMode","SET_CONFIG","querySelector","match","_sanitizeShadowDOM","fragment","shadowNode","shadowIterator","nextNode","sanitize","DOMPurify.sanitize","oldNode","toString","TypeError","toStaticHTML","importedNode","appendChild","firstChild","nodeIterator","returnNode","setConfig","DOMPurify.setConfig","clearConfig","DOMPurify.clearConfig","isValidAttribute","DOMPurify.isValidAttribute","tag","addHook","DOMPurify.addHook","hookFunction","removeHook","DOMPurify.removeHook","removeHooks","DOMPurify.removeHooks","removeAllHooks","DOMPurify.removeAllHooks","purify","propertyToAttribute","DOMPurifySanitizer","prop","validAttribute","count","STRINGS","Map","getString","index","get","NODES","BASE_ELEMENT","prepare","baseElement","isTextNode","createNode","skeleton","createTextNode","storeNode","namespace","createElementNS","getNode","_index_","createWorker","workerDomURL","authorScriptURL","Promise","all","fetch","then","response","workerScript","authorScript","keys","key","style","code","encodeURI","Worker","URL","createObjectURL","Blob","catch","KNOWN_LISTENERS","applyDefaultChangeListener","worker","onchange","node.onchange","postMessage","message","eventHandler","event","currentTarget","bubbles","cancelable","cancelBubble","defaultPrevented","eventPhase","isTrusted","returnValue","target","timeStamp","type","keyCode","process","mutation","eventSub","processListenerChange","addEvent","changeEventSubscribed","shouldTrack","isChangeEvent","addEventListener","removeEventListener","allTextNodes","nodes","every","replaceNodes","parent","childNodes","childNode","remove","newNode","hydrateNode","transferNode","transferIsText","nodeIsText","filteredTransfer","filter","filteredNodes","hydrate","stringValues","addEvents","MUTATION_QUEUE","PENDING_MUTATIONS","mutators","sanitizer","addedNodes","nextSibling","newChild","insertBefore","attributeName","propertyName","validProperty","mutate","mutations","requestAnimationFrame","syncFlush","install","workerDOMUrl","authorURL","getAttribute","prepareNodes","onmessage","worker.onmessage","upgradeElement"],"mappings":"aAAA,IAAIA,GAAO,4mBAAA,MAAA,CAAA,GAAA,CAAX;AAGIC,GAAM,uVAAA,MAAA,CAAA,GAAA,CAHV,CAKIC,GAAa,4RAAA,MAAA,CAAA,GAAA,CALjB;AAOIC,GAAS,gMAAA,MAAA,CAAA,GAAA,CAPb,CASIC,GAAO,CAAC,OAAD,CATX,CAWIC,GAAS,mnBAAA,MAAA,CAAA,GAAA,CAXb;AAaIC,EAAQ,koDAAA,MAAA,CAAA,GAAA,CAbZ;AAeIC,GAAW,seAAA,MAAA,CAAA,GAAA,CAff;AAiBIC,EAAM,CAAC,YAAD,CAAe,QAAf,CAAyB,aAAzB,CAAwC,WAAxC,CAAqD,aAArD,CAGVC,SAASA,EAAQ,CAACC,CAAD,CAAMC,CAAN,CAAa,CAE5B,IADA,IAAIC,EAAID,CAAAE,OACR,CAAOD,CAAA,EAAP,CAAA,CAC0B,QAGxB,GAHI,MAAOD,EAAA,CAAMC,CAAN,CAGX,GAFED,CAAA,CAAMC,CAAN,CAEF,CAFaD,CAAA,CAAMC,CAAN,CAAAE,YAAA,EAEb,EAAAJ,CAAA,CAAIC,CAAA,CAAMC,CAAN,CAAJ,CAAA,CAAgB,CAAA,CAElB,OAAOF,EAR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,CAAA,CAAQ,EAAR,CAAR,CAArD,CAAkG+B,CAAlG,CADgC,CAAlC,CAGAH,EAAA,CAAiB,EACjBC,GAAA,CAAoB,CAAA,CALkB,CC3GxCc,QAOgBA,GAAV,CAAkB/F,CAAlB,CAA4CgG,CAA5C,CAAkEb,CAAlE,CAAuF,OACrFc,EAAYjG,CAAAkG,aAAA,CAAyB,KAAzB,CACA,QAAdD,GAIJvF,EAAA,CAAasF,CAAb,CAA2BC,CAA3B,CAAAjF,KAAA,CAA2C,CAAAgB,CAAA,CAAA,EAAS,CACnC,OAAXA,IAIJmE,EAAAA,CAAanG,CAAbmG,CAGA,CDPFnE,ECOE,CAFcA,CAEd,CAAAA,CAAAoE,UAAA,CAAmB,CAAC,CAAE,KAAAxN,CAAF,CAAD,CAAAyN,EAAgC,QACzCzN,CAAA,CAAI,CAAJ,QACN,EAEEiM,EAAA,CACGjM,CAAA,CAA4B,EAA5B,CADH,CAEGA,CAAA,CAA4B,EAA5B,CAFH,CAGGA,CAAA,CAA4B,EAA5B,CAHH,CAIEoH,CAJF,CAKEgC,CALF,aAQF,EAEE2D,EAAA,CACG/M,CAAA,CAA2B,EAA3B,CADH,CAEGA,CAAA,CAA2B,EAA3B,CAFH,CAGGA,CAAA,CAA2B,EAA3B,CAHH,CAIEuM,CAJF,EAd6C,EARD,CAApD,CAN2F,uBCJvFmB,QAAA,CAAyBtG,CAAzB,CAA+CgG,CAA/C,CAAmE,CACvED,EAAA,CAAQ/F,CAAR,CAAoCgG,CAApC,CAAkD,IAAI5G,EAAtD,CADuE;"} \ No newline at end of file diff --git a/dist/worker.js b/dist/worker.js deleted file mode 100644 index 8d805f058..000000000 --- a/dist/worker.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict';var WorkerThread=function(Q){function R(f,g){for(var e=0;e<g.length;e++){var a=g[e];a.enumerable=a.enumerable||!1;a.configurable=!0;"value"in a&&(a.writable=!0);Object.defineProperty(f,a.key,a)}}function r(f,g,e){g&&R(f.prototype,g);e&&R(f,e);return f}function n(f,g){f.prototype=Object.create(g.prototype);f.prototype.constructor=f;f.__proto__=g}function t(f){if(void 0===f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}function F(f){return!!f&& -S.get(f)||null}function T(){var f=G;G=[];return f}function w(f){A.forEach(function(g){if(g.options.subtreeFlattened&&4!==f.type){var e=f.target;if(!U(g.target,e)){do if(U(g.target,e)){V(g,f);break}while(e=e.parentNode)}}else V(g,f)})}function v(f){if(H.has(f))return H.get(f);H.set(f,++W);I.push(f);return W}function X(){var f=I;I=[];return f}function ka(f){var g;T();var e=Y.body.hydrate(),a=[];f.forEach(function(b){4===b.type&&b.addedEvents&&b.addedEvents.forEach(function(b){a.push(b)})});return g= -{},g[9]=2,g[39]=X(),g[35]=e,g[20]=a,g}function la(f){var g,e=T().map(function(b){return b._creationFormat_}),a=[];f.forEach(function(b){var c,d=(c={},c[9]=b.type,c[10]=b.target._index_,c);b.addedNodes&&(d[11]=Z(b.addedNodes));b.removedNodes&&(d[12]=Z(b.removedNodes));b.nextSibling&&(d[14]=b.nextSibling._transferredFormat_);null!=b.attributeName&&(d[15]=v(b.attributeName));null!=b.attributeNamespace&&(d[16]=v(b.attributeNamespace));null!=b.oldValue&&(d[19]=v(b.oldValue));b.propertyName&&(d[17]=v(b.propertyName)); -null!=b.value&&(d[18]=v(b.value));b.addedEvents&&(d[20]=b.addedEvents);b.removedEvents&&(d[21]=b.removedEvents);a.push(d)});return g={},g[9]=3,g[39]=X(),g[35]=e,g[34]=a,g}function ma(f,g){aa||(Y=f,(new f.defaultView.MutationObserver(function(e){g&&g(!1===ba?ka(e):la(e));ba=!0})).observe(f.body),aa=!0)}function na(){"undefined"!==typeof addEventListener&&addEventListener("message",function(f){f=f.data;if(1===f[9]){f=f[37];var g=F(f[7]);if(null!==g){var e=f[10];g.dispatchEvent(Object.assign(new ca(f[9], -{bubbles:f[22],cancelable:f[23]}),{cancelBubble:f[24],defaultPrevented:f[26],eventPhase:f[27],isTrusted:f[28],returnValue:f[29],target:F(e?e[7]:null),timeStamp:f[30],scoped:f[31],keyCode:f[32]}))}}})}function oa(){"function"===typeof addEventListener&&addEventListener("message",function(f){f=f.data;if(5===f[9]){f=f[38];var g=F(f[7]);g&&(g.value=f[18])}})}var da=0,G=[],S=new Map,A=[],J=!1,U=function(f,g){return null!==f&&g._index_===f._index_},V=function(f,g){f.pushRecord(g);J||(J=!0,Promise.resolve().then(function(){J= -!1;A.forEach(function(e){return e.callback(e.takeRecords())})}))},pa=function(){function f(e){this._records_=[];this.callback=e}var g=f.prototype;g.observe=function(e,a){this.disconnect();this.target=e;this.options=Object.assign({subtreeFlattened:!1},a);A.push(this)};g.disconnect=function(){this.target=null;var e=A.indexOf(this);0<=e&&A.splice(e,1)};g.takeRecords=function(){return this._records_.splice(0,this._records_.length)};g.pushRecord=function(e){this._records_.push(e)};return f}(),W=0,I=[], -H=new Map,K=null,E=function b(g,e,a){g[e]=a;g.childNodes.forEach(function(c){return b(c,e,a)})},L=function(){function g(a,b){this.childNodes=[];this.parentNode=null;this.isConnected=!1;this._handlers_={};this.nodeType=a;this.nodeName=b;null===K&&(K=this);this.ownerDocument=K;void 0!==this._index_?a=this._index_:(S.set(this._index_=++da,this),G.push(this),a=da);this._index_=a}var e=g.prototype;e.hasChildNodes=function(){return 0<this.childNodes.length};e.contains=function(a){return 0<this.childNodes.length? -this.childNodes.includes(this)?!0:this.childNodes.some(function(b){return b.contains(a)}):a===this};e.insertBefore=function(a,b){return null===a?null:a===this?a:null==b?(this.appendChild(a),w({addedNodes:[a],type:2,target:this}),a):0<=this.childNodes.indexOf(b)?(a.remove(),this.childNodes.splice(this.childNodes.indexOf(b),0,a),a.parentNode=this,E(a,"isConnected",this.isConnected),w({addedNodes:[a],nextSibling:b,type:2,target:this}),a):null};e.appendChild=function(a){a.remove();a.parentNode=this;E(a, -"isConnected",this.isConnected);this.childNodes.push(a);w({addedNodes:[a],previousSibling:this.childNodes[this.childNodes.length-2],type:2,target:this})};e.removeChild=function(a){var b=this.childNodes.indexOf(a);return 0<=b?(a.parentNode=null,E(a,"isConnected",!1),this.childNodes.splice(b,1),w({removedNodes:[a],type:2,target:this}),a):null};e.replaceChild=function(a,b){if(a!==b){var c=this.childNodes.indexOf(b);0<=c&&(b.parentNode=null,E(b,"isConnected",!1),this.childNodes.splice(c,1,a),w({addedNodes:[a], -removedNodes:[b],type:2,target:this}))}return b};e.remove=function(){this.parentNode&&this.parentNode.removeChild(this)};e.addEventListener=function(a,b){var c,d=this._handlers_[a.toLowerCase()],q=0;d&&0<d.length?q=d.push(b):this._handlers_[a.toLowerCase()]=[b];w({target:this,type:4,addedEvents:[(c={},c[9]=v(a),c[7]=this._index_,c[33]=q,c)]})};e.removeEventListener=function(a,b){var c=this._handlers_[a.toLowerCase()];b=c?c.indexOf(b):-1;if(0<=b){var d;c.splice(b,1);w({target:this,type:4,removedEvents:[(d= -{},d[9]=v(a),d[7]=this._index_,d[33]=b,d)]})}};e.dispatchEvent=function(a){var b=a.currentTarget=this,c,d;do if(c=b&&b._handlers_&&b._handlers_[a.type.toLowerCase()])for(d=c.length;d--&&(!1!==c[d].call(b,a)&&!a._end||!a.cancelable););while(a.bubbles&&(!a.cancelable||!a._stop)&&(b=b&&b.parentNode));return!a.defaultPrevented};r(g,[{key:"textContent",get:function(){var a="",b=this.childNodes;return b.length?(b.forEach(function(b){return a+=b.textContent}),a):""}},{key:"firstChild",get:function(){return 0< -this.childNodes.length?this.childNodes[0]:null}},{key:"lastChild",get:function(){return 0<this.childNodes.length?this.childNodes[this.childNodes.length-1]:null}},{key:"nextSibling",get:function(){if(null===this.parentNode)return null;var a=this.parentNode.childNodes;return a[a.indexOf(this)+1]||null}},{key:"previousSibling",get:function(){if(null===this.parentNode)return null;var a=this.parentNode.childNodes;return a[a.indexOf(this)-1]||null}}]);return g}(),B=function(){function g(a,b,c,d,q){var e= -this;this.array_=[];this.element_=b;this.attributeName_=c;this.storeAttributeMethod_=b.storeAttributeNS_.bind(b);b.propertyBackedAttributes_[c]=[function(){return e.value},function(b){return e.value=b}];d&&q&&Object.defineProperty(a.prototype,q,{enumerable:!0,configurable:!0,get:function(){return this[d].value},set:function(b){this[d].value=b}})}var e=g.prototype;e.item=function(a){return this.array_[a]};e.contains=function(a){return this.array_.includes(a)};e.add=function(){for(var a,b=this.value, -c=arguments.length,d=Array(c),q=0;q<c;q++)d[q]=arguments[q];(a=this.array_).splice.apply(a,[0,this.array_.length].concat(new Set(this.array_.concat(d))));this.mutationCompleteHandler_(b,this.value)};e.remove=function(){for(var a,b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];b=this.value;(a=this.array_).splice.apply(a,[0,this.array_.length].concat(new Set(this.array_.filter(function(b){return!c.includes(b)}))));this.mutationCompleteHandler_(b,this.value)};e.replace=function(a,b){var c; -if(this.array_.includes(a)){var d=this.value,q=new Set(this.array_);a!==b&&(q.delete(a),""!==b&&q.add(b));(c=this.array_).splice.apply(c,[0,this.array_.length].concat(q));this.mutationCompleteHandler_(d,this.value)}};e.toggle=function(a,b){if(!this.array_.includes(a))!1!==b&&this.add(a);else if(!0!==b)return this.remove(a),!1;return!0};e.mutationCompleteHandler_=function(a,b){this.storeAttributeMethod_(null,this.attributeName_,b);w({type:0,target:this.element_,attributeName:this.attributeName_,value:b, -oldValue:a})};r(g,[{key:"value",get:function(){return this.array_.join(" ")},set:function(a){var b,c=this.value;a=a.trim();(b=this.array_).splice.apply(b,[0,this.array_.length].concat(""!==a?a.split(/\s+/):""));this.mutationCompleteHandler_(c,a)}},{key:"length",get:function(){return this.array_.length}}]);return g}(),qa=function(g){return g.map(function(e){return e.name+'="'+e.value+'"'}).join(" ")},C=function(g,e){return function(a){return a.namespaceURI===g&&a.name===e}},M=function(g){function e(b){var a, -d;b=g.call(this,b,3,"#text")||this;b._transferredFormat_=(a={},a[7]=b._index_,a[8]=1,a);b._creationFormat_=(d={},d[7]=b._index_,d[8]=0,d[0]=3,d[1]=v("#text"),d[5]=v(b.data),d);return b}n(e,g);var a=e.prototype;a.hydrate=function(){return this._creationFormat_};a.splitText=function(b){var a=new e(this.data.slice(b,this.data.length)),d=this.parentNode;this.nodeValue=this.data.slice(0,b);if(null!==d){b=d.childNodes;var q=b.indexOf(this)+1;return d.insertBefore(a,b.length>=q?b[q]:null)}return a};r(e, -[{key:"textContent",get:function(){return this.data},set:function(b){this.nodeValue=b}}]);return e}(function(g){function e(a,b,c){b=g.call(this,b,c)||this;b._data_=a;return b}n(e,g);r(e,[{key:"data",get:function(){return this._data_},set:function(a){var b=this.data;this._data_=a;w({target:this,type:1,value:a,oldValue:b})}},{key:"length",get:function(){return this._data_.length}},{key:"nodeValue",get:function(){return this._data_},set:function(a){this.data=a}}]);return e}(L)),z=function(){function g(a){var b= -this;this.properties_={};this.storeAttributeMethod_=a.storeAttributeNS_.bind(a);(this.element_=a)&&a.propertyBackedAttributes_&&(a.propertyBackedAttributes_.style=[function(){return b.cssText},function(a){return b.cssText=a}])}var e=g.prototype;e.getPropertyValue=function(a){return this.properties_[a]||""};e.removeProperty=function(a){var b=this.getPropertyValue(a);this.properties_[a]=null;this.mutationCompleteHandler_(this.cssText);return b};e.setProperty=function(a,b){this.properties_[a]=b;this.mutationCompleteHandler_(this.cssText)}; -e.mutationCompleteHandler_=function(a){var b=this.storeAttributeMethod_(null,"style",a);w({type:0,target:this.element_,attributeName:"style",value:a,oldValue:b})};r(g,[{key:"cssText",get:function(){var a,b="",c;for(c in this.properties_)""!==(a=this.getPropertyValue(c))&&(b+=c+": "+a+"; ");return b.trim()},set:function(a){this.properties_={};a=a.split(/[:;]/);for(var b=a.length,c=0;c+1<b;c+=2)this.properties_[a[c].trim().toLowerCase()]=a[c+1].trim();this.mutationCompleteHandler_(this.cssText)}}]); -return g}(),u=function(g){return function(e){return g.includes(e.tagName)}},x=function b(e,a){var c=[];e.children.forEach(function(d){a(d)&&c.push(d);c.push.apply(c,b(d,a))});return c},y=function c(a,b){var d=null;a.children.some(function(a){if(b(a))return d=a,!0;a=c(a,b);return null!==a?(d=a,!0):!1});return d},N=function(a,b){for(;a=a.parentNode;)if(b(a))return a;return null},l=function(a,b){a.forEach(function(a){var c=function(c){var d=a[c][0],q="number"===typeof d,h="boolean"===typeof d,k=a[c][1]|| -c.toLowerCase();Object.defineProperty(b.prototype,c,{enumerable:!0,get:function(){var a=this.getAttribute(k);if(h)return null!==a?"true"===a:d;a=a||d;return q?Number(a):String(a)},set:function(a){this.setAttribute(k,String(a))}})},q;for(q in a)c(q)})},ea=function(a){return 1===a.nodeType},m={},D=function(a){function b(c,q,k){var d,h;c=a.call(this,c,q)||this;c.attributes=[];c.propertyBackedAttributes_={};c.classList=new B(b,t(t(c)),"class","classList","className");c.style=new z(t(t(c)));c.namespaceURI= -k;c._transferredFormat_=(d={},d[7]=c._index_,d[8]=1,d);c._creationFormat_=(h={},h[7]=c._index_,h[8]=0,h[0]=c.nodeType,h[1]=v(c.nodeName),h[6]=null===c.namespaceURI?void 0:v(c.namespaceURI),h);return c}n(b,a);var c=b.prototype;c.hydrate=function(){var a,b;return Object.assign({},this._creationFormat_,0<this.childNodes.length?(a={},a[4]=this.childNodes.map(function(a){return a.hydrate()}),a):{},0<this.attributes.length?(b={},b[2]=this.attributes.map(function(a){return[v(a.namespaceURI||"null"),v(a.name), -v(a.value)]}),b):{})};c.setAttribute=function(a,b){this.setAttributeNS(null,a,b)};c.getAttribute=function(a){return this.getAttributeNS(null,a)};c.removeAttribute=function(a){this.removeAttributeNS(null,a)};c.hasAttribute=function(a){return this.hasAttributeNS(null,a)};c.hasAttributes=function(){return 0<this.attributes.length};c.setAttributeNS=function(a,b,c){if(void 0!==this.propertyBackedAttributes_[b])this.attributes.find(C(a,b))||this.attributes.push({namespaceURI:a,name:b,value:c}),this.propertyBackedAttributes_[b][1](c); -else{var d=this.storeAttributeNS_(a,b,c);w({type:0,target:this,attributeName:b,attributeNamespace:a,value:c,oldValue:d})}};c.storeAttributeNS_=function(a,b,c){var d=this.attributes.find(C(a,b)),q=d&&d.value||"";d?d.value=c:this.attributes.push({namespaceURI:a,name:b,value:c});return q};c.getAttributeNS=function(a,b){return(a=this.attributes.find(C(a,b)))?void 0!==this.propertyBackedAttributes_[b]?this.propertyBackedAttributes_[b][0]():a.value:null};c.removeAttributeNS=function(a,b){var c=this.attributes.findIndex(C(a, -b));if(0<=c){var d=this.attributes[c].value;this.attributes.splice(c,1);w({type:0,target:this,attributeName:b,attributeNamespace:a,oldValue:d})}};c.hasAttributeNS=function(a,b){return this.attributes.some(C(a,b))};c.getElementsByClassName=function(a){var b=a.split(" ");return x(this,function(a){return b.some(function(b){return a.classList.contains(b)})})};c.getElementsByTagName=function(a){return x(this,"*"===a?function(a){return!0}:function(b){return b.tagName===a})};r(b,[{key:"outerHTML",get:function(){return"<"+ -[this.nodeName,qa(this.attributes)].join(" ").trim()+">"+this.innerHTML+"</"+this.nodeName+">"}},{key:"innerHTML",get:function(){var a=this.childNodes;return a.length?a.map(function(a){return 1===a.nodeType?a.outerHTML:a.textContent}).join(""):""}},{key:"textContent",set:function(a){this.childNodes.forEach(function(a){return a.remove()});this.appendChild(new M(a))},get:function(){return a.prototype.textContent}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes.filter(ea)}}, -{key:"childElementCount",get:function(){return this.children.length}},{key:"firstElementChild",get:function(){return this.childNodes.find(ea)||null}},{key:"lastElementChild",get:function(){var a=this.children;return a[a.length-1]||null}}]);return b}(L);l([{id:[""]}],D);var p=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);r(b,[{key:"form",get:function(){return N(this,u(["form"]))}}]);return b}(D);l([{accessKey:[""]},{contentEditable:["inherit"]},{dir:[""]},{lang:[""]},{title:[""]}, -{draggable:[!1]},{hidden:[!1]},{noModule:[!1]},{spellcheck:[!0]},{translate:[!0]}],p);var h=function(a){function b(){var c=a.apply(this,arguments)||this;c.relList=new B(b,t(t(c)),"rel","relList","rel");return c}n(b,a);b.prototype.toString=function(){return this.href};r(b,[{key:"text",get:function(){return this.textContent},set:function(a){this.textContent=a}}]);return b}(p);m.a=h;l([{href:[""]},{hreflang:[""]},{media:[""]},{target:[""]},{type:[""]}],h);h=function(a){function b(){return a.apply(this, -arguments)||this}n(b,a);return b}(p);m.button=h;l([{formAction:[""]},{formEnctype:[""]},{formMethod:[""]},{formTarget:[""]},{name:[""]},{type:["submit"]},{value:[""]},{autofocus:[!1]},{disabled:[!1]}],h);h=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(p);m.data=h;l([{value:[""]}],h);h=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(p);m.embed=h;l([{height:[""]},{src:[""]},{type:[""]},{width:[""]}],h);var ra="button fieldset input object output select textarea".split(" "); -h=function(a){Object.defineProperty(a.prototype,"elements",{get:function(){return x(this,u(ra))}})};var k=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);r(b,[{key:"type",get:function(){return this.tagName}}]);return b}(p);m.fieldset=k;h(k);l([{name:[""]},{disabled:[!1]}],k);k=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);r(b,[{key:"length",get:function(){return this.elements.length}}]);return b}(p);m.form=k;h(k);l([{name:[""]},{method:["get"]},{target:[""]}, -{action:[""]},{enctype:["application/x-www-form-urlencoded"]},{acceptCharset:["","accept-charset"]},{autocomplete:["on"]},{autocapitalize:["sentences"]}],k);h=function(a){function b(){var c=a.apply(this,arguments)||this;c.sandbox=new B(b,t(t(c)),"sandbox",null,null);return c}n(b,a);return b}(p);m.iframe=h;l([{allow:[""]},{allowFullscreen:[!1]},{csp:[""]},{height:[""]},{name:[""]},{referrerPolicy:[""]},{src:[""]},{srcdoc:[""]},{width:[""]}],h);h=function(a){function b(){return a.apply(this,arguments)|| -this}n(b,a);return b}(p);m.img=h;l([{alt:[""]},{crossOrigin:[""]},{height:[0]},{isMap:[!1]},{referrerPolicy:[""]},{src:[""]},{sizes:[""]},{srcset:[""]},{useMap:[""]},{width:[0]}],h);h=function(a){Object.defineProperty(a.prototype,"labels",{get:function(){var a=this;return x(this.ownerDocument||this,function(b){return"label"===b.tagName&&b.for&&b.for===a.id})}})};k=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(p);m.input=k;h(k);l([{formAction:[""]},{formEncType:[""]}, -{formMethod:[""]},{formTarget:[""]},{name:[""]},{type:["text"]},{disabled:[!1]},{autofocus:[!1]},{required:[!1]},{defaultChecked:[!1,"checked"]},{alt:[""]},{height:[0]},{src:[""]},{width:[0]},{accept:[""]},{autocomplete:[""]},{maxLength:[0]},{size:[0]},{pattern:[""]},{placeholder:[""]},{readOnly:[!1]},{min:[""]},{max:[""]},{defaultValue:["","value"]},{dirName:[""]},{multiple:[!1]},{step:[""]},{autocapitalize:[""]}],k);k=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);r(b,[{key:"control", -get:function(){var a=this.getAttribute("for");return null!==a?this.ownerDocument&&this.ownerDocument.getElementById(a):y(this,u(["input"]))}}]);return b}(p);m.label=k;l([{htmlFor:["","for"]}],k);k=function(a){function b(){var c=a.apply(this,arguments)||this;c.relList=new B(b,t(t(c)),"rel","relList","rel");return c}n(b,a);return b}(p);m.link=k;l([{as:[""]},{crossOrigin:[""]},{disabled:[!1]},{href:[""]},{hreflang:[""]},{media:[""]},{referrerPolicy:[""]},{sizes:[""]},{type:[""]}],k);k=function(a){function b(){return a.apply(this, -arguments)||this}n(b,a);r(b,[{key:"areas",get:function(){return x(this,function(a){return"area"===a.tagName})}}]);return b}(p);m.link=k;l([{name:[""]}],k);k=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(p);m.meter=k;h(k);l([{high:[0]},{low:[0]},{max:[1]},{min:[0]},{optimum:[0]},{value:[0]}],k);k=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(p);m.del=k;m.ins=k;l([{cite:[""]},{datetime:[""]}],k);k=function(a){function b(){return a.apply(this, -arguments)||this}n(b,a);return b}(p);m.ol=k;l([{reversed:[!1]},{start:[1]},{type:[""]}],k);k=function(a){function b(b,d,h){var c=a.call(this,b,d,h)||this;c.isSelected=!1;c.propertyBackedAttributes_.selected=[function(){return String(c.isSelected)},function(a){return c.selected="true"===a}];return c}n(b,a);r(b,[{key:"index",get:function(){return this.parentNode&&this.parentNode.children.indexOf(this)||0}},{key:"label",get:function(){return this.getAttribute("label")||this.textContent},set:function(a){this.setAttribute("label", -a)}},{key:"selected",get:function(){return this.isSelected},set:function(a){this.isSelected=a}},{key:"text",get:function(){return this.textContent},set:function(a){this.textContent=a}},{key:"value",get:function(){return this.getAttribute("value")||this.textContent},set:function(a){this.setAttribute("value",a)}}]);return b}(p);m.option=k;l([{defaultSelected:[!1,"selected"]},{disabled:[!1]},{type:[""]}],k);k=function(a){function b(){var b=a.apply(this,arguments)||this;b._indeterminate=!0;b._value=0; -return b}n(b,a);r(b,[{key:"position",get:function(){return this._indeterminate?-1:this._value/this.max}},{key:"value",get:function(){return this._value},set:function(a){this._indeterminate=!1;this._value=a}}]);return b}(p);m.progress=k;h(k);l([{max:[1]}],k);k=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(p);m.blockquote=k;m.q=k;l([{cite:[""]}],k);k=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);r(b,[{key:"text",get:function(){return this.textContent}, -set:function(a){this.textContent=a}}]);return b}(p);m.script=k;l([{type:[""]},{src:[""]},{charset:[""]},{async:[!1]},{defer:[!1]},{crossOrigin:[""]},{noModule:[!1]}],k);var fa=u(["option"]),O=function(a){return"option"===a.tagName&&a.selected};k=function(a){function b(){var b=a.apply(this,arguments)||this;b._size_=-1;return b}n(b,a);r(b,[{key:"length",get:function(){return x(this,fa).length}},{key:"options",get:function(){return this.children.filter(fa)}},{key:"selectedIndex",get:function(){var a= -y(this,O);return a?this.children.indexOf(a):-1},set:function(a){this.children.forEach(function(b,c){b.selected=c===a})}},{key:"selectedOptions",get:function(){return x(this,O)}},{key:"size",get:function(){return-1===this._size_?this.multiple?4:1:this._size_},set:function(a){this._size_=0<a?a:this.multiple?4:1}},{key:"type",get:function(){return this.multiple?"select-one":"select-multiple"}},{key:"value",get:function(){var a=y(this,O);return a?a.value:""}}]);return b}(p);m.select=k;h(k);l([{multiple:[!1]}, -{name:[""]},{required:[!1]}],k);h=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(p);m.source=h;l([{media:[""]},{sizes:[""]},{src:[""]},{srcset:[""]},{type:[""]}],h);h=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(p);m.style=h;l([{media:[""]},{type:[""]}],h);h=function(a){function b(){var c=a.apply(this,arguments)||this;c.headers=new B(b,t(t(c)),"headers",null,null);return c}n(b,a);r(b,[{key:"cellIndex",get:function(){var a=N(this,u(["tr"])); -return null!==a?x(a,u(["th","td"])).indexOf(this):-1}}]);return b}(p);m.th=h;m.td=h;l([{abbr:[""]},{colSpan:[1]},{rowSpan:[1]},{scope:[""]}],h);h=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(p);m.col=h;l([{span:[1]}],h);var P=function(a){return a&&a.remove()},ha=function(a,b,c){var d=y(a,function(a){return!c.includes(a.tagName)});d?a.insertBefore(b,d):a.appendChild(b)};h=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);r(b,[{key:"caption",get:function(){return y(this, -u(["caption"]))},set:function(a){a&&"caption"===a.tagName&&(P(this.caption),this.insertBefore(a,this.firstElementChild))}},{key:"tHead",get:function(){return y(this,u(["thead"]))},set:function(a){a&&"thead"===a.tagName&&(P(this.tHead),ha(this,a,["caption","colgroup"]))}},{key:"tFoot",get:function(){return y(this,u(["tfoot"]))},set:function(a){a&&"tfoot"===a.tagName&&(P(this.tFoot),ha(this,a,["caption","colgroup","thead"]))}},{key:"rows",get:function(){return x(this,u(["tr"]))}},{key:"tBodies",get:function(){return x(this, -u(["tbody"]))}}]);return b}(p);m.table=h;var sa=["table","tbody","thead","tfoot"],ia=function(a,b){b=N(a,b);return null===b?-1:b.rows.indexOf(a)};h=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);var c=b.prototype;c.deleteCell=function(a){(a=this.cells[a])&&a.remove()};c.insertCell=function(a){var b=this.cells,c=this.ownerDocument.createElement("td");0>a||a>=b.length?this.appendChild(c):this.insertBefore(c,this.children[a]);return c};r(b,[{key:"cells",get:function(){return x(this, -u(["td","th"]))}},{key:"rowIndex",get:function(){return ia(this,u(["table"]))}},{key:"sectionRowIndex",get:function(){return ia(this,u(sa))}}]);return b}(p);m.tr=h;h=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);var c=b.prototype;c.deleteRow=function(a){var b=this.rows;(0<=a||a<=b.length)&&b[a].remove()};c.insertRow=function(a){var b=this.rows,c=this.ownerDocument.createElement("tr");0>a||a>=b.length?this.appendChild(c):this.insertBefore(c,this.children[a]);return c};r(b,[{key:"rows", -get:function(){return x(this,u(["tr"]))}}]);return b}(p);m.thead=h;m.tfoot=h;m.tbody=h;h=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(p);m.time=h;l([{dateTime:[""]}],h);var ja=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(D);m.svg=ja;var ca=function(){function a(a,b){this._end=this._stop=!1;this.type=a;this.bubbles=!!b.bubbles;this.cancelable=!!b.cancelable}var b=a.prototype;b.stopPropagation=function(){this._stop=!0};b.stopImmediatePropagation= -function(){this._end=this._stop=!0};b.preventDefault=function(){this.defaultPrevented=!0};return a}(),Y,aa=!1,ba=!1,Z=function(a){return a.map(function(a){return a._transferredFormat_})},ta=function(a){function b(){var c=a.call(this,9,"#document",null)||this;c.documentElement=t(t(c));c.createElement=function(a){return c.createElementNS(null,a)};c.createElementNS=function(a,b){return new (m[b]||p)(1,b,a)};c.createTextNode=function(a){return new M(a)};c.defaultView={document:t(t(c)),MutationObserver:pa, -Document:b,Node:L,Text:M,Element:D,SVGElement:ja,Event:ca};return c}n(b,a);b.prototype.getElementById=function(a){return y(this.body,function(b){return b.id===a})};return b}(D);l=function(a){var b=new ta;b.isConnected=!0;b.appendChild(b.body=b.createElement("body"));a&&(ma(b,a),na(),oa());return b}(self.postMessage);l={document:l,addEventListener:l.addEventListener.bind(l),removeEventListener:l.removeEventListener.bind(l),localStorage:{},location:{},url:"/",appendKeys:function(a){a=a.filter(function(a){return!z.prototype.hasOwnProperty(a)}); -if(!(0>=a.length)){var b=z.prototype.length||0;0!==b?z.prototype.length=b+a.length:Object.defineProperty(z.prototype,"length",{configurable:!0,writable:!0,value:a.length});a.forEach(function(a,d){var c,h=a.replace(/(webkit|ms|moz|khtml)/g,"-$1").replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase();z.prototype[d+b]=h;Object.defineProperties(z.prototype,(c={},c[a]={get:function(){return this.getPropertyValue(h)},set:function(a){this.setProperty(h,a)}},c))})}}};Q.workerDOM=l;return Q}({}); -//# sourceMappingURL=worker.js.map diff --git a/dist/worker.js.map b/dist/worker.js.map deleted file mode 100644 index 3ac44ed10..000000000 --- a/dist/worker.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"worker.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/worker.mjs b/dist/worker.mjs deleted file mode 100644 index 3881682cc..000000000 --- a/dist/worker.mjs +++ /dev/null @@ -1,41 +0,0 @@ -'use strict';var WorkerThread=function(V){function z(a){return!!a&&W.get(a)||null}function X(){const a=A;A=[];return a}function m(a){t.forEach((b)=>{if(b.options.subtreeFlattened&&4!==a.type){var c=a.target,e=b.target;if(null===e||c._index_!==e._index_){do if(e=b.target,null!==e&&c._index_===e._index_){Y(b,a);break}while(c=c.parentNode)}}else Y(b,a)})}function k(a){if(B.has(a))return B.get(a);B.set(a,++Z);C.push(a);return Z}function aa(){const a=C;C=[];return a}function Ba(a){X();const b=ba.body.hydrate(), -c=[];a.forEach((a)=>{4===a.type&&a.addedEvents&&a.addedEvents.forEach((a)=>{c.push(a)})});return{9:2,39:aa(),35:b,20:c}}function Ca(a){const b=X().map((a)=>a._creationFormat_),c=[];a.forEach((a)=>{let b={9:a.type,10:a.target._index_};a.addedNodes&&(b[11]=ca(a.addedNodes));a.removedNodes&&(b[12]=ca(a.removedNodes));a.nextSibling&&(b[14]=a.nextSibling._transferredFormat_);null!=a.attributeName&&(b[15]=k(a.attributeName));null!=a.attributeNamespace&&(b[16]=k(a.attributeNamespace));null!= -a.oldValue&&(b[19]=k(a.oldValue));a.propertyName&&(b[17]=k(a.propertyName));null!=a.value&&(b[18]=k(a.value));a.addedEvents&&(b[20]=a.addedEvents);a.removedEvents&&(b[21]=a.removedEvents);c.push(b)});return{9:3,39:aa(),35:b,34:c}}function Da(a,b){da||(ba=a,(new a.defaultView.MutationObserver((a)=>{b&&b(!1===ea?Ba(a):Ca(a));ea=!0})).observe(a.body),da=!0)}function Ea(){"undefined"!==typeof addEventListener&&addEventListener("message",({data:a})=>{if(1===a[9]){a=a[37];var b=z(a[7]);if(null!== -b){const c=a[10];b.dispatchEvent(Object.assign(new fa(a[9],{bubbles:a[22],cancelable:a[23]}),{cancelBubble:a[24],defaultPrevented:a[26],eventPhase:a[27],isTrusted:a[28],returnValue:a[29],target:z(c?c[7]:null),timeStamp:a[30],scoped:a[31],keyCode:a[32]}))}}})}function Fa(){"function"===typeof addEventListener&&addEventListener("message",({data:a})=>{if(5===a[9]){a=a[38];var b=z(a[7]);b&&(b.value=a[18])}})}let ha=0,A=[];const W=new Map,t=[];let D=!1;const Y=(a,b)=>{a.pushRecord(b);D||(D=!0,Promise.resolve().then(()=> -{D=!1;t.forEach((a)=>a.callback(a.takeRecords()))}))};class Ga{constructor(a){this._records_=[];this.callback=a}observe(a,b){this.disconnect();this.target=a;this.options=Object.assign({subtreeFlattened:!1},b);t.push(this)}disconnect(){this.target=null;const a=t.indexOf(this);0<=a&&t.splice(a,1)}takeRecords(){return this._records_.splice(0,this._records_.length)}pushRecord(a){this._records_.push(a)}}let Z=0,C=[];const B=new Map;let E=null;const u=(a,b,c)=>{a[b]=c;a.childNodes.forEach((a)=>u(a,b,c))}; -class F{constructor(a,b){this.childNodes=[];this.parentNode=null;this.isConnected=!1;this._handlers_={};this.nodeType=a;this.nodeName=b;null===E&&(E=this);this.ownerDocument=E;void 0!==this._index_?a=this._index_:(W.set(this._index_=++ha,this),A.push(this),a=ha);this._index_=a}get textContent(){let a="";const b=this.childNodes;return b.length?(b.forEach((b)=>a+=b.textContent),a):""}get firstChild(){return 0<this.childNodes.length?this.childNodes[0]:null}get lastChild(){return 0<this.childNodes.length? -this.childNodes[this.childNodes.length-1]:null}get nextSibling(){if(null===this.parentNode)return null;const a=this.parentNode.childNodes;return a[a.indexOf(this)+1]||null}get previousSibling(){if(null===this.parentNode)return null;const a=this.parentNode.childNodes;return a[a.indexOf(this)-1]||null}hasChildNodes(){return 0<this.childNodes.length}contains(a){return 0<this.childNodes.length?this.childNodes.includes(this)?!0:this.childNodes.some((b)=>b.contains(a)):a===this}insertBefore(a,b){return null=== -a?null:a===this?a:null==b?(this.appendChild(a),m({addedNodes:[a],type:2,target:this}),a):0<=this.childNodes.indexOf(b)?(a.remove(),this.childNodes.splice(this.childNodes.indexOf(b),0,a),a.parentNode=this,u(a,"isConnected",this.isConnected),m({addedNodes:[a],nextSibling:b,type:2,target:this}),a):null}appendChild(a){a.remove();a.parentNode=this;u(a,"isConnected",this.isConnected);this.childNodes.push(a);m({addedNodes:[a],previousSibling:this.childNodes[this.childNodes.length-2],type:2,target:this})}removeChild(a){const b= -this.childNodes.indexOf(a);return 0<=b?(a.parentNode=null,u(a,"isConnected",!1),this.childNodes.splice(b,1),m({removedNodes:[a],type:2,target:this}),a):null}replaceChild(a,b){if(a!==b){const c=this.childNodes.indexOf(b);0<=c&&(b.parentNode=null,u(b,"isConnected",!1),this.childNodes.splice(c,1,a),m({addedNodes:[a],removedNodes:[b],type:2,target:this}))}return b}remove(){this.parentNode&&this.parentNode.removeChild(this)}addEventListener(a,b){const c=this._handlers_[a.toLowerCase()];let e=0;c&&0<c.length? -e=c.push(b):this._handlers_[a.toLowerCase()]=[b];m({target:this,type:4,addedEvents:[{9:k(a),7:this._index_,33:e}]})}removeEventListener(a,b){const c=this._handlers_[a.toLowerCase()];b=c?c.indexOf(b):-1;0<=b&&(c.splice(b,1),m({target:this,type:4,removedEvents:[{9:k(a),7:this._index_,33:b}]}))}dispatchEvent(a){let b=a.currentTarget=this,c,e;do if(c=b&&b._handlers_&&b._handlers_[a.type.toLowerCase()])for(e=c.length;e--&&(!1!==c[e].call(b,a)&&!a._end||!a.cancelable););while(a.bubbles&&(!a.cancelable|| -!a._stop)&&(b=b&&b.parentNode));return!a.defaultPrevented}}class v{constructor(a,b,c,e,d){this.array_=[];this.element_=b;this.attributeName_=c;this.storeAttributeMethod_=b.storeAttributeNS_.bind(b);b.propertyBackedAttributes_[c]=[()=>this.value,(a)=>this.value=a];e&&d&&Object.defineProperty(a.prototype,d,{enumerable:!0,configurable:!0,get(){return this[e].value},set(a){this[e].value=a}})}get value(){return this.array_.join(" ")}get length(){return this.array_.length}set value(a){const b=this.value; -a=a.trim();this.array_.splice(0,this.array_.length,...""!==a?a.split(/\s+/):"");this.mutationCompleteHandler_(b,a)}item(a){return this.array_[a]}contains(a){return this.array_.includes(a)}add(...a){const b=this.value;this.array_.splice(0,this.array_.length,...new Set(this.array_.concat(a)));this.mutationCompleteHandler_(b,this.value)}remove(...a){const b=this.value;this.array_.splice(0,this.array_.length,...new Set(this.array_.filter((b)=>!a.includes(b))));this.mutationCompleteHandler_(b,this.value)}replace(a, -b){if(this.array_.includes(a)){var c=this.value,e=new Set(this.array_);a!==b&&(e.delete(a),""!==b&&e.add(b));this.array_.splice(0,this.array_.length,...e);this.mutationCompleteHandler_(c,this.value)}}toggle(a,b){if(!this.array_.includes(a))!1!==b&&this.add(a);else if(!0!==b)return this.remove(a),!1;return!0}mutationCompleteHandler_(a,b){this.storeAttributeMethod_(null,this.attributeName_,b);m({type:0,target:this.element_,attributeName:this.attributeName_,value:b,oldValue:a})}}const Ha=(a)=>a.map(({name:a, -value:c})=>`${a}="${c}"`).join(" "),w=(a,b)=>(c)=>c.namespaceURI===a&&c.name===b;class Ia extends F{constructor(a,b,c){super(b,c);this._data_=a}get data(){return this._data_}set data(a){const b=this.data;this._data_=a;m({target:this,type:1,value:a,oldValue:b})}get length(){return this._data_.length}get nodeValue(){return this._data_}set nodeValue(a){this.data=a}}class x extends Ia{constructor(a){super(a,3,"#text");this._transferredFormat_={7:this._index_,8:1};this._creationFormat_={7:this._index_, -8:0,0:3,1:k("#text"),5:k(this.data)}}hydrate(){return this._creationFormat_}get textContent(){return this.data}set textContent(a){this.nodeValue=a}splitText(a){const b=new x(this.data.slice(a,this.data.length)),c=this.parentNode;this.nodeValue=this.data.slice(0,a);if(null!==c){a=c.childNodes;const e=a.indexOf(this)+1;return c.insertBefore(b,a.length>=e?a[e]:null)}return b}}class p{constructor(a){this.properties_={};this.storeAttributeMethod_=a.storeAttributeNS_.bind(a);(this.element_=a)&& -a.propertyBackedAttributes_&&(a.propertyBackedAttributes_.style=[()=>this.cssText,(a)=>this.cssText=a])}getPropertyValue(a){return this.properties_[a]||""}removeProperty(a){const b=this.getPropertyValue(a);this.properties_[a]=null;this.mutationCompleteHandler_(this.cssText);return b}setProperty(a,b){this.properties_[a]=b;this.mutationCompleteHandler_(this.cssText)}get cssText(){let a,b="";for(let c in this.properties_)""!==(a=this.getPropertyValue(c))&&(b+=`${c}: ${a}; `);return b.trim()}set cssText(a){this.properties_= -{};a=a.split(/[:;]/);const b=a.length;for(let c=0;c+1<b;c+=2)this.properties_[a[c].trim().toLowerCase()]=a[c+1].trim();this.mutationCompleteHandler_(this.cssText)}mutationCompleteHandler_(a){const b=this.storeAttributeMethod_(null,"style",a);m({type:0,target:this.element_,attributeName:"style",value:a,oldValue:b})}}const h=(a)=>(b)=>a.includes(b.tagName),l=(a,b)=>{const c=[];a.children.forEach((a)=>{b(a)&&c.push(a);c.push(...l(a,b))});return c},n=(a,b)=>{let c=null;a.children.some((a)=>{if(b(a))return c= -a,!0;a=n(a,b);return null!==a?(c=a,!0):!1});return c},G=(a,b)=>{for(;a=a.parentNode;)if(b(a))return a;return null};var d=(a,b)=>{a.forEach((a)=>{for(let c in a){const e=a[c][0],d="number"===typeof e,f="boolean"===typeof e,g=a[c][1]||c.toLowerCase();Object.defineProperty(b.prototype,c,{enumerable:!0,get(){var a=this.getAttribute(g);if(f)return null!==a?"true"===a:e;a=a||e;return d?Number(a):String(a)},set(a){this.setAttribute(g,String(a))}})}})};const ia=(a)=>1===a.nodeType,f={};class r extends F{constructor(a, -b,c){super(a,b);this.attributes=[];this.propertyBackedAttributes_={};this.classList=new v(r,this,"class","classList","className");this.style=new p(this);this.namespaceURI=c;this._transferredFormat_={7:this._index_,8:1};this._creationFormat_={7:this._index_,8:0,0:this.nodeType,1:k(this.nodeName),6:null===this.namespaceURI?void 0:k(this.namespaceURI)}}hydrate(){return Object.assign({},this._creationFormat_,0<this.childNodes.length?{4:this.childNodes.map((a)=>a.hydrate())}:{},0<this.attributes.length? -{2:this.attributes.map((a)=>[k(a.namespaceURI||"null"),k(a.name),k(a.value)])}:{})}get outerHTML(){return`<${[this.nodeName,Ha(this.attributes)].join(" ").trim()}>${this.innerHTML}</${this.nodeName}>`}get innerHTML(){const a=this.childNodes;return a.length?a.map((a)=>1===a.nodeType?a.outerHTML:a.textContent).join(""):""}set textContent(a){this.childNodes.forEach((a)=>a.remove());this.appendChild(new x(a))}get textContent(){return super.textContent}get tagName(){return this.nodeName}get children(){return this.childNodes.filter(ia)}get childElementCount(){return this.children.length}get firstElementChild(){return this.childNodes.find(ia)|| -null}get lastElementChild(){const a=this.children;return a[a.length-1]||null}setAttribute(a,b){this.setAttributeNS(null,a,b)}getAttribute(a){return this.getAttributeNS(null,a)}removeAttribute(a){this.removeAttributeNS(null,a)}hasAttribute(a){return this.hasAttributeNS(null,a)}hasAttributes(){return 0<this.attributes.length}setAttributeNS(a,b,c){if(void 0!==this.propertyBackedAttributes_[b])this.attributes.find(w(a,b))||this.attributes.push({namespaceURI:a,name:b,value:c}),this.propertyBackedAttributes_[b][1](c); -else{var e=this.storeAttributeNS_(a,b,c);m({type:0,target:this,attributeName:b,attributeNamespace:a,value:c,oldValue:e})}}storeAttributeNS_(a,b,c){const e=this.attributes.find(w(a,b)),d=e&&e.value||"";e?e.value=c:this.attributes.push({namespaceURI:a,name:b,value:c});return d}getAttributeNS(a,b){return(a=this.attributes.find(w(a,b)))?void 0!==this.propertyBackedAttributes_[b]?this.propertyBackedAttributes_[b][0]():a.value:null}removeAttributeNS(a,b){const c=this.attributes.findIndex(w(a,b));if(0<= -c){const e=this.attributes[c].value;this.attributes.splice(c,1);m({type:0,target:this,attributeName:b,attributeNamespace:a,oldValue:e})}}hasAttributeNS(a,b){return this.attributes.some(w(a,b))}getElementsByClassName(a){const b=a.split(" ");return l(this,(a)=>b.some((b)=>a.classList.contains(b)))}getElementsByTagName(a){return l(this,"*"===a?(a)=>!0:(b)=>b.tagName===a)}}d([{id:[""]}],r);class g extends r{get form(){return G(this,h(["form"]))}}d([{accessKey:[""]},{contentEditable:["inherit"]},{dir:[""]}, -{lang:[""]},{title:[""]},{draggable:[!1]},{hidden:[!1]},{noModule:[!1]},{spellcheck:[!0]},{translate:[!0]}],g);class H extends g{constructor(){super(...arguments);this.relList=new v(H,this,"rel","relList","rel")}toString(){return this.href}get text(){return this.textContent}set text(a){this.textContent=a}}f.a=H;d([{href:[""]},{hreflang:[""]},{media:[""]},{target:[""]},{type:[""]}],H);class ja extends g{}f.button=ja;d([{formAction:[""]},{formEnctype:[""]},{formMethod:[""]},{formTarget:[""]},{name:[""]}, -{type:["submit"]},{value:[""]},{autofocus:[!1]},{disabled:[!1]}],ja);class ka extends g{}f.data=ka;d([{value:[""]}],ka);class la extends g{}f.embed=la;d([{height:[""]},{src:[""]},{type:[""]},{width:[""]}],la);const Ja="button fieldset input object output select textarea".split(" ");var q=(a)=>{Object.defineProperty(a.prototype,"elements",{get(){return l(this,h(Ja))}})};class I extends g{get type(){return this.tagName}}f.fieldset=I;q(I);d([{name:[""]},{disabled:[!1]}],I);class J extends g{get length(){return this.elements.length}} -f.form=J;q(J);d([{name:[""]},{method:["get"]},{target:[""]},{action:[""]},{enctype:["application/x-www-form-urlencoded"]},{acceptCharset:["","accept-charset"]},{autocomplete:["on"]},{autocapitalize:["sentences"]}],J);class K extends g{constructor(){super(...arguments);this.sandbox=new v(K,this,"sandbox",null,null)}}f.iframe=K;d([{allow:[""]},{allowFullscreen:[!1]},{csp:[""]},{height:[""]},{name:[""]},{referrerPolicy:[""]},{src:[""]},{srcdoc:[""]},{width:[""]}],K);class ma extends g{}f.img=ma;d([{alt:[""]}, -{crossOrigin:[""]},{height:[0]},{isMap:[!1]},{referrerPolicy:[""]},{src:[""]},{sizes:[""]},{srcset:[""]},{useMap:[""]},{width:[0]}],ma);q=(a)=>{Object.defineProperty(a.prototype,"labels",{get(){return l(this.ownerDocument||this,(a)=>"label"===a.tagName&&a.for&&a.for===this.id)}})};class L extends g{}f.input=L;q(L);d([{formAction:[""]},{formEncType:[""]},{formMethod:[""]},{formTarget:[""]},{name:[""]},{type:["text"]},{disabled:[!1]},{autofocus:[!1]},{required:[!1]},{defaultChecked:[!1,"checked"]}, -{alt:[""]},{height:[0]},{src:[""]},{width:[0]},{accept:[""]},{autocomplete:[""]},{maxLength:[0]},{size:[0]},{pattern:[""]},{placeholder:[""]},{readOnly:[!1]},{min:[""]},{max:[""]},{defaultValue:["","value"]},{dirName:[""]},{multiple:[!1]},{step:[""]},{autocapitalize:[""]}],L);class na extends g{get control(){const a=this.getAttribute("for");return null!==a?this.ownerDocument&&this.ownerDocument.getElementById(a):n(this,h(["input"]))}}f.label=na;d([{htmlFor:["","for"]}],na);class M extends g{constructor(){super(...arguments); -this.relList=new v(M,this,"rel","relList","rel")}}f.link=M;d([{as:[""]},{crossOrigin:[""]},{disabled:[!1]},{href:[""]},{hreflang:[""]},{media:[""]},{referrerPolicy:[""]},{sizes:[""]},{type:[""]}],M);class oa extends g{get areas(){return l(this,(a)=>"area"===a.tagName)}}f.link=oa;d([{name:[""]}],oa);class N extends g{}f.meter=N;q(N);d([{high:[0]},{low:[0]},{max:[1]},{min:[0]},{optimum:[0]},{value:[0]}],N);class O extends g{}f.del=O;f.ins=O;d([{cite:[""]},{datetime:[""]}],O);class pa extends g{}f.ol= -pa;d([{reversed:[!1]},{start:[1]},{type:[""]}],pa);class qa extends g{constructor(a,b,c){super(a,b,c);this.isSelected=!1;this.propertyBackedAttributes_.selected=[()=>String(this.isSelected),(a)=>this.selected="true"===a]}get index(){return this.parentNode&&this.parentNode.children.indexOf(this)||0}get label(){return this.getAttribute("label")||this.textContent}set label(a){this.setAttribute("label",a)}get selected(){return this.isSelected}set selected(a){this.isSelected=a}get text(){return this.textContent}set text(a){this.textContent= -a}get value(){return this.getAttribute("value")||this.textContent}set value(a){this.setAttribute("value",a)}}f.option=qa;d([{defaultSelected:[!1,"selected"]},{disabled:[!1]},{type:[""]}],qa);class P extends g{constructor(){super(...arguments);this._indeterminate=!0;this._value=0}get position(){return this._indeterminate?-1:this._value/this.max}get value(){return this._value}set value(a){this._indeterminate=!1;this._value=a}}f.progress=P;q(P);d([{max:[1]}],P);class Q extends g{}f.blockquote=Q;f.q= -Q;d([{cite:[""]}],Q);class ra extends g{get text(){return this.textContent}set text(a){this.textContent=a}}f.script=ra;d([{type:[""]},{src:[""]},{charset:[""]},{async:[!1]},{defer:[!1]},{crossOrigin:[""]},{noModule:[!1]}],ra);const sa=h(["option"]),R=(a)=>"option"===a.tagName&&a.selected;class S extends g{constructor(){super(...arguments);this._size_=-1}get length(){return l(this,sa).length}get options(){return this.children.filter(sa)}get selectedIndex(){const a=n(this,R);return a?this.children.indexOf(a): --1}set selectedIndex(a){this.children.forEach((b,c)=>{b.selected=c===a})}get selectedOptions(){return l(this,R)}get size(){return-1===this._size_?this.multiple?4:1:this._size_}set size(a){this._size_=0<a?a:this.multiple?4:1}get type(){return this.multiple?"select-one":"select-multiple"}get value(){const a=n(this,R);return a?a.value:""}}f.select=S;q(S);d([{multiple:[!1]},{name:[""]},{required:[!1]}],S);class ta extends g{}f.source=ta;d([{media:[""]},{sizes:[""]},{src:[""]},{srcset:[""]},{type:[""]}], -ta);class ua extends g{}f.style=ua;d([{media:[""]},{type:[""]}],ua);class y extends g{constructor(){super(...arguments);this.headers=new v(y,this,"headers",null,null)}get cellIndex(){const a=G(this,h(["tr"]));return null!==a?l(a,h(["th","td"])).indexOf(this):-1}}f.th=y;f.td=y;d([{abbr:[""]},{colSpan:[1]},{rowSpan:[1]},{scope:[""]}],y);class va extends g{}f.col=va;d([{span:[1]}],va);const T=(a)=>a&&a.remove(),wa=(a,b,c)=>{const d=n(a,(a)=>!c.includes(a.tagName));d?a.insertBefore(b,d):a.appendChild(b)}; -class Ka extends g{get caption(){return n(this,h(["caption"]))}set caption(a){a&&"caption"===a.tagName&&(T(this.caption),this.insertBefore(a,this.firstElementChild))}get tHead(){return n(this,h(["thead"]))}set tHead(a){a&&"thead"===a.tagName&&(T(this.tHead),wa(this,a,["caption","colgroup"]))}get tFoot(){return n(this,h(["tfoot"]))}set tFoot(a){a&&"tfoot"===a.tagName&&(T(this.tFoot),wa(this,a,["caption","colgroup","thead"]))}get rows(){return l(this,h(["tr"]))}get tBodies(){return l(this,h(["tbody"]))}} -f.table=Ka;const La=["table","tbody","thead","tfoot"],xa=(a,b)=>{b=G(a,b);return null===b?-1:b.rows.indexOf(a)};class Ma extends g{get cells(){return l(this,h(["td","th"]))}get rowIndex(){return xa(this,h(["table"]))}get sectionRowIndex(){return xa(this,h(La))}deleteCell(a){(a=this.cells[a])&&a.remove()}insertCell(a){const b=this.cells,c=this.ownerDocument.createElement("td");0>a||a>=b.length?this.appendChild(c):this.insertBefore(c,this.children[a]);return c}}f.tr=Ma;class U extends g{get rows(){return l(this, -h(["tr"]))}deleteRow(a){const b=this.rows;(0<=a||a<=b.length)&&b[a].remove()}insertRow(a){const b=this.rows,c=this.ownerDocument.createElement("tr");0>a||a>=b.length?this.appendChild(c):this.insertBefore(c,this.children[a]);return c}}f.thead=U;f.tfoot=U;f.tbody=U;class ya extends g{}f.time=ya;d([{dateTime:[""]}],ya);class za extends r{}f.svg=za;class fa{constructor(a,b){this._end=this._stop=!1;this.type=a;this.bubbles=!!b.bubbles;this.cancelable=!!b.cancelable}stopPropagation(){this._stop=!0}stopImmediatePropagation(){this._end= -this._stop=!0}preventDefault(){this.defaultPrevented=!0}}let ba,da=!1,ea=!1;const ca=(a)=>a.map((a)=>a._transferredFormat_);class Aa extends r{constructor(){super(9,"#document",null);this.documentElement=this;this.createElement=(a)=>this.createElementNS(null,a);this.createElementNS=(a,b)=>new (f[b]||g)(1,b,a);this.createTextNode=(a)=>new x(a);this.defaultView={document:this,MutationObserver:Ga,Document:Aa,Node:F,Text:x,Element:r,SVGElement:za,Event:fa}}getElementById(a){return n(this.body,(b)=>b.id=== -a)}}d=function(a){const b=new Aa;b.isConnected=!0;b.appendChild(b.body=b.createElement("body"));a&&(Da(b,a),Ea(),Fa());return b}(self.postMessage);d={document:d,addEventListener:d.addEventListener.bind(d),removeEventListener:d.removeEventListener.bind(d),localStorage:{},location:{},url:"/",appendKeys:(a)=>{a=a.filter((a)=>!p.prototype.hasOwnProperty(a));if(!(0>=a.length)){var b=p.prototype.length||0;0!==b?p.prototype.length=b+a.length:Object.defineProperty(p.prototype,"length",{configurable:!0,writable:!0, -value:a.length});a.forEach((a,d)=>{const c=a.replace(/(webkit|ms|moz|khtml)/g,"-$1").replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase();p.prototype[d+b]=c;Object.defineProperties(p.prototype,{[a]:{get(){return this.getPropertyValue(c)},set(a){this.setProperty(c,a)}}})})}}};V.workerDOM=d;return V}({}); -//# sourceMappingURL=worker.mjs.map diff --git a/dist/worker.mjs.map b/dist/worker.mjs.map deleted file mode 100644 index ea99e047a..000000000 --- a/dist/worker.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"worker.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/worker.safe.js b/dist/worker.safe.js deleted file mode 100644 index 00d6311e9..000000000 --- a/dist/worker.safe.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict';var WorkerThread=function(Q){function R(f,g){for(var e=0;e<g.length;e++){var a=g[e];a.enumerable=a.enumerable||!1;a.configurable=!0;"value"in a&&(a.writable=!0);Object.defineProperty(f,a.key,a)}}function r(f,g,e){g&&R(f.prototype,g);e&&R(f,e);return f}function n(f,g){f.prototype=Object.create(g.prototype);f.prototype.constructor=f;f.__proto__=g}function t(f){if(void 0===f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}function F(f){return!!f&& -S.get(f)||null}function T(){var f=G;G=[];return f}function w(f){A.forEach(function(g){if(g.options.subtreeFlattened&&4!==f.type){var e=f.target;if(!U(g.target,e)){do if(U(g.target,e)){V(g,f);break}while(e=e.parentNode)}}else V(g,f)})}function v(f){if(H.has(f))return H.get(f);H.set(f,++W);I.push(f);return W}function X(){var f=I;I=[];return f}function ka(f){var g;T();var e=Y.body.hydrate(),a=[];f.forEach(function(b){4===b.type&&b.addedEvents&&b.addedEvents.forEach(function(b){a.push(b)})});return g= -{},g[9]=2,g[39]=X(),g[35]=e,g[20]=a,g}function la(f){var g,e=T().map(function(b){return b._creationFormat_}),a=[];f.forEach(function(b){var c,d=(c={},c[9]=b.type,c[10]=b.target._index_,c);b.addedNodes&&(d[11]=Z(b.addedNodes));b.removedNodes&&(d[12]=Z(b.removedNodes));b.nextSibling&&(d[14]=b.nextSibling._transferredFormat_);null!=b.attributeName&&(d[15]=v(b.attributeName));null!=b.attributeNamespace&&(d[16]=v(b.attributeNamespace));null!=b.oldValue&&(d[19]=v(b.oldValue));b.propertyName&&(d[17]=v(b.propertyName)); -null!=b.value&&(d[18]=v(b.value));b.addedEvents&&(d[20]=b.addedEvents);b.removedEvents&&(d[21]=b.removedEvents);a.push(d)});return g={},g[9]=3,g[39]=X(),g[35]=e,g[34]=a,g}function ma(f,g){aa||(Y=f,(new f.defaultView.MutationObserver(function(e){g&&g(!1===ba?ka(e):la(e));ba=!0})).observe(f.body),aa=!0)}function na(){"undefined"!==typeof addEventListener&&addEventListener("message",function(f){f=f.data;if(1===f[9]){f=f[37];var g=F(f[7]);if(null!==g){var e=f[10];g.dispatchEvent(Object.assign(new ca(f[9], -{bubbles:f[22],cancelable:f[23]}),{cancelBubble:f[24],defaultPrevented:f[26],eventPhase:f[27],isTrusted:f[28],returnValue:f[29],target:F(e?e[7]:null),timeStamp:f[30],scoped:f[31],keyCode:f[32]}))}}})}function oa(){"function"===typeof addEventListener&&addEventListener("message",function(f){f=f.data;if(5===f[9]){f=f[38];var g=F(f[7]);g&&(g.value=f[18])}})}var da=0,G=[],S=new Map,A=[],J=!1,U=function(f,g){return null!==f&&g._index_===f._index_},V=function(f,g){f.pushRecord(g);J||(J=!0,Promise.resolve().then(function(){J= -!1;A.forEach(function(e){return e.callback(e.takeRecords())})}))},pa=function(){function f(e){this._records_=[];this.callback=e}var g=f.prototype;g.observe=function(e,a){this.disconnect();this.target=e;this.options=Object.assign({subtreeFlattened:!1},a);A.push(this)};g.disconnect=function(){this.target=null;var e=A.indexOf(this);0<=e&&A.splice(e,1)};g.takeRecords=function(){return this._records_.splice(0,this._records_.length)};g.pushRecord=function(e){this._records_.push(e)};return f}(),W=0,I=[], -H=new Map,K=null,E=function b(g,e,a){g[e]=a;g.childNodes.forEach(function(c){return b(c,e,a)})},L=function(){function g(a,b){this.childNodes=[];this.parentNode=null;this.isConnected=!1;this._handlers_={};this.nodeType=a;this.nodeName=b;null===K&&(K=this);this.ownerDocument=K;void 0!==this._index_?a=this._index_:(S.set(this._index_=++da,this),G.push(this),a=da);this._index_=a}var e=g.prototype;e.hasChildNodes=function(){return 0<this.childNodes.length};e.contains=function(a){return 0<this.childNodes.length? -this.childNodes.includes(this)?!0:this.childNodes.some(function(b){return b.contains(a)}):a===this};e.insertBefore=function(a,b){return null===a?null:a===this?a:null==b?(this.appendChild(a),w({addedNodes:[a],type:2,target:this}),a):0<=this.childNodes.indexOf(b)?(a.remove(),this.childNodes.splice(this.childNodes.indexOf(b),0,a),a.parentNode=this,E(a,"isConnected",this.isConnected),w({addedNodes:[a],nextSibling:b,type:2,target:this}),a):null};e.appendChild=function(a){a.remove();a.parentNode=this;E(a, -"isConnected",this.isConnected);this.childNodes.push(a);w({addedNodes:[a],previousSibling:this.childNodes[this.childNodes.length-2],type:2,target:this})};e.removeChild=function(a){var b=this.childNodes.indexOf(a);return 0<=b?(a.parentNode=null,E(a,"isConnected",!1),this.childNodes.splice(b,1),w({removedNodes:[a],type:2,target:this}),a):null};e.replaceChild=function(a,b){if(a!==b){var c=this.childNodes.indexOf(b);0<=c&&(b.parentNode=null,E(b,"isConnected",!1),this.childNodes.splice(c,1,a),w({addedNodes:[a], -removedNodes:[b],type:2,target:this}))}return b};e.remove=function(){this.parentNode&&this.parentNode.removeChild(this)};e.addEventListener=function(a,b){var c,d=this._handlers_[a.toLowerCase()],q=0;d&&0<d.length?q=d.push(b):this._handlers_[a.toLowerCase()]=[b];w({target:this,type:4,addedEvents:[(c={},c[9]=v(a),c[7]=this._index_,c[33]=q,c)]})};e.removeEventListener=function(a,b){var c=this._handlers_[a.toLowerCase()];b=c?c.indexOf(b):-1;if(0<=b){var d;c.splice(b,1);w({target:this,type:4,removedEvents:[(d= -{},d[9]=v(a),d[7]=this._index_,d[33]=b,d)]})}};e.dispatchEvent=function(a){var b=a.currentTarget=this,c,d;do if(c=b&&b._handlers_&&b._handlers_[a.type.toLowerCase()])for(d=c.length;d--&&(!1!==c[d].call(b,a)&&!a._end||!a.cancelable););while(a.bubbles&&(!a.cancelable||!a._stop)&&(b=b&&b.parentNode));return!a.defaultPrevented};r(g,[{key:"textContent",get:function(){var a="",b=this.childNodes;return b.length?(b.forEach(function(b){return a+=b.textContent}),a):""}},{key:"firstChild",get:function(){return 0< -this.childNodes.length?this.childNodes[0]:null}},{key:"lastChild",get:function(){return 0<this.childNodes.length?this.childNodes[this.childNodes.length-1]:null}},{key:"nextSibling",get:function(){if(null===this.parentNode)return null;var a=this.parentNode.childNodes;return a[a.indexOf(this)+1]||null}},{key:"previousSibling",get:function(){if(null===this.parentNode)return null;var a=this.parentNode.childNodes;return a[a.indexOf(this)-1]||null}}]);return g}(),B=function(){function g(a,b,c,d,q){var e= -this;this.array_=[];this.element_=b;this.attributeName_=c;this.storeAttributeMethod_=b.storeAttributeNS_.bind(b);b.propertyBackedAttributes_[c]=[function(){return e.value},function(b){return e.value=b}];d&&q&&Object.defineProperty(a.prototype,q,{enumerable:!0,configurable:!0,get:function(){return this[d].value},set:function(b){this[d].value=b}})}var e=g.prototype;e.item=function(a){return this.array_[a]};e.contains=function(a){return this.array_.includes(a)};e.add=function(){for(var a,b=this.value, -c=arguments.length,d=Array(c),q=0;q<c;q++)d[q]=arguments[q];(a=this.array_).splice.apply(a,[0,this.array_.length].concat(new Set(this.array_.concat(d))));this.mutationCompleteHandler_(b,this.value)};e.remove=function(){for(var a,b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];b=this.value;(a=this.array_).splice.apply(a,[0,this.array_.length].concat(new Set(this.array_.filter(function(b){return!c.includes(b)}))));this.mutationCompleteHandler_(b,this.value)};e.replace=function(a,b){var c; -if(this.array_.includes(a)){var d=this.value,q=new Set(this.array_);a!==b&&(q.delete(a),""!==b&&q.add(b));(c=this.array_).splice.apply(c,[0,this.array_.length].concat(q));this.mutationCompleteHandler_(d,this.value)}};e.toggle=function(a,b){if(!this.array_.includes(a))!1!==b&&this.add(a);else if(!0!==b)return this.remove(a),!1;return!0};e.mutationCompleteHandler_=function(a,b){this.storeAttributeMethod_(null,this.attributeName_,b);w({type:0,target:this.element_,attributeName:this.attributeName_,value:b, -oldValue:a})};r(g,[{key:"value",get:function(){return this.array_.join(" ")},set:function(a){var b,c=this.value;a=a.trim();(b=this.array_).splice.apply(b,[0,this.array_.length].concat(""!==a?a.split(/\s+/):""));this.mutationCompleteHandler_(c,a)}},{key:"length",get:function(){return this.array_.length}}]);return g}(),qa=function(g){return g.map(function(e){return e.name+'="'+e.value+'"'}).join(" ")},C=function(g,e){return function(a){return a.namespaceURI===g&&a.name===e}},M=function(g){function e(b){var a, -d;b=g.call(this,b,3,"#text")||this;b._transferredFormat_=(a={},a[7]=b._index_,a[8]=1,a);b._creationFormat_=(d={},d[7]=b._index_,d[8]=0,d[0]=3,d[1]=v("#text"),d[5]=v(b.data),d);return b}n(e,g);var a=e.prototype;a.hydrate=function(){return this._creationFormat_};a.splitText=function(b){var a=new e(this.data.slice(b,this.data.length)),d=this.parentNode;this.nodeValue=this.data.slice(0,b);if(null!==d){b=d.childNodes;var q=b.indexOf(this)+1;return d.insertBefore(a,b.length>=q?b[q]:null)}return a};r(e, -[{key:"textContent",get:function(){return this.data},set:function(b){this.nodeValue=b}}]);return e}(function(g){function e(a,b,c){b=g.call(this,b,c)||this;b._data_=a;return b}n(e,g);r(e,[{key:"data",get:function(){return this._data_},set:function(a){var b=this.data;this._data_=a;w({target:this,type:1,value:a,oldValue:b})}},{key:"length",get:function(){return this._data_.length}},{key:"nodeValue",get:function(){return this._data_},set:function(a){this.data=a}}]);return e}(L)),z=function(){function g(a){var b= -this;this.properties_={};this.storeAttributeMethod_=a.storeAttributeNS_.bind(a);(this.element_=a)&&a.propertyBackedAttributes_&&(a.propertyBackedAttributes_.style=[function(){return b.cssText},function(a){return b.cssText=a}])}var e=g.prototype;e.getPropertyValue=function(a){return this.properties_[a]||""};e.removeProperty=function(a){var b=this.getPropertyValue(a);this.properties_[a]=null;this.mutationCompleteHandler_(this.cssText);return b};e.setProperty=function(a,b){this.properties_[a]=b;this.mutationCompleteHandler_(this.cssText)}; -e.mutationCompleteHandler_=function(a){var b=this.storeAttributeMethod_(null,"style",a);w({type:0,target:this.element_,attributeName:"style",value:a,oldValue:b})};r(g,[{key:"cssText",get:function(){var a,b="",c;for(c in this.properties_)""!==(a=this.getPropertyValue(c))&&(b+=c+": "+a+"; ");return b.trim()},set:function(a){this.properties_={};a=a.split(/[:;]/);for(var b=a.length,c=0;c+1<b;c+=2)this.properties_[a[c].trim().toLowerCase()]=a[c+1].trim();this.mutationCompleteHandler_(this.cssText)}}]); -return g}(),u=function(g){return function(e){return g.includes(e.tagName)}},x=function b(e,a){var c=[];e.children.forEach(function(d){a(d)&&c.push(d);c.push.apply(c,b(d,a))});return c},y=function c(a,b){var d=null;a.children.some(function(a){if(b(a))return d=a,!0;a=c(a,b);return null!==a?(d=a,!0):!1});return d},N=function(a,b){for(;a=a.parentNode;)if(b(a))return a;return null},l=function(a,b){a.forEach(function(a){var c=function(c){var d=a[c][0],q="number"===typeof d,h="boolean"===typeof d,k=a[c][1]|| -c.toLowerCase();Object.defineProperty(b.prototype,c,{enumerable:!0,get:function(){var a=this.getAttribute(k);if(h)return null!==a?"true"===a:d;a=a||d;return q?Number(a):String(a)},set:function(a){this.setAttribute(k,String(a))}})},q;for(q in a)c(q)})},ea=function(a){return 1===a.nodeType},m={},D=function(a){function b(c,q,k){var d,h;c=a.call(this,c,q)||this;c.attributes=[];c.propertyBackedAttributes_={};c.classList=new B(b,t(t(c)),"class","classList","className");c.style=new z(t(t(c)));c.namespaceURI= -k;c._transferredFormat_=(d={},d[7]=c._index_,d[8]=1,d);c._creationFormat_=(h={},h[7]=c._index_,h[8]=0,h[0]=c.nodeType,h[1]=v(c.nodeName),h[6]=null===c.namespaceURI?void 0:v(c.namespaceURI),h);return c}n(b,a);var c=b.prototype;c.hydrate=function(){var a,b;return Object.assign({},this._creationFormat_,0<this.childNodes.length?(a={},a[4]=this.childNodes.map(function(a){return a.hydrate()}),a):{},0<this.attributes.length?(b={},b[2]=this.attributes.map(function(a){return[v(a.namespaceURI||"null"),v(a.name), -v(a.value)]}),b):{})};c.setAttribute=function(a,b){this.setAttributeNS(null,a,b)};c.getAttribute=function(a){return this.getAttributeNS(null,a)};c.removeAttribute=function(a){this.removeAttributeNS(null,a)};c.hasAttribute=function(a){return this.hasAttributeNS(null,a)};c.hasAttributes=function(){return 0<this.attributes.length};c.setAttributeNS=function(a,b,c){if(void 0!==this.propertyBackedAttributes_[b])this.attributes.find(C(a,b))||this.attributes.push({namespaceURI:a,name:b,value:c}),this.propertyBackedAttributes_[b][1](c); -else{var d=this.storeAttributeNS_(a,b,c);w({type:0,target:this,attributeName:b,attributeNamespace:a,value:c,oldValue:d})}};c.storeAttributeNS_=function(a,b,c){var d=this.attributes.find(C(a,b)),q=d&&d.value||"";d?d.value=c:this.attributes.push({namespaceURI:a,name:b,value:c});return q};c.getAttributeNS=function(a,b){return(a=this.attributes.find(C(a,b)))?void 0!==this.propertyBackedAttributes_[b]?this.propertyBackedAttributes_[b][0]():a.value:null};c.removeAttributeNS=function(a,b){var c=this.attributes.findIndex(C(a, -b));if(0<=c){var d=this.attributes[c].value;this.attributes.splice(c,1);w({type:0,target:this,attributeName:b,attributeNamespace:a,oldValue:d})}};c.hasAttributeNS=function(a,b){return this.attributes.some(C(a,b))};c.getElementsByClassName=function(a){var b=a.split(" ");return x(this,function(a){return b.some(function(b){return a.classList.contains(b)})})};c.getElementsByTagName=function(a){return x(this,"*"===a?function(a){return!0}:function(b){return b.tagName===a})};r(b,[{key:"outerHTML",get:function(){return"<"+ -[this.nodeName,qa(this.attributes)].join(" ").trim()+">"+this.innerHTML+"</"+this.nodeName+">"}},{key:"innerHTML",get:function(){var a=this.childNodes;return a.length?a.map(function(a){return 1===a.nodeType?a.outerHTML:a.textContent}).join(""):""}},{key:"textContent",set:function(a){this.childNodes.forEach(function(a){return a.remove()});this.appendChild(new M(a))},get:function(){return a.prototype.textContent}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes.filter(ea)}}, -{key:"childElementCount",get:function(){return this.children.length}},{key:"firstElementChild",get:function(){return this.childNodes.find(ea)||null}},{key:"lastElementChild",get:function(){var a=this.children;return a[a.length-1]||null}}]);return b}(L);l([{id:[""]}],D);var p=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);r(b,[{key:"form",get:function(){return N(this,u(["form"]))}}]);return b}(D);l([{accessKey:[""]},{contentEditable:["inherit"]},{dir:[""]},{lang:[""]},{title:[""]}, -{draggable:[!1]},{hidden:[!1]},{noModule:[!1]},{spellcheck:[!0]},{translate:[!0]}],p);var h=function(a){function b(){var c=a.apply(this,arguments)||this;c.relList=new B(b,t(t(c)),"rel","relList","rel");return c}n(b,a);b.prototype.toString=function(){return this.href};r(b,[{key:"text",get:function(){return this.textContent},set:function(a){this.textContent=a}}]);return b}(p);m.a=h;l([{href:[""]},{hreflang:[""]},{media:[""]},{target:[""]},{type:[""]}],h);h=function(a){function b(){return a.apply(this, -arguments)||this}n(b,a);return b}(p);m.button=h;l([{formAction:[""]},{formEnctype:[""]},{formMethod:[""]},{formTarget:[""]},{name:[""]},{type:["submit"]},{value:[""]},{autofocus:[!1]},{disabled:[!1]}],h);h=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(p);m.data=h;l([{value:[""]}],h);h=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(p);m.embed=h;l([{height:[""]},{src:[""]},{type:[""]},{width:[""]}],h);var ra="button fieldset input object output select textarea".split(" "); -h=function(a){Object.defineProperty(a.prototype,"elements",{get:function(){return x(this,u(ra))}})};var k=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);r(b,[{key:"type",get:function(){return this.tagName}}]);return b}(p);m.fieldset=k;h(k);l([{name:[""]},{disabled:[!1]}],k);k=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);r(b,[{key:"length",get:function(){return this.elements.length}}]);return b}(p);m.form=k;h(k);l([{name:[""]},{method:["get"]},{target:[""]}, -{action:[""]},{enctype:["application/x-www-form-urlencoded"]},{acceptCharset:["","accept-charset"]},{autocomplete:["on"]},{autocapitalize:["sentences"]}],k);h=function(a){function b(){var c=a.apply(this,arguments)||this;c.sandbox=new B(b,t(t(c)),"sandbox",null,null);return c}n(b,a);return b}(p);m.iframe=h;l([{allow:[""]},{allowFullscreen:[!1]},{csp:[""]},{height:[""]},{name:[""]},{referrerPolicy:[""]},{src:[""]},{srcdoc:[""]},{width:[""]}],h);h=function(a){function b(){return a.apply(this,arguments)|| -this}n(b,a);return b}(p);m.img=h;l([{alt:[""]},{crossOrigin:[""]},{height:[0]},{isMap:[!1]},{referrerPolicy:[""]},{src:[""]},{sizes:[""]},{srcset:[""]},{useMap:[""]},{width:[0]}],h);h=function(a){Object.defineProperty(a.prototype,"labels",{get:function(){var a=this;return x(this.ownerDocument||this,function(b){return"label"===b.tagName&&b.for&&b.for===a.id})}})};k=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(p);m.input=k;h(k);l([{formAction:[""]},{formEncType:[""]}, -{formMethod:[""]},{formTarget:[""]},{name:[""]},{type:["text"]},{disabled:[!1]},{autofocus:[!1]},{required:[!1]},{defaultChecked:[!1,"checked"]},{alt:[""]},{height:[0]},{src:[""]},{width:[0]},{accept:[""]},{autocomplete:[""]},{maxLength:[0]},{size:[0]},{pattern:[""]},{placeholder:[""]},{readOnly:[!1]},{min:[""]},{max:[""]},{defaultValue:["","value"]},{dirName:[""]},{multiple:[!1]},{step:[""]},{autocapitalize:[""]}],k);k=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);r(b,[{key:"control", -get:function(){var a=this.getAttribute("for");return null!==a?this.ownerDocument&&this.ownerDocument.getElementById(a):y(this,u(["input"]))}}]);return b}(p);m.label=k;l([{htmlFor:["","for"]}],k);k=function(a){function b(){var c=a.apply(this,arguments)||this;c.relList=new B(b,t(t(c)),"rel","relList","rel");return c}n(b,a);return b}(p);m.link=k;l([{as:[""]},{crossOrigin:[""]},{disabled:[!1]},{href:[""]},{hreflang:[""]},{media:[""]},{referrerPolicy:[""]},{sizes:[""]},{type:[""]}],k);k=function(a){function b(){return a.apply(this, -arguments)||this}n(b,a);r(b,[{key:"areas",get:function(){return x(this,function(a){return"area"===a.tagName})}}]);return b}(p);m.link=k;l([{name:[""]}],k);k=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(p);m.meter=k;h(k);l([{high:[0]},{low:[0]},{max:[1]},{min:[0]},{optimum:[0]},{value:[0]}],k);k=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(p);m.del=k;m.ins=k;l([{cite:[""]},{datetime:[""]}],k);k=function(a){function b(){return a.apply(this, -arguments)||this}n(b,a);return b}(p);m.ol=k;l([{reversed:[!1]},{start:[1]},{type:[""]}],k);k=function(a){function b(b,d,h){var c=a.call(this,b,d,h)||this;c.isSelected=!1;c.propertyBackedAttributes_.selected=[function(){return String(c.isSelected)},function(a){return c.selected="true"===a}];return c}n(b,a);r(b,[{key:"index",get:function(){return this.parentNode&&this.parentNode.children.indexOf(this)||0}},{key:"label",get:function(){return this.getAttribute("label")||this.textContent},set:function(a){this.setAttribute("label", -a)}},{key:"selected",get:function(){return this.isSelected},set:function(a){this.isSelected=a}},{key:"text",get:function(){return this.textContent},set:function(a){this.textContent=a}},{key:"value",get:function(){return this.getAttribute("value")||this.textContent},set:function(a){this.setAttribute("value",a)}}]);return b}(p);m.option=k;l([{defaultSelected:[!1,"selected"]},{disabled:[!1]},{type:[""]}],k);k=function(a){function b(){var b=a.apply(this,arguments)||this;b._indeterminate=!0;b._value=0; -return b}n(b,a);r(b,[{key:"position",get:function(){return this._indeterminate?-1:this._value/this.max}},{key:"value",get:function(){return this._value},set:function(a){this._indeterminate=!1;this._value=a}}]);return b}(p);m.progress=k;h(k);l([{max:[1]}],k);k=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(p);m.blockquote=k;m.q=k;l([{cite:[""]}],k);k=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);r(b,[{key:"text",get:function(){return this.textContent}, -set:function(a){this.textContent=a}}]);return b}(p);m.script=k;l([{type:[""]},{src:[""]},{charset:[""]},{async:[!1]},{defer:[!1]},{crossOrigin:[""]},{noModule:[!1]}],k);var fa=u(["option"]),O=function(a){return"option"===a.tagName&&a.selected};k=function(a){function b(){var b=a.apply(this,arguments)||this;b._size_=-1;return b}n(b,a);r(b,[{key:"length",get:function(){return x(this,fa).length}},{key:"options",get:function(){return this.children.filter(fa)}},{key:"selectedIndex",get:function(){var a= -y(this,O);return a?this.children.indexOf(a):-1},set:function(a){this.children.forEach(function(b,c){b.selected=c===a})}},{key:"selectedOptions",get:function(){return x(this,O)}},{key:"size",get:function(){return-1===this._size_?this.multiple?4:1:this._size_},set:function(a){this._size_=0<a?a:this.multiple?4:1}},{key:"type",get:function(){return this.multiple?"select-one":"select-multiple"}},{key:"value",get:function(){var a=y(this,O);return a?a.value:""}}]);return b}(p);m.select=k;h(k);l([{multiple:[!1]}, -{name:[""]},{required:[!1]}],k);h=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(p);m.source=h;l([{media:[""]},{sizes:[""]},{src:[""]},{srcset:[""]},{type:[""]}],h);h=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(p);m.style=h;l([{media:[""]},{type:[""]}],h);h=function(a){function b(){var c=a.apply(this,arguments)||this;c.headers=new B(b,t(t(c)),"headers",null,null);return c}n(b,a);r(b,[{key:"cellIndex",get:function(){var a=N(this,u(["tr"])); -return null!==a?x(a,u(["th","td"])).indexOf(this):-1}}]);return b}(p);m.th=h;m.td=h;l([{abbr:[""]},{colSpan:[1]},{rowSpan:[1]},{scope:[""]}],h);h=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(p);m.col=h;l([{span:[1]}],h);var P=function(a){return a&&a.remove()},ha=function(a,b,c){var d=y(a,function(a){return!c.includes(a.tagName)});d?a.insertBefore(b,d):a.appendChild(b)};h=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);r(b,[{key:"caption",get:function(){return y(this, -u(["caption"]))},set:function(a){a&&"caption"===a.tagName&&(P(this.caption),this.insertBefore(a,this.firstElementChild))}},{key:"tHead",get:function(){return y(this,u(["thead"]))},set:function(a){a&&"thead"===a.tagName&&(P(this.tHead),ha(this,a,["caption","colgroup"]))}},{key:"tFoot",get:function(){return y(this,u(["tfoot"]))},set:function(a){a&&"tfoot"===a.tagName&&(P(this.tFoot),ha(this,a,["caption","colgroup","thead"]))}},{key:"rows",get:function(){return x(this,u(["tr"]))}},{key:"tBodies",get:function(){return x(this, -u(["tbody"]))}}]);return b}(p);m.table=h;var sa=["table","tbody","thead","tfoot"],ia=function(a,b){b=N(a,b);return null===b?-1:b.rows.indexOf(a)};h=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);var c=b.prototype;c.deleteCell=function(a){(a=this.cells[a])&&a.remove()};c.insertCell=function(a){var b=this.cells,c=this.ownerDocument.createElement("td");0>a||a>=b.length?this.appendChild(c):this.insertBefore(c,this.children[a]);return c};r(b,[{key:"cells",get:function(){return x(this, -u(["td","th"]))}},{key:"rowIndex",get:function(){return ia(this,u(["table"]))}},{key:"sectionRowIndex",get:function(){return ia(this,u(sa))}}]);return b}(p);m.tr=h;h=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);var c=b.prototype;c.deleteRow=function(a){var b=this.rows;(0<=a||a<=b.length)&&b[a].remove()};c.insertRow=function(a){var b=this.rows,c=this.ownerDocument.createElement("tr");0>a||a>=b.length?this.appendChild(c):this.insertBefore(c,this.children[a]);return c};r(b,[{key:"rows", -get:function(){return x(this,u(["tr"]))}}]);return b}(p);m.thead=h;m.tfoot=h;m.tbody=h;h=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(p);m.time=h;l([{dateTime:[""]}],h);var ja=function(a){function b(){return a.apply(this,arguments)||this}n(b,a);return b}(D);m.svg=ja;var ca=function(){function a(a,b){this._end=this._stop=!1;this.type=a;this.bubbles=!!b.bubbles;this.cancelable=!!b.cancelable}var b=a.prototype;b.stopPropagation=function(){this._stop=!0};b.stopImmediatePropagation= -function(){this._end=this._stop=!0};b.preventDefault=function(){this.defaultPrevented=!0};return a}(),Y,aa=!1,ba=!1,Z=function(a){return a.map(function(a){return a._transferredFormat_})},ta=function(a){function b(){var c=a.call(this,9,"#document",null)||this;c.documentElement=t(t(c));c.createElement=function(a){return c.createElementNS(null,a)};c.createElementNS=function(a,b){return new (m[b]||p)(1,b,a)};c.createTextNode=function(a){return new M(a)};c.defaultView={document:t(t(c)),MutationObserver:pa, -Document:b,Node:L,Text:M,Element:D,SVGElement:ja,Event:ca};return c}n(b,a);b.prototype.getElementById=function(a){return y(this.body,function(b){return b.id===a})};return b}(D),ua="Array ArrayBuffer Blob BigInt BigInt64Array BigUint64Array Boolean Cache CustomEvent DataView Date Error EvalError Event EventTarget Float32Array Float64Array Function Infinity Int16Array Int32Array Int8Array Intl JSON Map Math NaN Number Object Promise Proxy RangeError ReferenceError Reflect RegExp Set String Symbol SyntaxError TextDecoder TextEncoder TypeError URIError URL Uint16Array Uint32Array Uint8Array Uint8ClampedArray WeakMap WeakSet atob btoa caches clearInterval clearTimeout console decodeURI decodeURIComponent encodeURI encodeURIComponent escape eval fetch indexedDB isFinite isNaN onerror onrejectionhandled onunhandledrejection parseFloat parseInt performance setTimeout setInterval undefined unescape".split(" "); -l=function(a){var b=new ta;b.isConnected=!0;b.appendChild(b.body=b.createElement("body"));a&&(ma(b,a),na(),oa());return b}(self.postMessage);l={document:l,addEventListener:l.addEventListener.bind(l),removeEventListener:l.removeEventListener.bind(l),localStorage:{},location:{},url:"/",appendKeys:function(a){a=a.filter(function(a){return!z.prototype.hasOwnProperty(a)});if(!(0>=a.length)){var b=z.prototype.length||0;0!==b?z.prototype.length=b+a.length:Object.defineProperty(z.prototype,"length",{configurable:!0, -writable:!0,value:a.length});a.forEach(function(a,d){var c,h=a.replace(/(webkit|ms|moz|khtml)/g,"-$1").replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase();z.prototype[d+b]=h;Object.defineProperties(z.prototype,(c={},c[a]={get:function(){return this.getPropertyValue(h)},set:function(a){this.setProperty(h,a)}},c))})}}};(function(a){for(var b=a;b&&b.constructor!==EventTarget;)Object.getOwnPropertyNames(b).forEach(function(a){var c=b;if(!(0<=ua.indexOf(a)))try{delete c[a]}catch(q){}}),b=Object.getPrototypeOf(b)})(self); -Q.workerDOM=l;return Q}({}); -//# sourceMappingURL=worker.safe.js.map diff --git a/dist/worker.safe.js.map b/dist/worker.safe.js.map deleted file mode 100644 index b29decc99..000000000 --- a/dist/worker.safe.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"worker.safe.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/worker.safe.mjs b/dist/worker.safe.mjs deleted file mode 100644 index 2369846bd..000000000 --- a/dist/worker.safe.mjs +++ /dev/null @@ -1,42 +0,0 @@ -'use strict';var WorkerThread=function(V){function z(a){return!!a&&W.get(a)||null}function X(){const a=A;A=[];return a}function m(a){t.forEach((b)=>{if(b.options.subtreeFlattened&&4!==a.type){var c=a.target,d=b.target;if(null===d||c._index_!==d._index_){do if(d=b.target,null!==d&&c._index_===d._index_){Y(b,a);break}while(c=c.parentNode)}}else Y(b,a)})}function k(a){if(B.has(a))return B.get(a);B.set(a,++Z);C.push(a);return Z}function aa(){const a=C;C=[];return a}function Ba(a){X();const b=ba.body.hydrate(), -c=[];a.forEach((a)=>{4===a.type&&a.addedEvents&&a.addedEvents.forEach((a)=>{c.push(a)})});return{9:2,39:aa(),35:b,20:c}}function Ca(a){const b=X().map((a)=>a._creationFormat_),c=[];a.forEach((a)=>{let b={9:a.type,10:a.target._index_};a.addedNodes&&(b[11]=ca(a.addedNodes));a.removedNodes&&(b[12]=ca(a.removedNodes));a.nextSibling&&(b[14]=a.nextSibling._transferredFormat_);null!=a.attributeName&&(b[15]=k(a.attributeName));null!=a.attributeNamespace&&(b[16]=k(a.attributeNamespace));null!= -a.oldValue&&(b[19]=k(a.oldValue));a.propertyName&&(b[17]=k(a.propertyName));null!=a.value&&(b[18]=k(a.value));a.addedEvents&&(b[20]=a.addedEvents);a.removedEvents&&(b[21]=a.removedEvents);c.push(b)});return{9:3,39:aa(),35:b,34:c}}function Da(a,b){da||(ba=a,(new a.defaultView.MutationObserver((a)=>{b&&b(!1===ea?Ba(a):Ca(a));ea=!0})).observe(a.body),da=!0)}function Ea(){"undefined"!==typeof addEventListener&&addEventListener("message",({data:a})=>{if(1===a[9]){a=a[37];var b=z(a[7]);if(null!== -b){const c=a[10];b.dispatchEvent(Object.assign(new fa(a[9],{bubbles:a[22],cancelable:a[23]}),{cancelBubble:a[24],defaultPrevented:a[26],eventPhase:a[27],isTrusted:a[28],returnValue:a[29],target:z(c?c[7]:null),timeStamp:a[30],scoped:a[31],keyCode:a[32]}))}}})}function Fa(){"function"===typeof addEventListener&&addEventListener("message",({data:a})=>{if(5===a[9]){a=a[38];var b=z(a[7]);b&&(b.value=a[18])}})}let ha=0,A=[];const W=new Map,t=[];let D=!1;const Y=(a,b)=>{a.pushRecord(b);D||(D=!0,Promise.resolve().then(()=> -{D=!1;t.forEach((a)=>a.callback(a.takeRecords()))}))};class Ga{constructor(a){this._records_=[];this.callback=a}observe(a,b){this.disconnect();this.target=a;this.options=Object.assign({subtreeFlattened:!1},b);t.push(this)}disconnect(){this.target=null;const a=t.indexOf(this);0<=a&&t.splice(a,1)}takeRecords(){return this._records_.splice(0,this._records_.length)}pushRecord(a){this._records_.push(a)}}let Z=0,C=[];const B=new Map;let E=null;const u=(a,b,c)=>{a[b]=c;a.childNodes.forEach((a)=>u(a,b,c))}; -class F{constructor(a,b){this.childNodes=[];this.parentNode=null;this.isConnected=!1;this._handlers_={};this.nodeType=a;this.nodeName=b;null===E&&(E=this);this.ownerDocument=E;void 0!==this._index_?a=this._index_:(W.set(this._index_=++ha,this),A.push(this),a=ha);this._index_=a}get textContent(){let a="";const b=this.childNodes;return b.length?(b.forEach((b)=>a+=b.textContent),a):""}get firstChild(){return 0<this.childNodes.length?this.childNodes[0]:null}get lastChild(){return 0<this.childNodes.length? -this.childNodes[this.childNodes.length-1]:null}get nextSibling(){if(null===this.parentNode)return null;const a=this.parentNode.childNodes;return a[a.indexOf(this)+1]||null}get previousSibling(){if(null===this.parentNode)return null;const a=this.parentNode.childNodes;return a[a.indexOf(this)-1]||null}hasChildNodes(){return 0<this.childNodes.length}contains(a){return 0<this.childNodes.length?this.childNodes.includes(this)?!0:this.childNodes.some((b)=>b.contains(a)):a===this}insertBefore(a,b){return null=== -a?null:a===this?a:null==b?(this.appendChild(a),m({addedNodes:[a],type:2,target:this}),a):0<=this.childNodes.indexOf(b)?(a.remove(),this.childNodes.splice(this.childNodes.indexOf(b),0,a),a.parentNode=this,u(a,"isConnected",this.isConnected),m({addedNodes:[a],nextSibling:b,type:2,target:this}),a):null}appendChild(a){a.remove();a.parentNode=this;u(a,"isConnected",this.isConnected);this.childNodes.push(a);m({addedNodes:[a],previousSibling:this.childNodes[this.childNodes.length-2],type:2,target:this})}removeChild(a){const b= -this.childNodes.indexOf(a);return 0<=b?(a.parentNode=null,u(a,"isConnected",!1),this.childNodes.splice(b,1),m({removedNodes:[a],type:2,target:this}),a):null}replaceChild(a,b){if(a!==b){const c=this.childNodes.indexOf(b);0<=c&&(b.parentNode=null,u(b,"isConnected",!1),this.childNodes.splice(c,1,a),m({addedNodes:[a],removedNodes:[b],type:2,target:this}))}return b}remove(){this.parentNode&&this.parentNode.removeChild(this)}addEventListener(a,b){const c=this._handlers_[a.toLowerCase()];let d=0;c&&0<c.length? -d=c.push(b):this._handlers_[a.toLowerCase()]=[b];m({target:this,type:4,addedEvents:[{9:k(a),7:this._index_,33:d}]})}removeEventListener(a,b){const c=this._handlers_[a.toLowerCase()];b=c?c.indexOf(b):-1;0<=b&&(c.splice(b,1),m({target:this,type:4,removedEvents:[{9:k(a),7:this._index_,33:b}]}))}dispatchEvent(a){let b=a.currentTarget=this,c,d;do if(c=b&&b._handlers_&&b._handlers_[a.type.toLowerCase()])for(d=c.length;d--&&(!1!==c[d].call(b,a)&&!a._end||!a.cancelable););while(a.bubbles&&(!a.cancelable|| -!a._stop)&&(b=b&&b.parentNode));return!a.defaultPrevented}}class v{constructor(a,b,c,d,e){this.array_=[];this.element_=b;this.attributeName_=c;this.storeAttributeMethod_=b.storeAttributeNS_.bind(b);b.propertyBackedAttributes_[c]=[()=>this.value,(a)=>this.value=a];d&&e&&Object.defineProperty(a.prototype,e,{enumerable:!0,configurable:!0,get(){return this[d].value},set(a){this[d].value=a}})}get value(){return this.array_.join(" ")}get length(){return this.array_.length}set value(a){const b=this.value; -a=a.trim();this.array_.splice(0,this.array_.length,...""!==a?a.split(/\s+/):"");this.mutationCompleteHandler_(b,a)}item(a){return this.array_[a]}contains(a){return this.array_.includes(a)}add(...a){const b=this.value;this.array_.splice(0,this.array_.length,...new Set(this.array_.concat(a)));this.mutationCompleteHandler_(b,this.value)}remove(...a){const b=this.value;this.array_.splice(0,this.array_.length,...new Set(this.array_.filter((b)=>!a.includes(b))));this.mutationCompleteHandler_(b,this.value)}replace(a, -b){if(this.array_.includes(a)){var c=this.value,d=new Set(this.array_);a!==b&&(d.delete(a),""!==b&&d.add(b));this.array_.splice(0,this.array_.length,...d);this.mutationCompleteHandler_(c,this.value)}}toggle(a,b){if(!this.array_.includes(a))!1!==b&&this.add(a);else if(!0!==b)return this.remove(a),!1;return!0}mutationCompleteHandler_(a,b){this.storeAttributeMethod_(null,this.attributeName_,b);m({type:0,target:this.element_,attributeName:this.attributeName_,value:b,oldValue:a})}}const Ha=(a)=>a.map(({name:a, -value:c})=>`${a}="${c}"`).join(" "),w=(a,b)=>(c)=>c.namespaceURI===a&&c.name===b;class Ia extends F{constructor(a,b,c){super(b,c);this._data_=a}get data(){return this._data_}set data(a){const b=this.data;this._data_=a;m({target:this,type:1,value:a,oldValue:b})}get length(){return this._data_.length}get nodeValue(){return this._data_}set nodeValue(a){this.data=a}}class x extends Ia{constructor(a){super(a,3,"#text");this._transferredFormat_={7:this._index_,8:1};this._creationFormat_={7:this._index_, -8:0,0:3,1:k("#text"),5:k(this.data)}}hydrate(){return this._creationFormat_}get textContent(){return this.data}set textContent(a){this.nodeValue=a}splitText(a){const b=new x(this.data.slice(a,this.data.length)),c=this.parentNode;this.nodeValue=this.data.slice(0,a);if(null!==c){a=c.childNodes;const d=a.indexOf(this)+1;return c.insertBefore(b,a.length>=d?a[d]:null)}return b}}class p{constructor(a){this.properties_={};this.storeAttributeMethod_=a.storeAttributeNS_.bind(a);(this.element_=a)&& -a.propertyBackedAttributes_&&(a.propertyBackedAttributes_.style=[()=>this.cssText,(a)=>this.cssText=a])}getPropertyValue(a){return this.properties_[a]||""}removeProperty(a){const b=this.getPropertyValue(a);this.properties_[a]=null;this.mutationCompleteHandler_(this.cssText);return b}setProperty(a,b){this.properties_[a]=b;this.mutationCompleteHandler_(this.cssText)}get cssText(){let a,b="";for(let c in this.properties_)""!==(a=this.getPropertyValue(c))&&(b+=`${c}: ${a}; `);return b.trim()}set cssText(a){this.properties_= -{};a=a.split(/[:;]/);const b=a.length;for(let c=0;c+1<b;c+=2)this.properties_[a[c].trim().toLowerCase()]=a[c+1].trim();this.mutationCompleteHandler_(this.cssText)}mutationCompleteHandler_(a){const b=this.storeAttributeMethod_(null,"style",a);m({type:0,target:this.element_,attributeName:"style",value:a,oldValue:b})}}const h=(a)=>(b)=>a.includes(b.tagName),l=(a,b)=>{const c=[];a.children.forEach((a)=>{b(a)&&c.push(a);c.push(...l(a,b))});return c},n=(a,b)=>{let c=null;a.children.some((a)=>{if(b(a))return c= -a,!0;a=n(a,b);return null!==a?(c=a,!0):!1});return c},G=(a,b)=>{for(;a=a.parentNode;)if(b(a))return a;return null};var e=(a,b)=>{a.forEach((a)=>{for(let c in a){const d=a[c][0],e="number"===typeof d,f="boolean"===typeof d,g=a[c][1]||c.toLowerCase();Object.defineProperty(b.prototype,c,{enumerable:!0,get(){var a=this.getAttribute(g);if(f)return null!==a?"true"===a:d;a=a||d;return e?Number(a):String(a)},set(a){this.setAttribute(g,String(a))}})}})};const ia=(a)=>1===a.nodeType,f={};class r extends F{constructor(a, -b,c){super(a,b);this.attributes=[];this.propertyBackedAttributes_={};this.classList=new v(r,this,"class","classList","className");this.style=new p(this);this.namespaceURI=c;this._transferredFormat_={7:this._index_,8:1};this._creationFormat_={7:this._index_,8:0,0:this.nodeType,1:k(this.nodeName),6:null===this.namespaceURI?void 0:k(this.namespaceURI)}}hydrate(){return Object.assign({},this._creationFormat_,0<this.childNodes.length?{4:this.childNodes.map((a)=>a.hydrate())}:{},0<this.attributes.length? -{2:this.attributes.map((a)=>[k(a.namespaceURI||"null"),k(a.name),k(a.value)])}:{})}get outerHTML(){return`<${[this.nodeName,Ha(this.attributes)].join(" ").trim()}>${this.innerHTML}</${this.nodeName}>`}get innerHTML(){const a=this.childNodes;return a.length?a.map((a)=>1===a.nodeType?a.outerHTML:a.textContent).join(""):""}set textContent(a){this.childNodes.forEach((a)=>a.remove());this.appendChild(new x(a))}get textContent(){return super.textContent}get tagName(){return this.nodeName}get children(){return this.childNodes.filter(ia)}get childElementCount(){return this.children.length}get firstElementChild(){return this.childNodes.find(ia)|| -null}get lastElementChild(){const a=this.children;return a[a.length-1]||null}setAttribute(a,b){this.setAttributeNS(null,a,b)}getAttribute(a){return this.getAttributeNS(null,a)}removeAttribute(a){this.removeAttributeNS(null,a)}hasAttribute(a){return this.hasAttributeNS(null,a)}hasAttributes(){return 0<this.attributes.length}setAttributeNS(a,b,c){if(void 0!==this.propertyBackedAttributes_[b])this.attributes.find(w(a,b))||this.attributes.push({namespaceURI:a,name:b,value:c}),this.propertyBackedAttributes_[b][1](c); -else{var d=this.storeAttributeNS_(a,b,c);m({type:0,target:this,attributeName:b,attributeNamespace:a,value:c,oldValue:d})}}storeAttributeNS_(a,b,c){const d=this.attributes.find(w(a,b)),e=d&&d.value||"";d?d.value=c:this.attributes.push({namespaceURI:a,name:b,value:c});return e}getAttributeNS(a,b){return(a=this.attributes.find(w(a,b)))?void 0!==this.propertyBackedAttributes_[b]?this.propertyBackedAttributes_[b][0]():a.value:null}removeAttributeNS(a,b){const c=this.attributes.findIndex(w(a,b));if(0<= -c){const d=this.attributes[c].value;this.attributes.splice(c,1);m({type:0,target:this,attributeName:b,attributeNamespace:a,oldValue:d})}}hasAttributeNS(a,b){return this.attributes.some(w(a,b))}getElementsByClassName(a){const b=a.split(" ");return l(this,(a)=>b.some((b)=>a.classList.contains(b)))}getElementsByTagName(a){return l(this,"*"===a?(a)=>!0:(b)=>b.tagName===a)}}e([{id:[""]}],r);class g extends r{get form(){return G(this,h(["form"]))}}e([{accessKey:[""]},{contentEditable:["inherit"]},{dir:[""]}, -{lang:[""]},{title:[""]},{draggable:[!1]},{hidden:[!1]},{noModule:[!1]},{spellcheck:[!0]},{translate:[!0]}],g);class H extends g{constructor(){super(...arguments);this.relList=new v(H,this,"rel","relList","rel")}toString(){return this.href}get text(){return this.textContent}set text(a){this.textContent=a}}f.a=H;e([{href:[""]},{hreflang:[""]},{media:[""]},{target:[""]},{type:[""]}],H);class ja extends g{}f.button=ja;e([{formAction:[""]},{formEnctype:[""]},{formMethod:[""]},{formTarget:[""]},{name:[""]}, -{type:["submit"]},{value:[""]},{autofocus:[!1]},{disabled:[!1]}],ja);class ka extends g{}f.data=ka;e([{value:[""]}],ka);class la extends g{}f.embed=la;e([{height:[""]},{src:[""]},{type:[""]},{width:[""]}],la);const Ja="button fieldset input object output select textarea".split(" ");var q=(a)=>{Object.defineProperty(a.prototype,"elements",{get(){return l(this,h(Ja))}})};class I extends g{get type(){return this.tagName}}f.fieldset=I;q(I);e([{name:[""]},{disabled:[!1]}],I);class J extends g{get length(){return this.elements.length}} -f.form=J;q(J);e([{name:[""]},{method:["get"]},{target:[""]},{action:[""]},{enctype:["application/x-www-form-urlencoded"]},{acceptCharset:["","accept-charset"]},{autocomplete:["on"]},{autocapitalize:["sentences"]}],J);class K extends g{constructor(){super(...arguments);this.sandbox=new v(K,this,"sandbox",null,null)}}f.iframe=K;e([{allow:[""]},{allowFullscreen:[!1]},{csp:[""]},{height:[""]},{name:[""]},{referrerPolicy:[""]},{src:[""]},{srcdoc:[""]},{width:[""]}],K);class ma extends g{}f.img=ma;e([{alt:[""]}, -{crossOrigin:[""]},{height:[0]},{isMap:[!1]},{referrerPolicy:[""]},{src:[""]},{sizes:[""]},{srcset:[""]},{useMap:[""]},{width:[0]}],ma);q=(a)=>{Object.defineProperty(a.prototype,"labels",{get(){return l(this.ownerDocument||this,(a)=>"label"===a.tagName&&a.for&&a.for===this.id)}})};class L extends g{}f.input=L;q(L);e([{formAction:[""]},{formEncType:[""]},{formMethod:[""]},{formTarget:[""]},{name:[""]},{type:["text"]},{disabled:[!1]},{autofocus:[!1]},{required:[!1]},{defaultChecked:[!1,"checked"]}, -{alt:[""]},{height:[0]},{src:[""]},{width:[0]},{accept:[""]},{autocomplete:[""]},{maxLength:[0]},{size:[0]},{pattern:[""]},{placeholder:[""]},{readOnly:[!1]},{min:[""]},{max:[""]},{defaultValue:["","value"]},{dirName:[""]},{multiple:[!1]},{step:[""]},{autocapitalize:[""]}],L);class na extends g{get control(){const a=this.getAttribute("for");return null!==a?this.ownerDocument&&this.ownerDocument.getElementById(a):n(this,h(["input"]))}}f.label=na;e([{htmlFor:["","for"]}],na);class M extends g{constructor(){super(...arguments); -this.relList=new v(M,this,"rel","relList","rel")}}f.link=M;e([{as:[""]},{crossOrigin:[""]},{disabled:[!1]},{href:[""]},{hreflang:[""]},{media:[""]},{referrerPolicy:[""]},{sizes:[""]},{type:[""]}],M);class oa extends g{get areas(){return l(this,(a)=>"area"===a.tagName)}}f.link=oa;e([{name:[""]}],oa);class N extends g{}f.meter=N;q(N);e([{high:[0]},{low:[0]},{max:[1]},{min:[0]},{optimum:[0]},{value:[0]}],N);class O extends g{}f.del=O;f.ins=O;e([{cite:[""]},{datetime:[""]}],O);class pa extends g{}f.ol= -pa;e([{reversed:[!1]},{start:[1]},{type:[""]}],pa);class qa extends g{constructor(a,b,c){super(a,b,c);this.isSelected=!1;this.propertyBackedAttributes_.selected=[()=>String(this.isSelected),(a)=>this.selected="true"===a]}get index(){return this.parentNode&&this.parentNode.children.indexOf(this)||0}get label(){return this.getAttribute("label")||this.textContent}set label(a){this.setAttribute("label",a)}get selected(){return this.isSelected}set selected(a){this.isSelected=a}get text(){return this.textContent}set text(a){this.textContent= -a}get value(){return this.getAttribute("value")||this.textContent}set value(a){this.setAttribute("value",a)}}f.option=qa;e([{defaultSelected:[!1,"selected"]},{disabled:[!1]},{type:[""]}],qa);class P extends g{constructor(){super(...arguments);this._indeterminate=!0;this._value=0}get position(){return this._indeterminate?-1:this._value/this.max}get value(){return this._value}set value(a){this._indeterminate=!1;this._value=a}}f.progress=P;q(P);e([{max:[1]}],P);class Q extends g{}f.blockquote=Q;f.q= -Q;e([{cite:[""]}],Q);class ra extends g{get text(){return this.textContent}set text(a){this.textContent=a}}f.script=ra;e([{type:[""]},{src:[""]},{charset:[""]},{async:[!1]},{defer:[!1]},{crossOrigin:[""]},{noModule:[!1]}],ra);const sa=h(["option"]),R=(a)=>"option"===a.tagName&&a.selected;class S extends g{constructor(){super(...arguments);this._size_=-1}get length(){return l(this,sa).length}get options(){return this.children.filter(sa)}get selectedIndex(){const a=n(this,R);return a?this.children.indexOf(a): --1}set selectedIndex(a){this.children.forEach((b,c)=>{b.selected=c===a})}get selectedOptions(){return l(this,R)}get size(){return-1===this._size_?this.multiple?4:1:this._size_}set size(a){this._size_=0<a?a:this.multiple?4:1}get type(){return this.multiple?"select-one":"select-multiple"}get value(){const a=n(this,R);return a?a.value:""}}f.select=S;q(S);e([{multiple:[!1]},{name:[""]},{required:[!1]}],S);class ta extends g{}f.source=ta;e([{media:[""]},{sizes:[""]},{src:[""]},{srcset:[""]},{type:[""]}], -ta);class ua extends g{}f.style=ua;e([{media:[""]},{type:[""]}],ua);class y extends g{constructor(){super(...arguments);this.headers=new v(y,this,"headers",null,null)}get cellIndex(){const a=G(this,h(["tr"]));return null!==a?l(a,h(["th","td"])).indexOf(this):-1}}f.th=y;f.td=y;e([{abbr:[""]},{colSpan:[1]},{rowSpan:[1]},{scope:[""]}],y);class va extends g{}f.col=va;e([{span:[1]}],va);const T=(a)=>a&&a.remove(),wa=(a,b,c)=>{const d=n(a,(a)=>!c.includes(a.tagName));d?a.insertBefore(b,d):a.appendChild(b)}; -class Ka extends g{get caption(){return n(this,h(["caption"]))}set caption(a){a&&"caption"===a.tagName&&(T(this.caption),this.insertBefore(a,this.firstElementChild))}get tHead(){return n(this,h(["thead"]))}set tHead(a){a&&"thead"===a.tagName&&(T(this.tHead),wa(this,a,["caption","colgroup"]))}get tFoot(){return n(this,h(["tfoot"]))}set tFoot(a){a&&"tfoot"===a.tagName&&(T(this.tFoot),wa(this,a,["caption","colgroup","thead"]))}get rows(){return l(this,h(["tr"]))}get tBodies(){return l(this,h(["tbody"]))}} -f.table=Ka;const La=["table","tbody","thead","tfoot"],xa=(a,b)=>{b=G(a,b);return null===b?-1:b.rows.indexOf(a)};class Ma extends g{get cells(){return l(this,h(["td","th"]))}get rowIndex(){return xa(this,h(["table"]))}get sectionRowIndex(){return xa(this,h(La))}deleteCell(a){(a=this.cells[a])&&a.remove()}insertCell(a){const b=this.cells,c=this.ownerDocument.createElement("td");0>a||a>=b.length?this.appendChild(c):this.insertBefore(c,this.children[a]);return c}}f.tr=Ma;class U extends g{get rows(){return l(this, -h(["tr"]))}deleteRow(a){const b=this.rows;(0<=a||a<=b.length)&&b[a].remove()}insertRow(a){const b=this.rows,c=this.ownerDocument.createElement("tr");0>a||a>=b.length?this.appendChild(c):this.insertBefore(c,this.children[a]);return c}}f.thead=U;f.tfoot=U;f.tbody=U;class ya extends g{}f.time=ya;e([{dateTime:[""]}],ya);class za extends r{}f.svg=za;class fa{constructor(a,b){this._end=this._stop=!1;this.type=a;this.bubbles=!!b.bubbles;this.cancelable=!!b.cancelable}stopPropagation(){this._stop=!0}stopImmediatePropagation(){this._end= -this._stop=!0}preventDefault(){this.defaultPrevented=!0}}let ba,da=!1,ea=!1;const ca=(a)=>a.map((a)=>a._transferredFormat_);class Aa extends r{constructor(){super(9,"#document",null);this.documentElement=this;this.createElement=(a)=>this.createElementNS(null,a);this.createElementNS=(a,b)=>new (f[b]||g)(1,b,a);this.createTextNode=(a)=>new x(a);this.defaultView={document:this,MutationObserver:Ga,Document:Aa,Node:F,Text:x,Element:r,SVGElement:za,Event:fa}}getElementById(a){return n(this.body,(b)=>b.id=== -a)}}const Na="Array ArrayBuffer Blob BigInt BigInt64Array BigUint64Array Boolean Cache CustomEvent DataView Date Error EvalError Event EventTarget Float32Array Float64Array Function Infinity Int16Array Int32Array Int8Array Intl JSON Map Math NaN Number Object Promise Proxy RangeError ReferenceError Reflect RegExp Set String Symbol SyntaxError TextDecoder TextEncoder TypeError URIError URL Uint16Array Uint32Array Uint8Array Uint8ClampedArray WeakMap WeakSet atob btoa caches clearInterval clearTimeout console decodeURI decodeURIComponent encodeURI encodeURIComponent escape eval fetch indexedDB isFinite isNaN onerror onrejectionhandled onunhandledrejection parseFloat parseInt performance setTimeout setInterval undefined unescape".split(" "); -e=function(a){const b=new Aa;b.isConnected=!0;b.appendChild(b.body=b.createElement("body"));a&&(Da(b,a),Ea(),Fa());return b}(self.postMessage);e={document:e,addEventListener:e.addEventListener.bind(e),removeEventListener:e.removeEventListener.bind(e),localStorage:{},location:{},url:"/",appendKeys:(a)=>{a=a.filter((a)=>!p.prototype.hasOwnProperty(a));if(!(0>=a.length)){var b=p.prototype.length||0;0!==b?p.prototype.length=b+a.length:Object.defineProperty(p.prototype,"length",{configurable:!0,writable:!0, -value:a.length});a.forEach((a,d)=>{const c=a.replace(/(webkit|ms|moz|khtml)/g,"-$1").replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase();p.prototype[d+b]=c;Object.defineProperties(p.prototype,{[a]:{get(){return this.getPropertyValue(c)},set(a){this.setProperty(c,a)}}})})}}};(function(a){let b=a;for(;b&&b.constructor!==EventTarget;)Object.getOwnPropertyNames(b).forEach((a)=>{var c=b;if(!(0<=Na.indexOf(a)))try{delete c[a]}catch(Oa){}}),b=Object.getPrototypeOf(b)})(self);V.workerDOM=e;return V}({}); -//# sourceMappingURL=worker.safe.mjs.map diff --git a/dist/worker.safe.mjs.map b/dist/worker.safe.mjs.map deleted file mode 100644 index 0af83cef1..000000000 --- a/dist/worker.safe.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"worker.safe.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file