@mercuryworkshop/scramjet 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +3 -3
- package/README.md +89 -21
- package/dist/scramjet.all.js +196 -0
- package/dist/scramjet.all.js.map +1 -0
- package/dist/scramjet.bundle.js +196 -7
- package/dist/scramjet.bundle.js.map +1 -7
- package/dist/scramjet.sync.js +2 -0
- package/dist/scramjet.sync.js.map +1 -0
- package/dist/scramjet.wasm.wasm +0 -0
- package/dist/types/client/client.d.ts +78 -0
- package/dist/types/client/entry.d.ts +8 -0
- package/dist/types/client/events.d.ts +66 -0
- package/dist/types/client/helpers.d.ts +1 -0
- package/dist/types/client/index.d.ts +8 -0
- package/dist/types/client/location.d.ts +2 -0
- package/dist/types/client/shared/eval.d.ts +3 -0
- package/dist/types/client/shared/sourcemaps.d.ts +19 -0
- package/dist/types/client/shared/wrap.d.ts +4 -0
- package/dist/types/client/singletonbox.d.ts +12 -0
- package/dist/types/client/swruntime.d.ts +40 -0
- package/dist/types/controller/controller.d.ts +16 -0
- package/dist/types/controller/frame.d.ts +103 -0
- package/dist/types/controller/index.d.ts +2 -0
- package/dist/types/entry.d.ts +160 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/shared/cookie.d.ts +18 -0
- package/dist/types/shared/headers.d.ts +4 -0
- package/dist/types/shared/htmlRules.d.ts +6 -0
- package/dist/types/shared/index.d.ts +12 -0
- package/dist/types/shared/rewriters/css.d.ts +3 -0
- package/dist/types/shared/rewriters/headers.d.ts +18 -0
- package/dist/types/shared/rewriters/html.d.ts +6 -0
- package/dist/types/shared/rewriters/index.d.ts +7 -0
- package/dist/types/shared/rewriters/js.d.ts +10 -0
- package/dist/types/shared/rewriters/url.d.ts +10 -0
- package/dist/types/shared/rewriters/wasm.d.ts +7 -0
- package/dist/types/shared/rewriters/worker.d.ts +2 -0
- package/dist/types/shared/security/forceReferrer.d.ts +49 -0
- package/dist/types/shared/security/index.d.ts +2 -0
- package/dist/types/shared/security/siteTests.d.ts +33 -0
- package/dist/types/symbols.d.ts +7 -0
- package/dist/types/types.d.ts +135 -0
- package/dist/types/worker/error.d.ts +2 -0
- package/dist/types/worker/fakesw.d.ts +12 -0
- package/dist/types/worker/fetch.d.ts +26 -0
- package/dist/types/worker/index.d.ts +143 -0
- package/lib/index.cjs +7 -0
- package/lib/index.d.ts +8 -3
- package/lib/noop.js +0 -0
- package/package.json +101 -34
- package/dist/scramjet.client.js +0 -1
- package/dist/scramjet.client.js.map +0 -7
- package/dist/scramjet.codecs.js +0 -3
- package/dist/scramjet.codecs.js.map +0 -7
- package/dist/scramjet.config.js +0 -1
- package/dist/scramjet.config.js.map +0 -7
- package/dist/scramjet.worker.js +0 -42
- package/dist/scramjet.worker.js.map +0 -7
- package/lib/index.js +0 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scramjet.all.js","sources":["webpack://@mercuryworkshop/scramjet/./node_modules/.pnpm/set-cookie-parser@2.7.1/node_modules/set-cookie-parser/lib/set-cookie.js","webpack://@mercuryworkshop/scramjet//home/runner/work/scramjet/scramjet/src/clientsync/^\\.\\/.*$/","webpack://@mercuryworkshop/scramjet/./srcsync","webpack://@mercuryworkshop/scramjet/./src/client/client.ts","webpack://@mercuryworkshop/scramjet/./src/client/dom/attr.ts","webpack://@mercuryworkshop/scramjet/./src/client/dom/beacon.ts","webpack://@mercuryworkshop/scramjet/./src/client/dom/cookie.ts","webpack://@mercuryworkshop/scramjet/./src/client/dom/css.ts","webpack://@mercuryworkshop/scramjet/./src/client/dom/document.ts","webpack://@mercuryworkshop/scramjet/./src/client/dom/element.ts","webpack://@mercuryworkshop/scramjet/./src/client/dom/fontface.ts","webpack://@mercuryworkshop/scramjet/./src/client/dom/fragments.ts","webpack://@mercuryworkshop/scramjet/./src/client/dom/history.ts","webpack://@mercuryworkshop/scramjet/./src/client/dom/open.ts","webpack://@mercuryworkshop/scramjet/./src/client/dom/origin.ts","webpack://@mercuryworkshop/scramjet/./src/client/dom/performance.ts","webpack://@mercuryworkshop/scramjet/./src/client/dom/protocol.ts","webpack://@mercuryworkshop/scramjet/./src/client/dom/serviceworker.ts","webpack://@mercuryworkshop/scramjet/./src/client/dom/storage.ts","webpack://@mercuryworkshop/scramjet/./src/client/entry.ts","webpack://@mercuryworkshop/scramjet/./src/client/events.ts","webpack://@mercuryworkshop/scramjet/./src/client/helpers.ts","webpack://@mercuryworkshop/scramjet/./src/client/location.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/antiantidebugger.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/blob.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/caches.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/chrome.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/err.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/error.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/eval.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/event.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/function.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/import.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/indexeddb.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/opfs.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/postmessage.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/realm.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/requests/eventsource.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/requests/fetch.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/requests/websocket.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/requests/xmlhttprequest.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/settimeout.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/sourcemaps.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/worker.ts","webpack://@mercuryworkshop/scramjet/./src/client/shared/wrap.ts","webpack://@mercuryworkshop/scramjet/./src/client/singletonbox.ts","webpack://@mercuryworkshop/scramjet/./src/client/swruntime.ts","webpack://@mercuryworkshop/scramjet/./src/client/worker/importScripts.ts","webpack://@mercuryworkshop/scramjet/./src/controller/controller.ts","webpack://@mercuryworkshop/scramjet/./src/controller/frame.ts","webpack://@mercuryworkshop/scramjet/./src/controller/index.ts","webpack://@mercuryworkshop/scramjet/./src/log.ts","webpack://@mercuryworkshop/scramjet/./src/shared/cookie.ts","webpack://@mercuryworkshop/scramjet/./src/shared/headers.ts","webpack://@mercuryworkshop/scramjet/./src/shared/htmlRules.ts","webpack://@mercuryworkshop/scramjet/./src/shared/index.ts","webpack://@mercuryworkshop/scramjet/./src/shared/rewriters/css.ts","webpack://@mercuryworkshop/scramjet/./src/shared/rewriters/headers.ts","webpack://@mercuryworkshop/scramjet/./src/shared/rewriters/html.ts","webpack://@mercuryworkshop/scramjet/./src/shared/rewriters/js.ts","webpack://@mercuryworkshop/scramjet/./src/shared/rewriters/url.ts","webpack://@mercuryworkshop/scramjet/./src/shared/rewriters/wasm.ts","webpack://@mercuryworkshop/scramjet/./src/shared/rewriters/worker.ts","webpack://@mercuryworkshop/scramjet/./src/shared/security/forceReferrer.ts","webpack://@mercuryworkshop/scramjet/./src/shared/security/siteTests.ts","webpack://@mercuryworkshop/scramjet/./src/symbols.ts","webpack://@mercuryworkshop/scramjet/./src/worker/error.ts","webpack://@mercuryworkshop/scramjet/./src/worker/fakesw.ts","webpack://@mercuryworkshop/scramjet/./src/worker/fetch.ts","webpack://@mercuryworkshop/scramjet/./src/worker/index.ts","webpack://@mercuryworkshop/scramjet/./node_modules/.pnpm/@mercuryworkshop+bare-mux@2.1.9/node_modules/@mercuryworkshop/bare-mux/dist/index.mjs","webpack://@mercuryworkshop/scramjet/./node_modules/.pnpm/dom-serializer@2.0.0/node_modules/dom-serializer/lib/esm/foreignNames.js","webpack://@mercuryworkshop/scramjet/./node_modules/.pnpm/dom-serializer@2.0.0/node_modules/dom-serializer/lib/esm/index.js","webpack://@mercuryworkshop/scramjet/./node_modules/.pnpm/domelementtype@2.3.0/node_modules/domelementtype/lib/esm/index.js","webpack://@mercuryworkshop/scramjet/./node_modules/.pnpm/domhandler@5.0.3/node_modules/domhandler/lib/esm/index.js","webpack://@mercuryworkshop/scramjet/./node_modules/.pnpm/domhandler@5.0.3/node_modules/domhandler/lib/esm/node.js","webpack://@mercuryworkshop/scramjet/./node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/helpers.js","webpack://@mercuryworkshop/scramjet/./node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/decode-codepoint.js","webpack://@mercuryworkshop/scramjet/./node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/decode.js","webpack://@mercuryworkshop/scramjet/./node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/escape.js","webpack://@mercuryworkshop/scramjet/./node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/generated/decode-data-html.js","webpack://@mercuryworkshop/scramjet/./node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/generated/decode-data-xml.js","webpack://@mercuryworkshop/scramjet/./node_modules/.pnpm/entities@6.0.1/node_modules/entities/dist/esm/index.js","webpack://@mercuryworkshop/scramjet/./node_modules/.pnpm/htmlparser2@10.0.0/node_modules/htmlparser2/dist/esm/Parser.js","webpack://@mercuryworkshop/scramjet/./node_modules/.pnpm/htmlparser2@10.0.0/node_modules/htmlparser2/dist/esm/Tokenizer.js","webpack://@mercuryworkshop/scramjet/./node_modules/.pnpm/idb@8.0.3/node_modules/idb/build/index.js","webpack://@mercuryworkshop/scramjet/./rewriter/wasm/out/snippets/wasm-4b0f351a8e6eeb46/inline0.js","webpack://@mercuryworkshop/scramjet/./rewriter/wasm/out/wasm.js","webpack://@mercuryworkshop/scramjet/webpack/runtime/compat_get_default_export","webpack://@mercuryworkshop/scramjet/webpack/runtime/define_property_getters","webpack://@mercuryworkshop/scramjet/webpack/runtime/has_own_property","webpack://@mercuryworkshop/scramjet/webpack/runtime/make_namespace_object","webpack://@mercuryworkshop/scramjet/./src/entry.ts"],"sourcesContent":["\"use strict\";\n\nvar defaultParseOptions = {\n decodeValues: true,\n map: false,\n silent: false,\n};\n\nfunction isNonEmptyString(str) {\n return typeof str === \"string\" && !!str.trim();\n}\n\nfunction parseString(setCookieValue, options) {\n var parts = setCookieValue.split(\";\").filter(isNonEmptyString);\n\n var nameValuePairStr = parts.shift();\n var parsed = parseNameValuePair(nameValuePairStr);\n var name = parsed.name;\n var value = parsed.value;\n\n options = options\n ? Object.assign({}, defaultParseOptions, options)\n : defaultParseOptions;\n\n try {\n value = options.decodeValues ? decodeURIComponent(value) : value; // decode cookie value\n } catch (e) {\n console.error(\n \"set-cookie-parser encountered an error while decoding a cookie with value '\" +\n value +\n \"'. Set options.decodeValues to false to disable this feature.\",\n e\n );\n }\n\n var cookie = {\n name: name,\n value: value,\n };\n\n parts.forEach(function (part) {\n var sides = part.split(\"=\");\n var key = sides.shift().trimLeft().toLowerCase();\n var value = sides.join(\"=\");\n if (key === \"expires\") {\n cookie.expires = new Date(value);\n } else if (key === \"max-age\") {\n cookie.maxAge = parseInt(value, 10);\n } else if (key === \"secure\") {\n cookie.secure = true;\n } else if (key === \"httponly\") {\n cookie.httpOnly = true;\n } else if (key === \"samesite\") {\n cookie.sameSite = value;\n } else if (key === \"partitioned\") {\n cookie.partitioned = true;\n } else {\n cookie[key] = value;\n }\n });\n\n return cookie;\n}\n\nfunction parseNameValuePair(nameValuePairStr) {\n // Parses name-value-pair according to rfc6265bis draft\n\n var name = \"\";\n var value = \"\";\n var nameValueArr = nameValuePairStr.split(\"=\");\n if (nameValueArr.length > 1) {\n name = nameValueArr.shift();\n value = nameValueArr.join(\"=\"); // everything after the first =, joined by a \"=\" if there was more than one part\n } else {\n value = nameValuePairStr;\n }\n\n return { name: name, value: value };\n}\n\nfunction parse(input, options) {\n options = options\n ? Object.assign({}, defaultParseOptions, options)\n : defaultParseOptions;\n\n if (!input) {\n if (!options.map) {\n return [];\n } else {\n return {};\n }\n }\n\n if (input.headers) {\n if (typeof input.headers.getSetCookie === \"function\") {\n // for fetch responses - they combine headers of the same type in the headers array,\n // but getSetCookie returns an uncombined array\n input = input.headers.getSetCookie();\n } else if (input.headers[\"set-cookie\"]) {\n // fast-path for node.js (which automatically normalizes header names to lower-case\n input = input.headers[\"set-cookie\"];\n } else {\n // slow-path for other environments - see #25\n var sch =\n input.headers[\n Object.keys(input.headers).find(function (key) {\n return key.toLowerCase() === \"set-cookie\";\n })\n ];\n // warn if called on a request-like object with a cookie header rather than a set-cookie header - see #34, 36\n if (!sch && input.headers.cookie && !options.silent) {\n console.warn(\n \"Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning.\"\n );\n }\n input = sch;\n }\n }\n if (!Array.isArray(input)) {\n input = [input];\n }\n\n if (!options.map) {\n return input.filter(isNonEmptyString).map(function (str) {\n return parseString(str, options);\n });\n } else {\n var cookies = {};\n return input.filter(isNonEmptyString).reduce(function (cookies, str) {\n var cookie = parseString(str, options);\n cookies[cookie.name] = cookie;\n return cookies;\n }, cookies);\n }\n}\n\n/*\n Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas\n that are within a single set-cookie field-value, such as in the Expires portion.\n\n This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2\n Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128\n React Native's fetch does this for *every* header, including set-cookie.\n\n Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25\n Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation\n*/\nfunction splitCookiesString(cookiesString) {\n if (Array.isArray(cookiesString)) {\n return cookiesString;\n }\n if (typeof cookiesString !== \"string\") {\n return [];\n }\n\n var cookiesStrings = [];\n var pos = 0;\n var start;\n var ch;\n var lastComma;\n var nextStart;\n var cookiesSeparatorFound;\n\n function skipWhitespace() {\n while (pos < cookiesString.length && /\\s/.test(cookiesString.charAt(pos))) {\n pos += 1;\n }\n return pos < cookiesString.length;\n }\n\n function notSpecialChar() {\n ch = cookiesString.charAt(pos);\n\n return ch !== \"=\" && ch !== \";\" && ch !== \",\";\n }\n\n while (pos < cookiesString.length) {\n start = pos;\n cookiesSeparatorFound = false;\n\n while (skipWhitespace()) {\n ch = cookiesString.charAt(pos);\n if (ch === \",\") {\n // ',' is a cookie separator if we have later first '=', not ';' or ','\n lastComma = pos;\n pos += 1;\n\n skipWhitespace();\n nextStart = pos;\n\n while (pos < cookiesString.length && notSpecialChar()) {\n pos += 1;\n }\n\n // currently special character\n if (pos < cookiesString.length && cookiesString.charAt(pos) === \"=\") {\n // we found cookies separator\n cookiesSeparatorFound = true;\n // pos is inside the next cookie, so back up and return it.\n pos = nextStart;\n cookiesStrings.push(cookiesString.substring(start, lastComma));\n start = pos;\n } else {\n // in param ',' or param separator ';',\n // we continue from that comma\n pos = lastComma + 1;\n }\n } else {\n pos += 1;\n }\n }\n\n if (!cookiesSeparatorFound || pos >= cookiesString.length) {\n cookiesStrings.push(cookiesString.substring(start, cookiesString.length));\n }\n }\n\n return cookiesStrings;\n}\n\nmodule.exports = parse;\nmodule.exports.parse = parse;\nmodule.exports.parseString = parseString;\nmodule.exports.splitCookiesString = splitCookiesString;\n","var map = {\n \"./\": \"3255\",\n \"./client\": \"336\",\n \"./client.ts\": \"336\",\n \"./dom/attr\": \"1077\",\n \"./dom/attr.ts\": \"1077\",\n \"./dom/beacon\": \"7430\",\n \"./dom/beacon.ts\": \"7430\",\n \"./dom/cookie\": \"9116\",\n \"./dom/cookie.ts\": \"9116\",\n \"./dom/css\": \"6447\",\n \"./dom/css.ts\": \"6447\",\n \"./dom/document\": \"5351\",\n \"./dom/document.ts\": \"5351\",\n \"./dom/element\": \"7828\",\n \"./dom/element.ts\": \"7828\",\n \"./dom/fontface\": \"5426\",\n \"./dom/fontface.ts\": \"5426\",\n \"./dom/fragments\": \"5465\",\n \"./dom/fragments.ts\": \"5465\",\n \"./dom/history\": \"9804\",\n \"./dom/history.ts\": \"9804\",\n \"./dom/open\": \"7758\",\n \"./dom/open.ts\": \"7758\",\n \"./dom/origin\": \"6012\",\n \"./dom/origin.ts\": \"6012\",\n \"./dom/performance\": \"6286\",\n \"./dom/performance.ts\": \"6286\",\n \"./dom/protocol\": \"1974\",\n \"./dom/protocol.ts\": \"1974\",\n \"./dom/serviceworker\": \"9201\",\n \"./dom/serviceworker.ts\": \"9201\",\n \"./dom/storage\": \"5289\",\n \"./dom/storage.ts\": \"5289\",\n \"./entry\": \"1323\",\n \"./entry.ts\": \"1323\",\n \"./events\": \"1862\",\n \"./events.ts\": \"1862\",\n \"./helpers\": \"94\",\n \"./helpers.ts\": \"94\",\n \"./index\": \"3255\",\n \"./index.ts\": \"3255\",\n \"./location\": \"3696\",\n \"./location.ts\": \"3696\",\n \"./shared/antiantidebugger\": \"8382\",\n \"./shared/antiantidebugger.ts\": \"8382\",\n \"./shared/blob\": \"4634\",\n \"./shared/blob.ts\": \"4634\",\n \"./shared/caches\": \"5026\",\n \"./shared/caches.ts\": \"5026\",\n \"./shared/chrome\": \"6627\",\n \"./shared/chrome.ts\": \"6627\",\n \"./shared/err\": \"582\",\n \"./shared/err.ts\": \"582\",\n \"./shared/error\": \"6143\",\n \"./shared/error.ts\": \"6143\",\n \"./shared/eval\": \"591\",\n \"./shared/eval.ts\": \"591\",\n \"./shared/event\": \"3481\",\n \"./shared/event.ts\": \"3481\",\n \"./shared/function\": \"249\",\n \"./shared/function.ts\": \"249\",\n \"./shared/import\": \"2468\",\n \"./shared/import.ts\": \"2468\",\n \"./shared/indexeddb\": \"4338\",\n \"./shared/indexeddb.ts\": \"4338\",\n \"./shared/opfs\": \"6593\",\n \"./shared/opfs.ts\": \"6593\",\n \"./shared/postmessage\": \"1320\",\n \"./shared/postmessage.ts\": \"1320\",\n \"./shared/realm\": \"1914\",\n \"./shared/realm.ts\": \"1914\",\n \"./shared/requests/eventsource\": \"9701\",\n \"./shared/requests/eventsource.ts\": \"9701\",\n \"./shared/requests/fetch\": \"6972\",\n \"./shared/requests/fetch.ts\": \"6972\",\n \"./shared/requests/websocket\": \"9931\",\n \"./shared/requests/websocket.ts\": \"9931\",\n \"./shared/requests/xmlhttprequest\": \"248\",\n \"./shared/requests/xmlhttprequest.ts\": \"248\",\n \"./shared/settimeout\": \"7418\",\n \"./shared/settimeout.ts\": \"7418\",\n \"./shared/sourcemaps\": \"7791\",\n \"./shared/sourcemaps.ts\": \"7791\",\n \"./shared/worker\": \"9399\",\n \"./shared/worker.ts\": \"9399\",\n \"./shared/wrap\": \"581\",\n \"./shared/wrap.ts\": \"581\",\n \"./singletonbox\": \"1229\",\n \"./singletonbox.ts\": \"1229\",\n \"./swruntime\": \"8409\",\n \"./swruntime.ts\": \"8409\",\n \"./worker/importScripts\": \"9353\",\n \"./worker/importScripts.ts\": \"9353\"\n};\n\n\nfunction webpackContext(req) {\n var id = webpackContextResolve(req);\n return __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n if(!__webpack_require__.o(map, req)) {\n var e = new Error(\"Cannot find module '\" + req + \"'\");\n e.code = 'MODULE_NOT_FOUND';\n throw e;\n }\n return map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n return Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 7302;\n","function webpackEmptyContext(req) {\n var e = new Error(\"Cannot find module '\" + req + \"'\");\n e.code = 'MODULE_NOT_FOUND';\n throw e;\n}\nwebpackEmptyContext.keys = () => ([]);\nwebpackEmptyContext.resolve = webpackEmptyContext;\nwebpackEmptyContext.id = 409;\nmodule.exports = webpackEmptyContext;\n","import { ScramjetFrame } from \"@/controller/frame\";\nimport { SCRAMJETCLIENT, SCRAMJETFRAME } from \"@/symbols\";\nimport { getOwnPropertyDescriptorHandler } from \"@client/helpers\";\nimport { createLocationProxy } from \"@client/location\";\nimport { createWrapFn } from \"@client/shared/wrap\";\nimport { NavigateEvent } from \"@client/events\";\nimport { rewriteUrl, unrewriteUrl, type URLMeta } from \"@rewriters/url\";\nimport { config, flagEnabled } from \"@/shared\";\nimport { CookieStore } from \"@/shared/cookie\";\nimport { iswindow } from \"./entry\";\nimport { SingletonBox } from \"./singletonbox\";\nimport BareClient from \"@mercuryworkshop/bare-mux\";\n\ntype NativeStore = {\n\tstore: Record<string, any>;\n\tcall: (target: string, that: any, ...args) => any;\n\tconstruct: (target: string, ...args) => any;\n};\ntype DescriptorStore = {\n\tstore: Record<string, PropertyDescriptor>;\n\tget: (target: string, that: any) => any;\n\tset: (target: string, that: any, value: any) => void;\n};\n//eslint-disable-next-line\nexport type AnyFunction = Function;\n\nexport type ScramjetModule = {\n\tenabled: (client: ScramjetClient) => boolean | undefined;\n\tdisabled: (\n\t\tclient: ScramjetClient,\n\t\tself: typeof globalThis\n\t) => void | undefined;\n\torder: number | undefined;\n\tdefault: (client: ScramjetClient, self: typeof globalThis) => void;\n};\n\nexport type ProxyCtx = {\n\tfn: AnyFunction;\n\tthis: any;\n\targs: any[];\n\tnewTarget: AnyFunction;\n\treturn: (r: any) => void;\n\tcall: () => any;\n};\nexport type Proxy = {\n\tconstruct?(ctx: ProxyCtx): any;\n\tapply?(ctx: ProxyCtx): any;\n};\n\nexport type TrapCtx<T> = {\n\tthis: any;\n\tget: () => T;\n\tset: (v: T) => void;\n};\nexport type Trap<T> = {\n\twritable?: boolean;\n\tvalue?: any;\n\tenumerable?: boolean;\n\tconfigurable?: boolean;\n\tget?: (ctx: TrapCtx<T>) => T;\n\tset?: (ctx: TrapCtx<T>, v: T) => void;\n};\n\nexport class ScramjetClient {\n\tlocationProxy: any;\n\tserviceWorker: ServiceWorkerContainer;\n\t// epoxy: EpoxyClient;\n\tbare: BareClient;\n\n\tnatives: NativeStore;\n\tdescriptors: DescriptorStore;\n\twrapfn: (i: any, ...args: any) => any;\n\n\tcookieStore = new CookieStore();\n\n\teventcallbacks: Map<\n\t\tany,\n\t\t[\n\t\t\t{\n\t\t\t\tevent: string;\n\t\t\t\toriginalCallback: AnyFunction;\n\t\t\t\tproxiedCallback: AnyFunction;\n\t\t\t},\n\t\t]\n\t> = new Map();\n\n\tmeta: URLMeta;\n\n\tbox: SingletonBox;\n\n\tconstructor(public global: typeof globalThis) {\n\t\tif (SCRAMJETCLIENT in global) {\n\t\t\tconsole.error(\n\t\t\t\t\"attempted to initialize a scramjet client, but one is already loaded - this is very bad\"\n\t\t\t);\n\t\t\tthrow new Error();\n\t\t}\n\n\t\tif (iswindow) {\n\t\t\ttry {\n\t\t\t\tif (SCRAMJETCLIENT in global.parent) {\n\t\t\t\t\tthis.box = global.parent[SCRAMJETCLIENT].box;\n\t\t\t\t}\n\t\t\t} catch {}\n\t\t\ttry {\n\t\t\t\tif (SCRAMJETCLIENT in global.top) {\n\t\t\t\t\tthis.box = global.top[SCRAMJETCLIENT].box;\n\t\t\t\t}\n\t\t\t} catch {}\n\t\t\ttry {\n\t\t\t\tif (global.opener && SCRAMJETCLIENT in global.opener) {\n\t\t\t\t\tthis.box = global.opener[SCRAMJETCLIENT].box;\n\t\t\t\t}\n\t\t\t} catch {}\n\t\t\tif (!this.box) {\n\t\t\t\tdbg.warn(\"Creating SingletonBox\");\n\t\t\t\tthis.box = new SingletonBox(this);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.box = new SingletonBox(this);\n\t\t}\n\n\t\tthis.box.registerClient(this, global as Self);\n\n\t\t/*\n\t\tinitEpoxy().then(() => {\n\t\t\tlet options = new EpoxyClientOptions();\n\t\t\toptions.user_agent = navigator.userAgent;\n\t\t\tthis.epoxy = new EpoxyClient(config.wisp, options);\n\t\t});\n\t\t*/\n\n\t\tif (iswindow) {\n\t\t\t// this.bare = new EpoxyClient();\n\t\t\tthis.bare = new BareClient();\n\t\t} else {\n\t\t\tthis.bare = new BareClient(\n\t\t\t\tnew Promise((resolve) => {\n\t\t\t\t\taddEventListener(\"message\", ({ data }) => {\n\t\t\t\t\t\tif (typeof data !== \"object\") return;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\"$scramjet$type\" in data &&\n\t\t\t\t\t\t\tdata.$scramjet$type === \"baremuxinit\"\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tresolve(data.port);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\n\t\tthis.serviceWorker = this.global.navigator.serviceWorker;\n\n\t\tif (iswindow) {\n\t\t\tglobal.document[SCRAMJETCLIENT] = this;\n\t\t}\n\n\t\tthis.wrapfn = createWrapFn(this, global);\n\t\tthis.natives = {\n\t\t\tstore: new Proxy(\n\t\t\t\t{},\n\t\t\t\t{\n\t\t\t\t\tget: (target, prop: string) => {\n\t\t\t\t\t\tif (prop in target) {\n\t\t\t\t\t\t\treturn target[prop];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst split = prop.split(\".\");\n\t\t\t\t\t\tconst realProp = split.pop();\n\t\t\t\t\t\tconst realTarget = split.reduce((a, b) => a?.[b], this.global);\n\n\t\t\t\t\t\tif (!realTarget) return;\n\n\t\t\t\t\t\tconst original = Reflect.get(realTarget, realProp);\n\t\t\t\t\t\ttarget[prop] = original;\n\n\t\t\t\t\t\treturn target[prop];\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t),\n\t\t\tconstruct(target: string, ...args) {\n\t\t\t\tconst original = this.store[target];\n\t\t\t\tif (!original) return null;\n\n\t\t\t\treturn new original(...args);\n\t\t\t},\n\t\t\tcall(target: string, that: any, ...args) {\n\t\t\t\tconst original = this.store[target];\n\t\t\t\tif (!original) return null;\n\n\t\t\t\treturn original.call(that, ...args);\n\t\t\t},\n\t\t};\n\t\tthis.descriptors = {\n\t\t\tstore: new Proxy(\n\t\t\t\t{},\n\t\t\t\t{\n\t\t\t\t\tget: (target, prop: string) => {\n\t\t\t\t\t\tif (prop in target) {\n\t\t\t\t\t\t\treturn target[prop];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst split = prop.split(\".\");\n\t\t\t\t\t\tconst realProp = split.pop();\n\t\t\t\t\t\tconst realTarget = split.reduce((a, b) => a?.[b], this.global);\n\n\t\t\t\t\t\tif (!realTarget) return;\n\n\t\t\t\t\t\tconst original = client.natives.call(\n\t\t\t\t\t\t\t\"Object.getOwnPropertyDescriptor\",\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\trealTarget,\n\t\t\t\t\t\t\trealProp\n\t\t\t\t\t\t);\n\t\t\t\t\t\ttarget[prop] = original;\n\n\t\t\t\t\t\treturn target[prop];\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t),\n\t\t\tget(target: string, that: any) {\n\t\t\t\tconst original = this.store[target];\n\t\t\t\tif (!original) return null;\n\n\t\t\t\treturn original.get.call(that);\n\t\t\t},\n\t\t\tset(target: string, that: any, value: any) {\n\t\t\t\tconst original = this.store[target];\n\t\t\t\tif (!original) return null;\n\n\t\t\t\toriginal.set.call(that, value);\n\t\t\t},\n\t\t};\n\t\t// eslint-disable-next-line @typescript-eslint/no-this-alias\n\t\tconst client = this;\n\t\tthis.meta = {\n\t\t\tget origin() {\n\t\t\t\treturn client.url;\n\t\t\t},\n\t\t\tget base() {\n\t\t\t\tif (iswindow) {\n\t\t\t\t\tconst base = client.natives.call(\n\t\t\t\t\t\t\"Document.prototype.querySelector\",\n\t\t\t\t\t\tclient.global.document,\n\t\t\t\t\t\t\"base\"\n\t\t\t\t\t);\n\t\t\t\t\tif (base) {\n\t\t\t\t\t\tlet url = base.getAttribute(\"href\");\n\t\t\t\t\t\tif (!url) return client.url;\n\t\t\t\t\t\tconst frag = url.indexOf(\"#\");\n\t\t\t\t\t\turl = url.substring(0, frag === -1 ? undefined : frag);\n\t\t\t\t\t\tif (!url) return client.url;\n\n\t\t\t\t\t\treturn new URL(url, client.url.origin);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn client.url;\n\t\t\t},\n\t\t\tget topFrameName() {\n\t\t\t\tif (!iswindow)\n\t\t\t\t\tthrow new Error(\"topFrameName was called from a worker?\");\n\n\t\t\t\tlet currentWin = client.global;\n\t\t\t\tif (currentWin.parent.window == currentWin.window) {\n\t\t\t\t\t// we're top level & we don't have a frame name\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t// find the topmost frame that's controlled by scramjet, stopping before the real top frame\n\t\t\t\twhile (currentWin.parent.window !== currentWin.window) {\n\t\t\t\t\tif (!currentWin.parent.window[SCRAMJETCLIENT]) break;\n\t\t\t\t\tcurrentWin = currentWin.parent.window;\n\t\t\t\t}\n\n\t\t\t\tconst curclient = currentWin[SCRAMJETCLIENT];\n\t\t\t\tconst frame = curclient.descriptors.get(\n\t\t\t\t\t\"window.frameElement\",\n\t\t\t\t\tcurrentWin\n\t\t\t\t);\n\t\t\t\tif (!frame) {\n\t\t\t\t\t// we're inside an iframe, but the top frame is scramjet-controlled and top level, so we can't get a top frame name\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tif (!frame.name) {\n\t\t\t\t\t// the top frame is scramjet-controlled, but it has no name. this is user error\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\"YOU NEED TO USE `new ScramjetFrame()`! DIRECT IFRAMES WILL NOT WORK\"\n\t\t\t\t\t);\n\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn frame.name;\n\t\t\t},\n\t\t\tget parentFrameName() {\n\t\t\t\tif (!iswindow)\n\t\t\t\t\tthrow new Error(\"parentFrameName was called from a worker?\");\n\t\t\t\tif (client.global.parent.window == client.global.window) {\n\t\t\t\t\t// we're top level & we don't have a frame name\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tlet parentWin = client.global.parent.window;\n\t\t\t\tif (parentWin[SCRAMJETCLIENT]) {\n\t\t\t\t\t// we're inside an iframe, and the parent is scramjet-controlled\n\t\t\t\t\tconst parentClient = parentWin[SCRAMJETCLIENT];\n\t\t\t\t\tconst frame = parentClient.descriptors.get(\n\t\t\t\t\t\t\"window.frameElement\",\n\t\t\t\t\t\tparentWin\n\t\t\t\t\t);\n\n\t\t\t\t\tif (!frame) {\n\t\t\t\t\t\t// parent is scramjet controlled and top-level. there is no parent frame name\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!frame.name) {\n\t\t\t\t\t\t// the parent frame is scramjet-controlled, but it has no name. this is user error\n\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t\"YOU NEED TO USE `new ScramjetFrame()`! DIRECT IFRAMES WILL NOT WORK\"\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn frame.name;\n\t\t\t\t} else {\n\t\t\t\t\t// we're inside an iframe, and the parent is not scramjet-controlled\n\t\t\t\t\t// return our own frame name\n\t\t\t\t\tconst frame = client.descriptors.get(\n\t\t\t\t\t\t\"window.frameElement\",\n\t\t\t\t\t\tclient.global\n\t\t\t\t\t);\n\t\t\t\t\tif (!frame.name) {\n\t\t\t\t\t\t// the parent frame is not scramjet-controlled, so we can't get a parent frame name\n\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t\"YOU NEED TO USE `new ScramjetFrame()`! DIRECT IFRAMES WILL NOT WORK\"\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn frame.name;\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t\tthis.locationProxy = createLocationProxy(this, global);\n\n\t\tglobal[SCRAMJETCLIENT] = this;\n\t}\n\n\tget frame(): ScramjetFrame | null {\n\t\tif (!iswindow) return null;\n\t\tconst frame = this.descriptors.get(\"window.frameElement\", this.global);\n\n\t\tif (!frame) return null; // we're top level\n\t\tconst sframe = frame[SCRAMJETFRAME];\n\n\t\tif (!sframe) {\n\t\t\t// we're in a subframe, recurse upward until we find one\n\t\t\tlet currentwin = this.global.window;\n\t\t\twhile (currentwin.parent !== currentwin) {\n\t\t\t\tlet currentclient = currentwin[SCRAMJETCLIENT];\n\t\t\t\tlet currentFrame = currentclient.descriptors.get(\n\t\t\t\t\t\"window.frameElement\",\n\t\t\t\t\tcurrentwin\n\t\t\t\t);\n\t\t\t\tif (!currentFrame) return null; // ??\n\t\t\t\tif (currentFrame && currentFrame[SCRAMJETFRAME]) {\n\t\t\t\t\treturn currentFrame[SCRAMJETFRAME];\n\t\t\t\t}\n\t\t\t\tcurrentwin = currentwin.parent.window;\n\t\t\t}\n\t\t}\n\n\t\treturn sframe;\n\t}\n\tget isSubframe(): boolean {\n\t\tif (!iswindow) return false;\n\t\tconst frame = this.descriptors.get(\"window.frameElement\", this.global);\n\n\t\tif (!frame) return false; // we're top level\n\t\tconst sframe = frame[SCRAMJETFRAME];\n\t\tif (!sframe) return true;\n\n\t\treturn false;\n\t}\n\tloadcookies(cookiestr: string) {\n\t\tthis.cookieStore.load(cookiestr);\n\t}\n\n\thook() {\n\t\tconst context = import.meta.webpackContext(\".\", {\n\t\t\trecursive: true,\n\t\t});\n\n\t\tconst modules: ScramjetModule[] = [];\n\n\t\tfor (const key of context.keys()) {\n\t\t\tconst module = context(key) as ScramjetModule;\n\t\t\tif (!key.endsWith(\".ts\")) continue;\n\t\t\tif (\n\t\t\t\t(key.startsWith(\"./dom/\") && \"window\" in this.global) ||\n\t\t\t\t(key.startsWith(\"./worker/\") && \"WorkerGlobalScope\" in this.global) ||\n\t\t\t\tkey.startsWith(\"./shared/\")\n\t\t\t) {\n\t\t\t\tmodules.push(module);\n\t\t\t}\n\t\t}\n\n\t\tmodules.sort((a, b) => {\n\t\t\tconst aorder = a.order || 0;\n\t\t\tconst border = b.order || 0;\n\n\t\t\treturn aorder - border;\n\t\t});\n\n\t\tfor (const module of modules) {\n\t\t\tif (!module.enabled || module.enabled(this))\n\t\t\t\tmodule.default(this, this.global);\n\t\t\telse if (module.disabled) module.disabled(this, this.global);\n\t\t}\n\t}\n\n\tget url(): URL {\n\t\treturn new URL(unrewriteUrl(this.global.location.href));\n\t}\n\n\tset url(url: URL | string) {\n\t\tif (url instanceof URL) url = url.toString();\n\n\t\tconst ev = new NavigateEvent(url);\n\t\tif (this.frame) {\n\t\t\tthis.frame.dispatchEvent(ev);\n\t\t}\n\t\tif (ev.defaultPrevented) return;\n\n\t\tthis.global.location.href = rewriteUrl(ev.url, this.meta);\n\t}\n\n\t// below are the utilities for proxying and trapping dom APIs\n\t// you don't have to understand this it just makes the rest easier\n\t// i'll document it eventually\n\n\tProxy(name: string | string[], handler: Proxy) {\n\t\tif (Array.isArray(name)) {\n\t\t\tfor (const n of name) {\n\t\t\t\tthis.Proxy(n, handler);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst split = name.split(\".\");\n\t\tconst prop = split.pop();\n\t\tconst target = split.reduce((a, b) => a?.[b], this.global);\n\t\tif (!target) return;\n\n\t\tif (!(name in this.natives.store)) {\n\t\t\tconst original = Reflect.get(target, prop);\n\t\t\tthis.natives.store[name] = original;\n\t\t}\n\n\t\tthis.RawProxy(target, prop, handler);\n\t}\n\tRawProxy(target: any, prop: string, handler: Proxy) {\n\t\tif (!target) return;\n\t\tif (!prop) return;\n\t\tif (!Reflect.has(target, prop)) return;\n\n\t\tconst value = Reflect.get(target, prop);\n\t\tdelete target[prop];\n\n\t\tconst h: ProxyHandler<any> = {};\n\n\t\tif (handler.construct) {\n\t\t\th.construct = function (\n\t\t\t\tconstructor: any,\n\t\t\t\targs: any[],\n\t\t\t\tnewTarget: AnyFunction\n\t\t\t) {\n\t\t\t\tlet returnValue: any = undefined;\n\t\t\t\tlet earlyreturn = false;\n\n\t\t\t\tconst ctx: ProxyCtx = {\n\t\t\t\t\tfn: constructor,\n\t\t\t\t\tthis: null,\n\t\t\t\t\targs,\n\t\t\t\t\tnewTarget: newTarget,\n\t\t\t\t\treturn: (r: any) => {\n\t\t\t\t\t\tearlyreturn = true;\n\t\t\t\t\t\treturnValue = r;\n\t\t\t\t\t},\n\t\t\t\t\tcall: () => {\n\t\t\t\t\t\tearlyreturn = true;\n\t\t\t\t\t\treturnValue = Reflect.construct(ctx.fn, ctx.args, ctx.newTarget);\n\n\t\t\t\t\t\treturn returnValue;\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\thandler.construct(ctx);\n\n\t\t\t\tif (earlyreturn) {\n\t\t\t\t\treturn returnValue;\n\t\t\t\t}\n\n\t\t\t\treturn Reflect.construct(ctx.fn, ctx.args, ctx.newTarget);\n\t\t\t};\n\t\t}\n\n\t\tif (handler.apply) {\n\t\t\th.apply = (fn: any, that: any, args: any[]) => {\n\t\t\t\tlet returnValue: any = undefined;\n\t\t\t\tlet earlyreturn = false;\n\n\t\t\t\tconst ctx: ProxyCtx = {\n\t\t\t\t\tfn,\n\t\t\t\t\tthis: that,\n\t\t\t\t\targs,\n\t\t\t\t\tnewTarget: null,\n\t\t\t\t\treturn: (r: any) => {\n\t\t\t\t\t\tearlyreturn = true;\n\t\t\t\t\t\treturnValue = r;\n\t\t\t\t\t},\n\t\t\t\t\tcall: () => {\n\t\t\t\t\t\tearlyreturn = true;\n\t\t\t\t\t\treturnValue = Reflect.apply(ctx.fn, ctx.this, ctx.args);\n\n\t\t\t\t\t\treturn returnValue;\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tconst pst = Error.prepareStackTrace;\n\n\t\t\t\tError.prepareStackTrace = function (err, s) {\n\t\t\t\t\tif (\n\t\t\t\t\t\ts[0].getFileName() &&\n\t\t\t\t\t\t!s[0].getFileName().startsWith(location.origin + config.prefix)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn { stack: err.stack };\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\ttry {\n\t\t\t\t\thandler.apply(ctx);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (err instanceof Error) {\n\t\t\t\t\t\tif ((err.stack as any) instanceof Object) {\n\t\t\t\t\t\t\t//@ts-expect-error i'm not going to explain this\n\t\t\t\t\t\t\terr.stack = err.stack.stack;\n\t\t\t\t\t\t\tconsole.error(\"ERROR FROM SCRAMJET INTERNALS\", err);\n\t\t\t\t\t\t\tif (!flagEnabled(\"allowFailedIntercepts\", this.url)) {\n\t\t\t\t\t\t\t\tthrow err;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow err;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow err;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tError.prepareStackTrace = pst;\n\n\t\t\t\tif (earlyreturn) {\n\t\t\t\t\treturn returnValue;\n\t\t\t\t}\n\n\t\t\t\treturn Reflect.apply(ctx.fn, ctx.this, ctx.args);\n\t\t\t};\n\t\t}\n\n\t\th.getOwnPropertyDescriptor = getOwnPropertyDescriptorHandler;\n\t\ttarget[prop] = new Proxy(value, h);\n\t}\n\tTrap<T>(name: string | string[], descriptor: Trap<T>): PropertyDescriptor {\n\t\tif (Array.isArray(name)) {\n\t\t\tfor (const n of name) {\n\t\t\t\tthis.Trap(n, descriptor);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst split = name.split(\".\");\n\t\tconst prop = split.pop();\n\t\tconst target = split.reduce((a, b) => a?.[b], this.global);\n\t\tif (!target) return;\n\n\t\tconst original = this.natives.call(\n\t\t\t\"Object.getOwnPropertyDescriptor\",\n\t\t\tnull,\n\t\t\ttarget,\n\t\t\tprop\n\t\t);\n\t\tthis.descriptors.store[name] = original;\n\n\t\treturn this.RawTrap(target, prop, descriptor);\n\t}\n\tRawTrap<T>(\n\t\ttarget: any,\n\t\tprop: string,\n\t\tdescriptor: Trap<T>\n\t): PropertyDescriptor {\n\t\tif (!target) return;\n\t\tif (!prop) return;\n\t\tif (!Reflect.has(target, prop)) return;\n\n\t\tconst oldDescriptor = this.natives.call(\n\t\t\t\"Object.getOwnPropertyDescriptor\",\n\t\t\tnull,\n\t\t\ttarget,\n\t\t\tprop\n\t\t);\n\n\t\tconst ctx: TrapCtx<T> = {\n\t\t\tthis: null,\n\t\t\tget: function () {\n\t\t\t\treturn oldDescriptor && oldDescriptor.get.call(this.this);\n\t\t\t},\n\t\t\tset: function (v: T) {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-expressions\n\t\t\t\toldDescriptor && oldDescriptor.set.call(this.this, v);\n\t\t\t},\n\t\t};\n\n\t\tdelete target[prop];\n\n\t\tconst desc: PropertyDescriptor = {};\n\n\t\tif (descriptor.get) {\n\t\t\tdesc.get = function () {\n\t\t\t\tctx.this = this;\n\n\t\t\t\treturn descriptor.get(ctx);\n\t\t\t};\n\t\t} else if (oldDescriptor?.get) {\n\t\t\tdesc.get = oldDescriptor.get;\n\t\t}\n\n\t\tif (descriptor.set) {\n\t\t\tdesc.set = function (v: T) {\n\t\t\t\tctx.this = this;\n\n\t\t\t\tdescriptor.set(ctx, v);\n\t\t\t};\n\t\t} else if (oldDescriptor?.set) {\n\t\t\tdesc.set = oldDescriptor.set;\n\t\t}\n\n\t\tif (descriptor.enumerable) desc.enumerable = descriptor.enumerable;\n\t\telse if (oldDescriptor?.enumerable)\n\t\t\tdesc.enumerable = oldDescriptor.enumerable;\n\t\tif (descriptor.configurable) desc.configurable = descriptor.configurable;\n\t\telse if (oldDescriptor?.configurable)\n\t\t\tdesc.configurable = oldDescriptor.configurable;\n\n\t\tObject.defineProperty(target, prop, desc);\n\n\t\treturn oldDescriptor;\n\t}\n}\n","import { ScramjetClient } from \"@client/index\";\n\nexport default function (client: ScramjetClient, _self: typeof window) {\n\tclient.Trap(\"Element.prototype.attributes\", {\n\t\tget(ctx) {\n\t\t\tconst map = ctx.get() as NamedNodeMap;\n\t\t\tconst proxy = new Proxy(map, {\n\t\t\t\tget(target, prop, _receiver) {\n\t\t\t\t\tconst value = Reflect.get(target, prop);\n\n\t\t\t\t\tif (prop === \"length\") {\n\t\t\t\t\t\treturn Object.keys(proxy).length;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (prop === \"getNamedItem\") {\n\t\t\t\t\t\treturn (name: string) => proxy[name];\n\t\t\t\t\t}\n\t\t\t\t\tif (prop === \"getNamedItemNS\") {\n\t\t\t\t\t\treturn (namespace: string, name: string) =>\n\t\t\t\t\t\t\tproxy[`${namespace}:${name}`];\n\t\t\t\t\t}\n\n\t\t\t\t\tif (prop in NamedNodeMap.prototype && typeof value === \"function\") {\n\t\t\t\t\t\treturn new Proxy(value, {\n\t\t\t\t\t\t\tapply(target, that, args) {\n\t\t\t\t\t\t\t\tif (that === proxy) {\n\t\t\t\t\t\t\t\t\treturn Reflect.apply(target, map, args);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn Reflect.apply(target, that, args);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t(typeof prop === \"string\" || typeof prop === \"number\") &&\n\t\t\t\t\t\t!isNaN(Number(prop))\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst position = Object.keys(proxy)[prop];\n\n\t\t\t\t\t\treturn map[position];\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!this.has(target, prop)) return undefined;\n\n\t\t\t\t\treturn value;\n\t\t\t\t},\n\t\t\t\townKeys(target) {\n\t\t\t\t\tconst keys = Reflect.ownKeys(target);\n\n\t\t\t\t\treturn keys.filter((key) => this.has(target, key));\n\t\t\t\t},\n\t\t\t\thas(target, prop) {\n\t\t\t\t\tif (typeof prop === \"symbol\") return Reflect.has(target, prop);\n\t\t\t\t\tif (prop.startsWith(\"scramjet-attr-\")) return false;\n\t\t\t\t\tif (map[prop]?.name?.startsWith(\"scramjet-attr-\")) return false;\n\n\t\t\t\t\treturn Reflect.has(target, prop);\n\t\t\t\t},\n\t\t\t});\n\n\t\t\treturn proxy;\n\t\t},\n\t});\n\n\tclient.Trap([\"Attr.prototype.value\", \"Attr.prototype.nodeValue\"], {\n\t\tget(ctx) {\n\t\t\tif (ctx.this?.ownerElement) {\n\t\t\t\treturn ctx.this.ownerElement.getAttribute(ctx.this.name);\n\t\t\t}\n\n\t\t\treturn ctx.get();\n\t\t},\n\t\tset(ctx, value) {\n\t\t\tif (ctx.this?.ownerElement) {\n\t\t\t\treturn ctx.this.ownerElement.setAttribute(ctx.this.name, value);\n\t\t\t}\n\n\t\t\treturn ctx.set(value);\n\t\t},\n\t});\n}\n","import { rewriteUrl } from \"@rewriters/url\";\nimport { ScramjetClient } from \"@client/index\";\n\nexport default function (client: ScramjetClient, _self: Self) {\n\tclient.Proxy(\"Navigator.prototype.sendBeacon\", {\n\t\tapply(ctx) {\n\t\t\tctx.args[0] = rewriteUrl(ctx.args[0], client.meta);\n\t\t},\n\t});\n}\n","import type { MessageC2W, MessageW2C } from \"@/worker\";\nimport { ScramjetClient } from \"@client/index\";\n\nexport default function (client: ScramjetClient, self: typeof window) {\n\tclient.serviceWorker.addEventListener(\n\t\t\"message\",\n\t\t({ data }: { data: MessageW2C }) => {\n\t\t\tif (!(\"scramjet$type\" in data)) return;\n\n\t\t\tif (data.scramjet$type === \"cookie\") {\n\t\t\t\tclient.cookieStore.setCookies([data.cookie], new URL(data.url));\n\t\t\t\tconst msg = {\n\t\t\t\t\tscramjet$token: data.scramjet$token,\n\t\t\t\t\tscramjet$type: \"cookie\",\n\t\t\t\t};\n\t\t\t\tclient.serviceWorker.controller.postMessage(msg);\n\t\t\t}\n\t\t}\n\t);\n\n\tclient.Trap(\"Document.prototype.cookie\", {\n\t\tget() {\n\t\t\treturn client.cookieStore.getCookies(client.url, true);\n\t\t},\n\t\tset(ctx, value: string) {\n\t\t\tclient.cookieStore.setCookies([value], client.url);\n\t\t\tconst controller = client.descriptors.get(\n\t\t\t\t\"ServiceWorkerContainer.prototype.controller\",\n\t\t\t\tclient.serviceWorker\n\t\t\t);\n\t\t\tif (controller) {\n\t\t\t\tclient.natives.call(\"ServiceWorker.prototype.postMessage\", controller, {\n\t\t\t\t\tscramjet$type: \"cookie\",\n\t\t\t\t\tcookie: value,\n\t\t\t\t\turl: client.url.href,\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t});\n\n\t// @ts-ignore\n\tdelete self.cookieStore;\n}\n","import { rewriteCss, unrewriteCss } from \"@rewriters/css\";\nimport { ScramjetClient } from \"@client/index\";\n\nexport default function (client: ScramjetClient) {\n\tclient.Proxy(\"CSSStyleDeclaration.prototype.setProperty\", {\n\t\tapply(ctx) {\n\t\t\tif (!ctx.args[1]) return;\n\t\t\tctx.args[1] = rewriteCss(ctx.args[1], client.meta);\n\t\t},\n\t});\n\n\tclient.Proxy(\"CSSStyleDeclaration.prototype.getPropertyValue\", {\n\t\tapply(ctx) {\n\t\t\tconst v = ctx.call();\n\t\t\tif (!v) return v;\n\t\t\tctx.return(unrewriteCss(v));\n\t\t},\n\t});\n\n\tclient.Trap(\"CSSStyleDeclaration.prototype.cssText\", {\n\t\tset(ctx, value: string) {\n\t\t\tctx.set(rewriteCss(value, client.meta));\n\t\t},\n\t\tget(ctx) {\n\t\t\treturn unrewriteCss(ctx.get());\n\t\t},\n\t});\n\n\tclient.Proxy(\"CSSStyleSheet.prototype.insertRule\", {\n\t\tapply(ctx) {\n\t\t\tctx.args[0] = rewriteCss(ctx.args[0], client.meta);\n\t\t},\n\t});\n\n\tclient.Proxy(\"CSSStyleSheet.prototype.replace\", {\n\t\tapply(ctx) {\n\t\t\tctx.args[0] = rewriteCss(ctx.args[0], client.meta);\n\t\t},\n\t});\n\n\tclient.Proxy(\"CSSStyleSheet.prototype.replaceSync\", {\n\t\tapply(ctx) {\n\t\t\tctx.args[0] = rewriteCss(ctx.args[0], client.meta);\n\t\t},\n\t});\n\n\tclient.Trap(\"CSSRule.prototype.cssText\", {\n\t\tset(ctx, value: string) {\n\t\t\tctx.set(rewriteCss(value, client.meta));\n\t\t},\n\t\tget(ctx) {\n\t\t\treturn unrewriteCss(ctx.get());\n\t\t},\n\t});\n\n\tclient.Proxy(\"CSSStyleValue.parse\", {\n\t\tapply(ctx) {\n\t\t\tif (!ctx.args[1]) return;\n\t\t\tctx.args[1] = rewriteCss(ctx.args[1], client.meta);\n\t\t},\n\t});\n\n\tclient.Trap(\"HTMLElement.prototype.style\", {\n\t\tget(ctx) {\n\t\t\t// unfortunate and dumb hack. we have to trap every property of this\n\t\t\t// since the prototype chain is fucked\n\n\t\t\tconst style = ctx.get() as CSSStyleDeclaration;\n\n\t\t\treturn new Proxy(style, {\n\t\t\t\tget(target, prop) {\n\t\t\t\t\tconst value = Reflect.get(target, prop);\n\n\t\t\t\t\tif (typeof value === \"function\") {\n\t\t\t\t\t\treturn new Proxy(value, {\n\t\t\t\t\t\t\tapply(target, that, args) {\n\t\t\t\t\t\t\t\treturn Reflect.apply(target, style, args);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (prop in CSSStyleDeclaration.prototype) return value;\n\t\t\t\t\tif (!value) return value;\n\n\t\t\t\t\treturn unrewriteCss(value);\n\t\t\t\t},\n\t\t\t\tset(target, prop, value) {\n\t\t\t\t\tif (prop == \"cssText\" || value == \"\" || typeof value !== \"string\") {\n\t\t\t\t\t\treturn Reflect.set(target, prop, value);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Reflect.set(target, prop, rewriteCss(value, client.meta));\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t\tset(ctx, value: string) {\n\t\t\t// this will actually run the trap for cssText. don't rewrite it here\n\t\t\tctx.set(value);\n\t\t},\n\t});\n}\n","import { rewriteHtml } from \"@rewriters/html\";\nimport { ScramjetClient } from \"@client/index\";\n\nexport default function (client: ScramjetClient, _self: Self) {\n\tconst tostring = String;\n\tclient.Proxy(\n\t\t[\"Document.prototype.querySelector\", \"Document.prototype.querySelectorAll\"],\n\t\t{\n\t\t\tapply(ctx) {\n\t\t\t\tctx.args[0] = tostring(ctx.args[0]).replace(\n\t\t\t\t\t/((?:^|\\s)\\b\\w+\\[(?:src|href|data-href))[\\^]?(=['\"]?(?:https?[:])?\\/\\/)/,\n\t\t\t\t\t\"$1*$2\"\n\t\t\t\t);\n\t\t\t},\n\t\t}\n\t);\n\n\tclient.Proxy(\"Document.prototype.write\", {\n\t\tapply(ctx) {\n\t\t\tif (ctx.args[0])\n\t\t\t\ttry {\n\t\t\t\t\tctx.args[0] = rewriteHtml(\n\t\t\t\t\t\tctx.args[0],\n\t\t\t\t\t\tclient.cookieStore,\n\t\t\t\t\t\tclient.meta,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t);\n\t\t\t\t} catch {}\n\t\t},\n\t});\n\n\tclient.Trap(\"Document.prototype.referrer\", {\n\t\tget() {\n\t\t\treturn client.url.toString();\n\t\t},\n\t});\n\n\tclient.Proxy(\"Document.prototype.writeln\", {\n\t\tapply(ctx) {\n\t\t\tif (ctx.args[0])\n\t\t\t\ttry {\n\t\t\t\t\tctx.args[0] = rewriteHtml(\n\t\t\t\t\t\tctx.args[0],\n\t\t\t\t\t\tclient.cookieStore,\n\t\t\t\t\t\tclient.meta,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t);\n\t\t\t\t} catch {}\n\t\t},\n\t});\n\n\tclient.Proxy(\"Document.prototype.parseHTMLUnsafe\", {\n\t\tapply(ctx) {\n\t\t\tif (ctx.args[0])\n\t\t\t\ttry {\n\t\t\t\t\tctx.args[0] = rewriteHtml(\n\t\t\t\t\t\tctx.args[0],\n\t\t\t\t\t\tclient.cookieStore,\n\t\t\t\t\t\tclient.meta,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t);\n\t\t\t\t} catch {}\n\t\t},\n\t});\n}\n","import { htmlRules } from \"@/shared/htmlRules\";\nimport { rewriteCss, unrewriteCss } from \"@rewriters/css\";\nimport { rewriteHtml, unrewriteHtml } from \"@rewriters/html\";\nimport { rewriteJs } from \"@rewriters/js\";\nimport { rewriteUrl, unrewriteUrl } from \"@rewriters/url\";\nimport { SCRAMJETCLIENT } from \"@/symbols\";\nimport { ScramjetClient } from \"@client/index\";\n\nconst encoder = new TextEncoder();\nfunction bytesToBase64(bytes: Uint8Array) {\n\tconst binString = Array.from(bytes, (byte) =>\n\t\tString.fromCodePoint(byte)\n\t).join(\"\");\n\n\treturn btoa(binString);\n}\nexport default function (client: ScramjetClient, self: typeof window) {\n\tconst attrObject = {\n\t\tnonce: [self.HTMLElement],\n\t\tintegrity: [self.HTMLScriptElement, self.HTMLLinkElement],\n\t\tcsp: [self.HTMLIFrameElement],\n\t\tcredentialless: [self.HTMLIFrameElement],\n\t\tsrc: [\n\t\t\tself.HTMLImageElement,\n\t\t\tself.HTMLMediaElement,\n\t\t\tself.HTMLIFrameElement,\n\t\t\tself.HTMLFrameElement,\n\t\t\tself.HTMLEmbedElement,\n\t\t\tself.HTMLScriptElement,\n\t\t\tself.HTMLSourceElement,\n\t\t],\n\t\thref: [self.HTMLAnchorElement, self.HTMLLinkElement],\n\t\tdata: [self.HTMLObjectElement],\n\t\taction: [self.HTMLFormElement],\n\t\tformaction: [self.HTMLButtonElement, self.HTMLInputElement],\n\t\tsrcdoc: [self.HTMLIFrameElement],\n\t\tposter: [self.HTMLVideoElement],\n\t\timagesrcset: [self.HTMLLinkElement],\n\t};\n\n\tconst urlinterfaces = [\n\t\tself.HTMLAnchorElement.prototype,\n\t\tself.HTMLAreaElement.prototype,\n\t];\n\tconst originalhrefs = [\n\t\tclient.natives.call(\n\t\t\t\"Object.getOwnPropertyDescriptor\",\n\t\t\tnull,\n\t\t\tself.HTMLAnchorElement.prototype,\n\t\t\t\"href\"\n\t\t),\n\t\tclient.natives.call(\n\t\t\t\"Object.getOwnPropertyDescriptor\",\n\t\t\tnull,\n\t\t\tself.HTMLAreaElement.prototype,\n\t\t\t\"href\"\n\t\t),\n\t];\n\n\tconst attrs = Object.keys(attrObject);\n\n\tfor (const attr of attrs) {\n\t\tfor (const element of attrObject[attr]) {\n\t\t\tconst descriptor = client.natives.call(\n\t\t\t\t\"Object.getOwnPropertyDescriptor\",\n\t\t\t\tnull,\n\t\t\t\telement.prototype,\n\t\t\t\tattr\n\t\t\t);\n\t\t\tObject.defineProperty(element.prototype, attr, {\n\t\t\t\tget() {\n\t\t\t\t\tif ([\"src\", \"data\", \"href\", \"action\", \"formaction\"].includes(attr)) {\n\t\t\t\t\t\treturn unrewriteUrl(descriptor.get.call(this));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn descriptor.get.call(this);\n\t\t\t\t},\n\n\t\t\t\tset(value) {\n\t\t\t\t\treturn this.setAttribute(attr, value);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\n\t// note that href is not here\n\tconst urlprops = [\n\t\t\"protocol\",\n\t\t\"hash\",\n\t\t\"host\",\n\t\t\"hostname\",\n\t\t\"origin\",\n\t\t\"pathname\",\n\t\t\"port\",\n\t\t\"search\",\n\t];\n\tfor (const prop of urlprops) {\n\t\tfor (const i in urlinterfaces) {\n\t\t\tconst target = urlinterfaces[i];\n\t\t\tconst desc = originalhrefs[i];\n\t\t\tclient.RawTrap(target, prop, {\n\t\t\t\tget(ctx) {\n\t\t\t\t\tconst href = desc.get.call(ctx.this);\n\t\t\t\t\tif (!href) return href;\n\n\t\t\t\t\tconst url = new URL(unrewriteUrl(href));\n\n\t\t\t\t\treturn url[prop];\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\n\tclient.Trap(\"Node.prototype.baseURI\", {\n\t\tget(ctx) {\n\t\t\tconst node = ctx.this as Node;\n\t\t\tlet base = node.ownerDocument?.querySelector(\"base\");\n\t\t\tif (node instanceof Document) base = node.querySelector(\"base\");\n\n\t\t\tif (base) {\n\t\t\t\treturn new URL(base.href, client.url.origin).href;\n\t\t\t}\n\n\t\t\treturn client.url.origin;\n\t\t},\n\t\tset(ctx, v) {\n\t\t\treturn false;\n\t\t},\n\t});\n\n\tclient.Proxy(\"Element.prototype.getAttribute\", {\n\t\tapply(ctx) {\n\t\t\tconst [name] = ctx.args;\n\n\t\t\tif (name.startsWith(\"scramjet-attr\")) {\n\t\t\t\treturn ctx.return(null);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tclient.natives.call(\n\t\t\t\t\t\"Element.prototype.hasAttribute\",\n\t\t\t\t\tctx.this,\n\t\t\t\t\t`scramjet-attr-${name}`\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tconst attrib = ctx.fn.call(ctx.this, `scramjet-attr-${name}`);\n\t\t\t\tif (attrib === null) return ctx.return(\"\");\n\n\t\t\t\treturn ctx.return(attrib);\n\t\t\t}\n\t\t},\n\t});\n\n\tclient.Proxy(\"Element.prototype.getAttributeNames\", {\n\t\tapply(ctx) {\n\t\t\tconst attrNames = ctx.call() as string[];\n\t\t\tconst cleaned = attrNames.filter(\n\t\t\t\t(attr) => !attr.startsWith(\"scramjet-attr\")\n\t\t\t);\n\n\t\t\tctx.return(cleaned);\n\t\t},\n\t});\n\n\tclient.Proxy(\"Element.prototype.getAttributeNode\", {\n\t\tapply(ctx) {\n\t\t\tif (ctx.args[0].startsWith(\"scramjet-attr\")) return ctx.return(null);\n\t\t},\n\t});\n\n\tclient.Proxy(\"Element.prototype.hasAttribute\", {\n\t\tapply(ctx) {\n\t\t\tif (ctx.args[0].startsWith(\"scramjet-attr\")) return ctx.return(false);\n\t\t},\n\t});\n\n\tclient.Proxy(\"Element.prototype.setAttribute\", {\n\t\tapply(ctx) {\n\t\t\tconst [name, value] = ctx.args;\n\n\t\t\tconst ruleList = htmlRules.find((rule) => {\n\t\t\t\tconst r = rule[name.toLowerCase()];\n\t\t\t\tif (!r) return false;\n\t\t\t\tif (r === \"*\") return true;\n\t\t\t\tif (typeof r === \"function\") return false; // this can't happen but ts\n\n\t\t\t\treturn r.includes(ctx.this.tagName.toLowerCase());\n\t\t\t});\n\n\t\t\tif (ruleList) {\n\t\t\t\tconst ret = ruleList.fn(value, client.meta, client.cookieStore);\n\t\t\t\tif (ret == null) {\n\t\t\t\t\tclient.natives.call(\n\t\t\t\t\t\t\"Element.prototype.removeAttribute\",\n\t\t\t\t\t\tctx.this,\n\t\t\t\t\t\tname\n\t\t\t\t\t);\n\t\t\t\t\tctx.return(undefined);\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tctx.args[1] = ret;\n\t\t\t\tctx.fn.call(ctx.this, `scramjet-attr-${ctx.args[0]}`, value);\n\t\t\t}\n\t\t},\n\t});\n\n\t// i actually need to do something with this\n\tclient.Proxy(\"Element.prototype.setAttributeNode\", {\n\t\tapply(_ctx) {},\n\t});\n\n\tclient.Proxy(\"Element.prototype.setAttributeNS\", {\n\t\tapply(ctx) {\n\t\t\tconst [_namespace, name, value] = ctx.args;\n\n\t\t\tconst ruleList = htmlRules.find((rule) => {\n\t\t\t\tconst r = rule[name.toLowerCase()];\n\t\t\t\tif (!r) return false;\n\t\t\t\tif (r === \"*\") return true;\n\t\t\t\tif (typeof r === \"function\") return false; // this can't happen but ts\n\n\t\t\t\treturn r.includes(ctx.this.tagName.toLowerCase());\n\t\t\t});\n\n\t\t\tif (ruleList) {\n\t\t\t\tctx.args[2] = ruleList.fn(value, client.meta, client.cookieStore);\n\t\t\t\tclient.natives.call(\n\t\t\t\t\t\"Element.prototype.setAttribute\",\n\t\t\t\t\tctx.this,\n\t\t\t\t\t`scramjet-attr-${ctx.args[1]}`,\n\t\t\t\t\tvalue\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t});\n\n\t// this is separate from the regular href handlers because it returns an SVGAnimatedString\n\tclient.Trap(\"SVGAnimatedString.prototype.baseVal\", {\n\t\tget(ctx) {\n\t\t\tconst href = ctx.get() as string;\n\t\t\tif (!href) return href;\n\n\t\t\treturn unrewriteUrl(href);\n\t\t},\n\t\tset(ctx, val: string) {\n\t\t\tctx.set(rewriteUrl(val, client.meta));\n\t\t},\n\t});\n\tclient.Trap(\"SVGAnimatedString.prototype.animVal\", {\n\t\tget(ctx) {\n\t\t\tconst href = ctx.get() as string;\n\t\t\tif (!href) return href;\n\n\t\t\treturn unrewriteUrl(href);\n\t\t},\n\t\t// it has no setter\n\t});\n\n\tclient.Proxy(\"Element.prototype.removeAttribute\", {\n\t\tapply(ctx) {\n\t\t\tif (ctx.args[0].startsWith(\"scramjet-attr\")) return ctx.return(undefined);\n\t\t\tif (\n\t\t\t\tclient.natives.call(\n\t\t\t\t\t\"Element.prototype.hasAttribute\",\n\t\t\t\t\tctx.this,\n\t\t\t\t\tctx.args[0]\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tctx.fn.call(ctx.this, `scramjet-attr-${ctx.args[0]}`);\n\t\t\t}\n\t\t},\n\t});\n\n\tclient.Proxy(\"Element.prototype.toggleAttribute\", {\n\t\tapply(ctx) {\n\t\t\tif (ctx.args[0].startsWith(\"scramjet-attr\")) return ctx.return(false);\n\t\t\tif (\n\t\t\t\tclient.natives.call(\n\t\t\t\t\t\"Element.prototype.hasAttribute\",\n\t\t\t\t\tctx.this,\n\t\t\t\t\tctx.args[0]\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tctx.fn.call(ctx.this, `scramjet-attr-${ctx.args[0]}`);\n\t\t\t}\n\t\t},\n\t});\n\n\tclient.Trap(\"Element.prototype.innerHTML\", {\n\t\tset(ctx, value: string) {\n\t\t\tlet newval;\n\t\t\tif (ctx.this instanceof self.HTMLScriptElement) {\n\t\t\t\tnewval = rewriteJs(value, \"(anonymous script element)\", client.meta);\n\t\t\t\tclient.natives.call(\n\t\t\t\t\t\"Element.prototype.setAttribute\",\n\t\t\t\t\tctx.this,\n\t\t\t\t\t\"scramjet-attr-script-source-src\",\n\t\t\t\t\tbytesToBase64(encoder.encode(newval))\n\t\t\t\t);\n\t\t\t} else if (ctx.this instanceof self.HTMLStyleElement) {\n\t\t\t\tnewval = rewriteCss(value, client.meta);\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tnewval = rewriteHtml(value, client.cookieStore, client.meta);\n\t\t\t\t} catch {\n\t\t\t\t\tnewval = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tctx.set(newval);\n\t\t},\n\t\tget(ctx) {\n\t\t\tif (ctx.this instanceof self.HTMLScriptElement) {\n\t\t\t\tconst scriptSource = client.natives.call(\n\t\t\t\t\t\"Element.prototype.getAttribute\",\n\t\t\t\t\tctx.this,\n\t\t\t\t\t\"scramjet-attr-script-source-src\"\n\t\t\t\t);\n\n\t\t\t\tif (scriptSource) {\n\t\t\t\t\treturn atob(scriptSource);\n\t\t\t\t}\n\n\t\t\t\treturn ctx.get();\n\t\t\t}\n\t\t\tif (ctx.this instanceof self.HTMLStyleElement) {\n\t\t\t\treturn ctx.get();\n\t\t\t}\n\n\t\t\treturn unrewriteHtml(ctx.get());\n\t\t},\n\t});\n\n\tclient.Trap(\"Node.prototype.textContent\", {\n\t\tset(ctx, value: string) {\n\t\t\t// TODO: box the instanceofs\n\t\t\tif (ctx.this instanceof self.HTMLScriptElement) {\n\t\t\t\tconst newval: string = rewriteJs(\n\t\t\t\t\tvalue,\n\t\t\t\t\t\"(anonymous script element)\",\n\t\t\t\t\tclient.meta\n\t\t\t\t) as string;\n\t\t\t\tclient.natives.call(\n\t\t\t\t\t\"Element.prototype.setAttribute\",\n\t\t\t\t\tctx.this,\n\t\t\t\t\t\"scramjet-attr-script-source-src\",\n\t\t\t\t\tbytesToBase64(encoder.encode(newval))\n\t\t\t\t);\n\n\t\t\t\treturn ctx.set(newval);\n\t\t\t} else if (ctx.this instanceof self.HTMLStyleElement) {\n\t\t\t\treturn ctx.set(rewriteCss(value, client.meta));\n\t\t\t} else {\n\t\t\t\treturn ctx.set(value);\n\t\t\t}\n\t\t},\n\t\tget(ctx) {\n\t\t\tif (ctx.this instanceof self.HTMLScriptElement) {\n\t\t\t\tconst scriptSource = client.natives.call(\n\t\t\t\t\t\"Element.prototype.getAttribute\",\n\t\t\t\t\tctx.this,\n\t\t\t\t\t\"scramjet-attr-script-source-src\"\n\t\t\t\t);\n\n\t\t\t\tif (scriptSource) {\n\t\t\t\t\treturn atob(scriptSource);\n\t\t\t\t}\n\n\t\t\t\treturn ctx.get();\n\t\t\t}\n\t\t\tif (ctx.this instanceof self.HTMLStyleElement) {\n\t\t\t\treturn unrewriteCss(ctx.get() as string);\n\t\t\t}\n\n\t\t\treturn ctx.get();\n\t\t},\n\t});\n\n\tclient.Trap(\"Element.prototype.outerHTML\", {\n\t\tset(ctx, value: string) {\n\t\t\tctx.set(rewriteHtml(value, client.cookieStore, client.meta));\n\t\t},\n\t\tget(ctx) {\n\t\t\treturn unrewriteHtml(ctx.get());\n\t\t},\n\t});\n\n\tclient.Proxy(\"Element.prototype.setHTMLUnsafe\", {\n\t\tapply(ctx) {\n\t\t\ttry {\n\t\t\t\tctx.args[0] = rewriteHtml(\n\t\t\t\t\tctx.args[0],\n\t\t\t\t\tclient.cookieStore,\n\t\t\t\t\tclient.meta,\n\t\t\t\t\tfalse\n\t\t\t\t);\n\t\t\t} catch {}\n\t\t},\n\t});\n\n\tclient.Proxy(\"Element.prototype.getHTML\", {\n\t\tapply(ctx) {\n\t\t\tctx.return(unrewriteHtml(ctx.call()));\n\t\t},\n\t});\n\n\tclient.Proxy(\"Element.prototype.insertAdjacentHTML\", {\n\t\tapply(ctx) {\n\t\t\tif (ctx.args[1])\n\t\t\t\ttry {\n\t\t\t\t\tctx.args[1] = rewriteHtml(\n\t\t\t\t\t\tctx.args[1],\n\t\t\t\t\t\tclient.cookieStore,\n\t\t\t\t\t\tclient.meta,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t);\n\t\t\t\t} catch {}\n\t\t},\n\t});\n\tclient.Proxy(\"Audio\", {\n\t\tconstruct(ctx) {\n\t\t\tif (ctx.args[0]) ctx.args[0] = rewriteUrl(ctx.args[0], client.meta);\n\t\t},\n\t});\n\tclient.Proxy(\"Text.prototype.appendData\", {\n\t\tapply(ctx) {\n\t\t\tif (ctx.this.parentElement?.tagName === \"STYLE\") {\n\t\t\t\tctx.args[0] = rewriteCss(ctx.args[0], client.meta);\n\t\t\t}\n\t\t},\n\t});\n\n\tclient.Proxy(\"Text.prototype.insertData\", {\n\t\tapply(ctx) {\n\t\t\tif (ctx.this.parentElement?.tagName === \"STYLE\") {\n\t\t\t\tctx.args[1] = rewriteCss(ctx.args[1], client.meta);\n\t\t\t}\n\t\t},\n\t});\n\n\tclient.Proxy(\"Text.prototype.replaceData\", {\n\t\tapply(ctx) {\n\t\t\tif (ctx.this.parentElement?.tagName === \"STYLE\") {\n\t\t\t\tctx.args[2] = rewriteCss(ctx.args[2], client.meta);\n\t\t\t}\n\t\t},\n\t});\n\n\tclient.Trap(\"Text.prototype.wholeText\", {\n\t\tget(ctx) {\n\t\t\tif (ctx.this.parentElement?.tagName === \"STYLE\") {\n\t\t\t\treturn unrewriteCss(ctx.get() as string);\n\t\t\t}\n\n\t\t\treturn ctx.get();\n\t\t},\n\t\tset(ctx, v) {\n\t\t\tif (ctx.this.parentElement?.tagName === \"STYLE\") {\n\t\t\t\treturn ctx.set(rewriteCss(v as string, client.meta));\n\t\t\t}\n\n\t\t\treturn ctx.set(v);\n\t\t},\n\t});\n\n\tclient.Trap(\n\t\t[\n\t\t\t\"HTMLIFrameElement.prototype.contentWindow\",\n\t\t\t\"HTMLFrameElement.prototype.contentWindow\",\n\t\t\t\"HTMLObjectElement.prototype.contentWindow\",\n\t\t\t\"HTMLEmbedElement.prototype.contentWindow\",\n\t\t],\n\t\t{\n\t\t\tget(ctx) {\n\t\t\t\tconst realwin = ctx.get() as Window;\n\t\t\t\tif (!realwin) return realwin;\n\n\t\t\t\tif (!(SCRAMJETCLIENT in realwin)) {\n\t\t\t\t\t// hook the iframe before the client can start to steal globals out of it\n\t\t\t\t\tconst newclient = new ScramjetClient(realwin);\n\t\t\t\t\tnewclient.hook();\n\t\t\t\t}\n\n\t\t\t\treturn realwin;\n\t\t\t},\n\t\t}\n\t);\n\n\tclient.Trap(\n\t\t[\n\t\t\t\"HTMLIFrameElement.prototype.contentDocument\",\n\t\t\t\"HTMLFrameElement.prototype.contentDocument\",\n\t\t\t\"HTMLObjectElement.prototype.contentDocument\",\n\t\t\t\"HTMLEmbedElement.prototype.contentDocument\",\n\t\t],\n\t\t{\n\t\t\tget(ctx) {\n\t\t\t\tconst realwin = client.descriptors.get(\n\t\t\t\t\t`${ctx.this.constructor.name}.prototype.contentWindow`,\n\t\t\t\t\tctx.this\n\t\t\t\t);\n\t\t\t\tif (!realwin) return realwin;\n\n\t\t\t\tif (!(SCRAMJETCLIENT in realwin)) {\n\t\t\t\t\tconst newclient = new ScramjetClient(realwin);\n\t\t\t\t\tnewclient.hook();\n\t\t\t\t}\n\n\t\t\t\treturn realwin.document;\n\t\t\t},\n\t\t}\n\t);\n\n\tclient.Proxy(\n\t\t[\n\t\t\t\"HTMLIFrameElement.prototype.getSVGDocument\",\n\t\t\t\"HTMLObjectElement.prototype.getSVGDocument\",\n\t\t\t\"HTMLEmbedElement.prototype.getSVGDocument\",\n\t\t],\n\t\t{\n\t\t\tapply(ctx) {\n\t\t\t\tconst doc = ctx.call();\n\t\t\t\tif (doc) {\n\t\t\t\t\t// we trap the contentDocument, this is really the scramjet version\n\t\t\t\t\treturn ctx.return(ctx.this.contentDocument);\n\t\t\t\t}\n\t\t\t},\n\t\t}\n\t);\n\n\tclient.Proxy(\"DOMParser.prototype.parseFromString\", {\n\t\tapply(ctx) {\n\t\t\tif (ctx.args[1] === \"text/html\") {\n\t\t\t\ttry {\n\t\t\t\t\tctx.args[0] = rewriteHtml(\n\t\t\t\t\t\tctx.args[0],\n\t\t\t\t\t\tclient.cookieStore,\n\t\t\t\t\t\tclient.meta,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t);\n\t\t\t\t} catch {}\n\t\t\t}\n\t\t},\n\t});\n}\n","import { rewriteCss } from \"@rewriters/css\";\nimport { ScramjetClient } from \"@client/index\";\n\nexport default function (client: ScramjetClient, _self: Self) {\n\tclient.Proxy(\"FontFace\", {\n\t\tconstruct(ctx) {\n\t\t\tctx.args[1] = rewriteCss(ctx.args[1], client.meta);\n\t\t},\n\t});\n}\n","import { rewriteHtml } from \"@rewriters/html\";\nimport { ScramjetClient } from \"@client/index\";\n\nexport default function (client: ScramjetClient, _self: Self) {\n\tclient.Proxy(\"Range.prototype.createContextualFragment\", {\n\t\tapply(ctx) {\n\t\t\tctx.args[0] = rewriteHtml(ctx.args[0], client.cookieStore, client.meta);\n\t\t},\n\t});\n}\n","import { rewriteUrl } from \"@rewriters/url\";\nimport { ScramjetClient } from \"@client/index\";\nimport { UrlChangeEvent } from \"@client/events\";\nimport { SCRAMJETCLIENT } from \"@/symbols\";\n\nexport default function (client: ScramjetClient, _self: Self) {\n\tclient.Proxy(\n\t\t[\"History.prototype.pushState\", \"History.prototype.replaceState\"],\n\t\t{\n\t\t\tapply(ctx) {\n\t\t\t\tif (ctx.args[2] || ctx.args[2] === \"\")\n\t\t\t\t\tctx.args[2] = rewriteUrl(ctx.args[2], client.meta);\n\t\t\t\tctx.call();\n\t\t\t\tconst {\n\t\t\t\t\tconstructor: { constructor: Function },\n\t\t\t\t} = ctx.this;\n\t\t\t\tconst callerGlobalThisProxied: Self = Function(\"return globalThis\")();\n\t\t\t\tconst callerClient = callerGlobalThisProxied[SCRAMJETCLIENT];\n\n\t\t\t\tif (callerGlobalThisProxied.name === client.meta.topFrameName) {\n\t\t\t\t\tconst ev = new UrlChangeEvent(callerClient.url.href);\n\t\t\t\t\tclient.frame?.dispatchEvent(ev);\n\t\t\t\t}\n\t\t\t},\n\t\t}\n\t);\n}\n","import { ScramjetClient } from \"@client/index\";\nimport { SCRAMJETCLIENT } from \"@/symbols\";\nimport { rewriteUrl } from \"@rewriters/url\";\n\nexport default function (client: ScramjetClient) {\n\tclient.Proxy(\"window.open\", {\n\t\tapply(ctx) {\n\t\t\tif (ctx.args[0]) ctx.args[0] = rewriteUrl(ctx.args[0], client.meta);\n\n\t\t\tif (ctx.args[1] === \"_top\" || ctx.args[1] === \"_unfencedTop\")\n\t\t\t\tctx.args[1] = client.meta.topFrameName;\n\t\t\tif (ctx.args[1] === \"_parent\") ctx.args[1] = client.meta.parentFrameName;\n\n\t\t\tconst realwin = ctx.call();\n\n\t\t\tif (!realwin) return ctx.return(realwin);\n\n\t\t\tif (SCRAMJETCLIENT in realwin) {\n\t\t\t\treturn ctx.return(realwin[SCRAMJETCLIENT].global);\n\t\t\t} else {\n\t\t\t\tconst newclient = new ScramjetClient(realwin);\n\t\t\t\t// hook the opened window\n\t\t\t\tnewclient.hook();\n\n\t\t\t\treturn ctx.return(newclient.global);\n\t\t\t}\n\t\t},\n\t});\n\n\tclient.Trap(\"window.frameElement\", {\n\t\tget(ctx) {\n\t\t\tconst f = ctx.get() as HTMLIFrameElement | null;\n\t\t\tif (!f) return f;\n\n\t\t\tconst win = f.ownerDocument.defaultView;\n\t\t\tif (win[SCRAMJETCLIENT]) {\n\t\t\t\t// then this is a subframe in a scramjet context, and it's safe to pass back the real iframe\n\t\t\t\treturn f;\n\t\t\t} else {\n\t\t\t\t// no, the top frame is outside the sandbox\n\t\t\t\treturn null;\n\t\t\t}\n\t\t},\n\t});\n}\n","import { ScramjetClient } from \"@client/index\";\n\nexport default function (client: ScramjetClient, _self: Self) {\n\tclient.Trap(\"origin\", {\n\t\tget() {\n\t\t\t// this isn't right!!\n\t\t\treturn client.url.origin;\n\t\t},\n\t\tset() {\n\t\t\treturn false;\n\t\t},\n\t});\n\n\tclient.Trap(\"Document.prototype.URL\", {\n\t\tget() {\n\t\t\treturn client.url.href;\n\t\t},\n\t\tset() {\n\t\t\treturn false;\n\t\t},\n\t});\n\n\tclient.Trap(\"Document.prototype.documentURI\", {\n\t\tget() {\n\t\t\treturn client.url.href;\n\t\t},\n\t\tset() {\n\t\t\treturn false;\n\t\t},\n\t});\n\n\tclient.Trap(\"Document.prototype.domain\", {\n\t\tget() {\n\t\t\treturn client.url.hostname;\n\t\t},\n\t\tset() {\n\t\t\treturn false;\n\t\t},\n\t});\n}\n","import { unrewriteUrl } from \"@rewriters/url\";\nimport { ScramjetClient } from \"@client/index\";\nimport { config } from \"@/shared\";\n\nexport default function (client: ScramjetClient, _self: Self) {\n\tclient.Trap(\"PerformanceEntry.prototype.name\", {\n\t\tget(ctx) {\n\t\t\t// name is going to be a url typically\n\t\t\tconst name = ctx.get() as string;\n\n\t\t\tif (name && name.startsWith(location.origin + config.prefix)) {\n\t\t\t\treturn unrewriteUrl(name);\n\t\t\t}\n\n\t\t\treturn name;\n\t\t},\n\t});\n\n\tconst filterEntries = (entries: PerformanceEntry[]) => {\n\t\treturn entries.filter((entry) => {\n\t\t\tfor (const file of Object.values(config.files)) {\n\t\t\t\tif (entry.name.startsWith(location.origin + file)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t});\n\t};\n\n\tclient.Proxy(\n\t\t[\n\t\t\t\"Performance.prototype.getEntries\",\n\t\t\t\"Performance.prototype.getEntriesByType\",\n\t\t\t\"Performance.prototype.getEntriesByName\",\n\t\t\t\"PerformanceObserverEntryList.prototype.getEntries\",\n\t\t\t\"PerformanceObserverEntryList.prototype.getEntriesByType\",\n\t\t\t\"PerformanceObserverEntryList.prototype.getEntriesByName\",\n\t\t],\n\t\t{\n\t\t\tapply(ctx) {\n\t\t\t\tconst entries = ctx.call() as PerformanceEntry[];\n\n\t\t\t\treturn ctx.return(filterEntries(entries));\n\t\t\t},\n\t\t}\n\t);\n}\n","import { rewriteUrl } from \"@rewriters/url\";\nimport { ScramjetClient } from \"@client/index\";\n\nexport default function (client: ScramjetClient, self: Self) {\n\tclient.Proxy(\"Navigator.prototype.registerProtocolHandler\", {\n\t\tapply(ctx) {\n\t\t\tctx.args[1] = rewriteUrl(ctx.args[1], client.meta);\n\t\t},\n\t});\n\tclient.Proxy(\"Navigator.prototype.unregisterProtocolHandler\", {\n\t\tapply(ctx) {\n\t\t\tctx.args[1] = rewriteUrl(ctx.args[1], client.meta);\n\t\t},\n\t});\n}\n","import { ScramjetClient } from \"@client/index\";\nimport { type MessageC2W } from \"@/worker\";\nimport { flagEnabled } from \"@/shared\";\nimport { rewriteUrl } from \"@rewriters/url\";\n\n// we need a late order because we're mangling with addEventListener at a higher level\nexport const order = 2;\n\nexport const enabled = (client: ScramjetClient) =>\n\tflagEnabled(\"serviceworkers\", client.url);\n\nexport function disabled(_client: ScramjetClient, _self: Self) {\n\tReflect.deleteProperty(Navigator.prototype, \"serviceWorker\");\n}\n\ntype FakeRegistrationState = {\n\tscope: string;\n\tactive: ServiceWorker;\n};\n\nexport default function (client: ScramjetClient, _self: Self) {\n\tconst registrationmap: WeakMap<\n\t\tServiceWorkerRegistration,\n\t\tFakeRegistrationState\n\t> = new WeakMap();\n\tclient.Proxy(\"EventTarget.prototype.addEventListener\", {\n\t\tapply(ctx) {\n\t\t\tif (registrationmap.get(ctx.this)) {\n\t\t\t\t// do nothing\n\t\t\t\tctx.return(undefined);\n\t\t\t}\n\t\t},\n\t});\n\n\tclient.Proxy(\"EventTarget.prototype.removeEventListener\", {\n\t\tapply(ctx) {\n\t\t\tif (registrationmap.get(ctx.this)) {\n\t\t\t\t// do nothing\n\t\t\t\tctx.return(undefined);\n\t\t\t}\n\t\t},\n\t});\n\n\tclient.Proxy(\"ServiceWorkerContainer.prototype.getRegistration\", {\n\t\tapply(ctx) {\n\t\t\tctx.return(new Promise((resolve) => resolve(registration)));\n\t\t},\n\t});\n\n\tclient.Proxy(\"ServiceWorkerContainer.prototype.getRegistrations\", {\n\t\tapply(ctx) {\n\t\t\tctx.return(new Promise((resolve) => resolve([registration])));\n\t\t},\n\t});\n\n\tclient.Trap(\"ServiceWorkerContainer.prototype.ready\", {\n\t\tget(_ctx) {\n\t\t\treturn new Promise((resolve) => resolve(registration));\n\t\t},\n\t});\n\n\tclient.Trap(\"ServiceWorkerContainer.prototype.controller\", {\n\t\tget(ctx) {\n\t\t\treturn registration?.active;\n\t\t},\n\t});\n\n\tclient.Proxy(\"ServiceWorkerContainer.prototype.register\", {\n\t\tapply(ctx) {\n\t\t\tconst fakeRegistration = new EventTarget() as ServiceWorkerRegistration;\n\t\t\tObject.setPrototypeOf(\n\t\t\t\tfakeRegistration,\n\t\t\t\tself.ServiceWorkerRegistration.prototype\n\t\t\t);\n\t\t\tfakeRegistration.constructor = ctx.fn;\n\t\t\tlet url = rewriteUrl(ctx.args[0], client.meta) + \"?dest=serviceworker\";\n\t\t\tif (ctx.args[1] && ctx.args[1].type === \"module\") {\n\t\t\t\turl += \"&type=module\";\n\t\t\t}\n\n\t\t\tconst worker = client.natives.construct(\"SharedWorker\", url);\n\t\t\tconst handle = worker.port;\n\t\t\tconst state: FakeRegistrationState = {\n\t\t\t\tscope: ctx.args[0],\n\t\t\t\tactive: handle as ServiceWorker,\n\t\t\t};\n\t\t\tconst controller = client.descriptors.get(\n\t\t\t\t\"ServiceWorkerContainer.prototype.controller\",\n\t\t\t\tclient.serviceWorker\n\t\t\t);\n\n\t\t\tclient.natives.call(\n\t\t\t\t\"ServiceWorker.prototype.postMessage\",\n\t\t\t\tcontroller,\n\t\t\t\t{\n\t\t\t\t\tscramjet$type: \"registerServiceWorker\",\n\t\t\t\t\tport: handle,\n\t\t\t\t\torigin: client.url.origin,\n\t\t\t\t} as MessageC2W,\n\t\t\t\t[handle]\n\t\t\t);\n\n\t\t\tregistrationmap.set(fakeRegistration, state);\n\t\t\tctx.return(new Promise((resolve) => resolve(fakeRegistration)));\n\t\t},\n\t});\n}\n","import { ScramjetClient } from \"@client/index\";\n\nexport default function (client: ScramjetClient, self: typeof window) {\n\tconst handler: ProxyHandler<Storage> = {\n\t\tget(target, prop) {\n\t\t\tswitch (prop) {\n\t\t\t\tcase \"getItem\":\n\t\t\t\t\treturn (key: string) => {\n\t\t\t\t\t\treturn target.getItem(client.url.host + \"@\" + key);\n\t\t\t\t\t};\n\n\t\t\t\tcase \"setItem\":\n\t\t\t\t\treturn (key: string, value: string) => {\n\t\t\t\t\t\treturn target.setItem(client.url.host + \"@\" + key, value);\n\t\t\t\t\t};\n\n\t\t\t\tcase \"removeItem\":\n\t\t\t\t\treturn (key: string) => {\n\t\t\t\t\t\treturn target.removeItem(client.url.host + \"@\" + key);\n\t\t\t\t\t};\n\n\t\t\t\tcase \"clear\":\n\t\t\t\t\treturn () => {\n\t\t\t\t\t\tfor (const key in Object.keys(target)) {\n\t\t\t\t\t\t\tif (key.startsWith(client.url.host)) {\n\t\t\t\t\t\t\t\ttarget.removeItem(key);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\tcase \"key\":\n\t\t\t\t\treturn (index: number) => {\n\t\t\t\t\t\tconst keys = Object.keys(target).filter((key) =>\n\t\t\t\t\t\t\tkey.startsWith(client.url.host)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\treturn target.getItem(keys[index]);\n\t\t\t\t\t};\n\n\t\t\t\tcase \"length\":\n\t\t\t\t\treturn Object.keys(target).filter((key) =>\n\t\t\t\t\t\tkey.startsWith(client.url.host)\n\t\t\t\t\t).length;\n\n\t\t\t\tdefault:\n\t\t\t\t\tif (prop in Object.prototype || typeof prop === \"symbol\") {\n\t\t\t\t\t\treturn Reflect.get(target, prop);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn target.getItem(client.url.host + \"@\" + (prop as string));\n\t\t\t}\n\t\t},\n\n\t\tset(target, prop, value) {\n\t\t\ttarget.setItem(client.url.host + \"@\" + (prop as string), value);\n\n\t\t\treturn true;\n\t\t},\n\n\t\townKeys(target) {\n\t\t\treturn Reflect.ownKeys(target)\n\t\t\t\t.filter((f) => typeof f === \"string\" && f.startsWith(client.url.host))\n\t\t\t\t.map((f) =>\n\t\t\t\t\ttypeof f === \"string\" ? f.substring(client.url.host.length + 1) : f\n\t\t\t\t);\n\t\t},\n\n\t\tgetOwnPropertyDescriptor(target, property) {\n\t\t\treturn {\n\t\t\t\tvalue: target.getItem(client.url.host + \"@\" + (property as string)),\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t};\n\t\t},\n\n\t\tdefineProperty(target, property, attributes) {\n\t\t\ttarget.setItem(\n\t\t\t\tclient.url.host + \"@\" + (property as string),\n\t\t\t\tattributes.value\n\t\t\t);\n\n\t\t\treturn true;\n\t\t},\n\t};\n\n\tconst realLocalStorage = self.localStorage;\n\n\tconst localStorageProxy = new Proxy(self.localStorage, handler);\n\tconst sessionStorageProxy = new Proxy(self.sessionStorage, handler);\n\n\tdelete self.localStorage;\n\tdelete self.sessionStorage;\n\n\tself.localStorage = localStorageProxy;\n\tself.sessionStorage = sessionStorageProxy;\n}\n","// entrypoint for scramjet.client.js\n\nimport { loadCodecs, setConfig } from \"@/shared/index\";\nimport { SCRAMJETCLIENT } from \"@/symbols\";\nimport { ScramjetClient } from \"@client/index\";\nimport { ScramjetContextEvent, UrlChangeEvent } from \"@client/events\";\nimport { ScramjetServiceWorkerRuntime } from \"@client/swruntime\";\nimport { ScramjetConfig } from \"@/types\";\n\nexport const iswindow = \"window\" in globalThis && window instanceof Window;\nexport const isworker = \"WorkerGlobalScope\" in globalThis;\nexport const issw = \"ServiceWorkerGlobalScope\" in globalThis;\nexport const isdedicated = \"DedicatedWorkerGlobalScope\" in globalThis;\nexport const isshared = \"SharedWorkerGlobalScope\" in globalThis;\nexport const isemulatedsw =\n\t\"location\" in globalThis &&\n\tnew URL(globalThis.location.href).searchParams.get(\"dest\") ===\n\t\t\"serviceworker\";\n\nfunction createFrameId() {\n\treturn `${Array(8)\n\t\t.fill(0)\n\t\t.map(() => Math.floor(Math.random() * 36).toString(36))\n\t\t.join(\"\")}`;\n}\n\nexport function loadAndHook(config: ScramjetConfig) {\n\tsetConfig(config);\n\tdbg.log(\"initializing scramjet client\");\n\t// if it already exists, that means the handlers have probably already been setup by the parent document\n\tif (!(SCRAMJETCLIENT in <Partial<typeof self>>globalThis)) {\n\t\tloadCodecs();\n\n\t\tconst client = new ScramjetClient(globalThis);\n\t\tconst frame: HTMLIFrameElement =\n\t\t\tglobalThis.frameElement as HTMLIFrameElement;\n\t\tif (frame && !frame.name) {\n\t\t\t// all frames need to be named for our logic to work\n\t\t\tframe.name = createFrameId();\n\t\t}\n\n\t\tif (globalThis.COOKIE) client.loadcookies(globalThis.COOKIE);\n\n\t\tclient.hook();\n\n\t\tif (isemulatedsw) {\n\t\t\tconst runtime = new ScramjetServiceWorkerRuntime(client);\n\t\t\truntime.hook();\n\t\t}\n\n\t\tconst contextev = new ScramjetContextEvent(client.global.window, client);\n\t\tclient.frame?.dispatchEvent(contextev);\n\t\tconst urlchangeev = new UrlChangeEvent(client.url.href);\n\t\tif (!client.isSubframe) client.frame?.dispatchEvent(urlchangeev);\n\t}\n\n\tReflect.deleteProperty(globalThis, \"WASM\");\n\tReflect.deleteProperty(globalThis, \"COOKIE\");\n}\n","import { ScramjetClient } from \"@client/index\";\n\n/**\n * Union type for all global Scramjet events.\n */\nexport type ScramjetGlobalEvent = ScramjetGlobalDownloadEvent;\n\n/**\n * Event class for proxified download interception.\n */\nexport class ScramjetGlobalDownloadEvent extends Event {\n\ttype = \"download\";\n\tconstructor(public download: ScramjetDownload) {\n\t\tsuper(\"download\");\n\t}\n}\n\n/**\n * Map for all global Scramjet events with their corresponding event types.\n */\nexport type ScramjetGlobalEvents = {\n\tdownload: ScramjetGlobalDownloadEvent;\n};\n\n/**\n * Event for proxified download interception.\n */\nexport type ScramjetDownload = {\n\tfilename?: string;\n\turl: string;\n\ttype: string;\n\tbody: ReadableStream<Uint8Array>;\n\tlength: number;\n};\n\n/**\n * Union type for all Scramjet proxified navigation events.\n */\nexport type ScramjetEvent =\n\t| NavigateEvent\n\t| UrlChangeEvent\n\t| ScramjetContextEvent;\n\n/**\n * Type map for all Scramjet navigation events with their corresponding event types.\n */\nexport type ScramjetEvents = {\n\tnavigate: NavigateEvent;\n\turlchange: UrlChangeEvent;\n\tcontextInit: ScramjetContextEvent;\n};\n\n/**\n * Navigation event class fired when Scramjet frame navigates to a new proxified URL.\n */\nexport class NavigateEvent extends Event {\n\ttype = \"navigate\";\n\tconstructor(public url: string) {\n\t\tsuper(\"navigate\");\n\t}\n}\n\n/**\n * URL change event class fired when the proxified URL changes in a Scramjet frame.\n */\nexport class UrlChangeEvent extends Event {\n\ttype = \"urlchange\";\n\tconstructor(public url: string) {\n\t\tsuper(\"urlchange\");\n\t}\n}\n\n/**\n * Event class fired when Scramjet initializes in a frame.\n */\nexport class ScramjetContextEvent extends Event {\n\ttype = \"contextInit\";\n\tconstructor(\n\t\tpublic window: Self,\n\t\tpublic client: ScramjetClient\n\t) {\n\t\tsuper(\"contextInit\");\n\t}\n}\n","export function getOwnPropertyDescriptorHandler(target, prop) {\n\tconst realDescriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n\n\treturn realDescriptor;\n}\n","import { ScramjetClient } from \"@client/index\";\nimport { UrlChangeEvent } from \"@client/events\";\nimport { rewriteUrl } from \"@rewriters/url\";\nimport { iswindow } from \"@client/entry\";\n\nexport function createLocationProxy(\n\tclient: ScramjetClient,\n\tself: typeof globalThis\n) {\n\tconst Location = iswindow ? self.Location : self.WorkerLocation;\n\t// location cannot be Proxy()d\n\tconst fakeLocation: any = {};\n\tObject.setPrototypeOf(fakeLocation, Location.prototype);\n\tfakeLocation.constructor = Location;\n\n\t// for some reason it's on the object for Location and on the prototype for WorkerLocation??\n\tconst descriptorSource = iswindow ? self.location : Location.prototype;\n\tconst urlprops = [\n\t\t\"protocol\",\n\t\t\"hash\",\n\t\t\"host\",\n\t\t\"hostname\",\n\t\t\"href\",\n\t\t\"origin\",\n\t\t\"pathname\",\n\t\t\"port\",\n\t\t\"search\",\n\t];\n\tfor (const prop of urlprops) {\n\t\tconst native = client.natives.call(\n\t\t\t\"Object.getOwnPropertyDescriptor\",\n\t\t\tnull,\n\t\t\tdescriptorSource,\n\t\t\tprop\n\t\t);\n\t\tif (!native) continue;\n\n\t\tconst desc: Partial<PropertyDescriptor> = {\n\t\t\tconfigurable: false,\n\t\t\tenumerable: true,\n\t\t};\n\t\tif (native.get) {\n\t\t\tdesc.get = new Proxy(native.get, {\n\t\t\t\tapply() {\n\t\t\t\t\treturn client.url[prop];\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t\tif (native.set) {\n\t\t\tdesc.set = new Proxy(native.set, {\n\t\t\t\tapply(target, that, args) {\n\t\t\t\t\tif (prop === \"href\") {\n\t\t\t\t\t\t// special case\n\t\t\t\t\t\tclient.url = args[0];\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (prop === \"hash\") {\n\t\t\t\t\t\tself.location.hash = args[0];\n\t\t\t\t\t\tconst ev = new UrlChangeEvent(client.url.href);\n\t\t\t\t\t\tif (!client.isSubframe) client.frame?.dispatchEvent(ev);\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst url = new URL(client.url.href);\n\t\t\t\t\turl[prop] = args[0];\n\t\t\t\t\tclient.url = url;\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t\tObject.defineProperty(fakeLocation, prop, desc);\n\t}\n\n\t// functions\n\tfakeLocation.toString = new Proxy(self.location.toString, {\n\t\tapply() {\n\t\t\treturn client.url.href;\n\t\t},\n\t});\n\n\tif (self.location.valueOf)\n\t\tfakeLocation.valueOf = new Proxy(self.location.valueOf, {\n\t\t\tapply() {\n\t\t\t\treturn client.url.href;\n\t\t\t},\n\t\t});\n\tif (self.location.assign)\n\t\tfakeLocation.assign = new Proxy(self.location.assign, {\n\t\t\tapply(target, that, args) {\n\t\t\t\targs[0] = rewriteUrl(args[0], client.meta);\n\t\t\t\tReflect.apply(target, self.location, args);\n\n\t\t\t\tconst urlchangeev = new UrlChangeEvent(client.url.href);\n\t\t\t\tif (!client.isSubframe) client.frame?.dispatchEvent(urlchangeev);\n\t\t\t},\n\t\t});\n\tif (self.location.reload)\n\t\tfakeLocation.reload = new Proxy(self.location.reload, {\n\t\t\tapply(target, that, args) {\n\t\t\t\tReflect.apply(target, self.location, args);\n\t\t\t},\n\t\t});\n\tif (self.location.replace)\n\t\tfakeLocation.replace = new Proxy(self.location.replace, {\n\t\t\tapply(target, that, args) {\n\t\t\t\targs[0] = rewriteUrl(args[0], client.meta);\n\t\t\t\tReflect.apply(target, self.location, args);\n\n\t\t\t\tconst urlchangeev = new UrlChangeEvent(client.url.href);\n\t\t\t\tif (!client.isSubframe) client.frame?.dispatchEvent(urlchangeev);\n\t\t\t},\n\t\t});\n\n\treturn fakeLocation;\n}\n","import { ScramjetClient } from \"@client/index\";\n\nexport default function (client: ScramjetClient) {\n\tclient.Proxy(\"console.clear\", {\n\t\tapply(ctx) {\n\t\t\t// fuck you\n\t\t\tctx.return(undefined);\n\t\t},\n\t});\n\n\tconst log = console.log;\n\tclient.Trap(\"console.log\", {\n\t\tset(_ctx, _v) {\n\t\t\t// is there a legitimate reason to let sites do this?\n\t\t},\n\t\tget(_ctx) {\n\t\t\treturn log;\n\t\t},\n\t});\n}\n","import { rewriteBlob, unrewriteBlob } from \"@rewriters/url\";\nimport { ScramjetClient } from \"@client/index\";\nexport default function (client: ScramjetClient) {\n\t// hide the origin from object urls from the page\n\tclient.Proxy(\"URL.createObjectURL\", {\n\t\tapply(ctx) {\n\t\t\tconst url: string = ctx.call();\n\t\t\tif (url.startsWith(\"blob:\")) {\n\t\t\t\tctx.return(rewriteBlob(url, client.meta));\n\t\t\t} else {\n\t\t\t\tctx.return(url);\n\t\t\t}\n\t\t},\n\t});\n\n\tclient.Proxy(\"URL.revokeObjectURL\", {\n\t\tapply(ctx) {\n\t\t\tctx.args[0] = unrewriteBlob(ctx.args[0]);\n\t\t},\n\t});\n}\n","import { rewriteUrl } from \"@rewriters/url\";\nimport { ScramjetClient } from \"@client/index\";\n\nexport default function (client: ScramjetClient, _self: Self) {\n\tclient.Proxy(\"CacheStorage.prototype.open\", {\n\t\tapply(ctx) {\n\t\t\tctx.args[0] = `${client.url.origin}@${ctx.args[0]}`;\n\t\t},\n\t});\n\n\tclient.Proxy(\"CacheStorage.prototype.has\", {\n\t\tapply(ctx) {\n\t\t\tctx.args[0] = `${client.url.origin}@${ctx.args[0]}`;\n\t\t},\n\t});\n\n\tclient.Proxy(\"CacheStorage.prototype.match\", {\n\t\tapply(ctx) {\n\t\t\tif (typeof ctx.args[0] === \"string\" || ctx.args[0] instanceof URL) {\n\t\t\t\tctx.args[0] = rewriteUrl(ctx.args[0], client.meta);\n\t\t\t}\n\t\t},\n\t});\n\n\tclient.Proxy(\"CacheStorage.prototype.delete\", {\n\t\tapply(ctx) {\n\t\t\tctx.args[0] = `${client.url.origin}@${ctx.args[0]}`;\n\t\t},\n\t});\n\n\tclient.Proxy(\"Cache.prototype.add\", {\n\t\tapply(ctx) {\n\t\t\tif (typeof ctx.args[0] === \"string\" || ctx.args[0] instanceof URL) {\n\t\t\t\tctx.args[0] = rewriteUrl(ctx.args[0], client.meta);\n\t\t\t}\n\t\t},\n\t});\n\n\tclient.Proxy(\"Cache.prototype.addAll\", {\n\t\tapply(ctx) {\n\t\t\tfor (let i = 0; i < ctx.args[0].length; i++) {\n\t\t\t\tif (\n\t\t\t\t\ttypeof ctx.args[0][i] === \"string\" ||\n\t\t\t\t\tctx.args[0][i] instanceof URL\n\t\t\t\t) {\n\t\t\t\t\tctx.args[0][i] = rewriteUrl(ctx.args[0][i], client.meta);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t});\n\n\tclient.Proxy(\"Cache.prototype.put\", {\n\t\tapply(ctx) {\n\t\t\tif (typeof ctx.args[0] === \"string\" || ctx.args[0] instanceof URL) {\n\t\t\t\tctx.args[0] = rewriteUrl(ctx.args[0], client.meta);\n\t\t\t}\n\t\t},\n\t});\n\n\tclient.Proxy(\"Cache.prototype.match\", {\n\t\tapply(ctx) {\n\t\t\tif (typeof ctx.args[0] === \"string\" || ctx.args[0] instanceof URL) {\n\t\t\t\tctx.args[0] = rewriteUrl(ctx.args[0], client.meta);\n\t\t\t}\n\t\t},\n\t});\n\n\tclient.Proxy(\"Cache.prototype.matchAll\", {\n\t\tapply(ctx) {\n\t\t\tif (\n\t\t\t\t(ctx.args[0] && typeof ctx.args[0] === \"string\") ||\n\t\t\t\t(ctx.args[0] && ctx.args[0] instanceof URL)\n\t\t\t) {\n\t\t\t\tctx.args[0] = rewriteUrl(ctx.args[0], client.meta);\n\t\t\t}\n\t\t},\n\t});\n\n\tclient.Proxy(\"Cache.prototype.keys\", {\n\t\tapply(ctx) {\n\t\t\tif (\n\t\t\t\t(ctx.args[0] && typeof ctx.args[0] === \"string\") ||\n\t\t\t\t(ctx.args[0] && ctx.args[0] instanceof URL)\n\t\t\t) {\n\t\t\t\tctx.args[0] = rewriteUrl(ctx.args[0], client.meta);\n\t\t\t}\n\t\t},\n\t});\n\n\tclient.Proxy(\"Cache.prototype.delete\", {\n\t\tapply(ctx) {\n\t\t\tif (typeof ctx.args[0] === \"string\" || ctx.args[0] instanceof URL) {\n\t\t\t\tctx.args[0] = rewriteUrl(ctx.args[0], client.meta);\n\t\t\t}\n\t\t},\n\t});\n}\n","// delete all chrome specific apis, or apis that are not supported by any browser other than chrome\n// these are not worth emulating and typically cause issues\n\nimport { isemulatedsw, iswindow } from \"@client/entry\";\nimport { ScramjetClient } from \"@client/index\";\n\n// type self as any here, most of these are not defined in the types\nexport default function (client: ScramjetClient, self: any) {\n\tconst del = (name: string) => {\n\t\tconst split = name.split(\".\");\n\t\tconst prop = split.pop();\n\t\tconst target = split.reduce((a, b) => a?.[b], self);\n\t\tif (!target) return;\n\t\tif (prop && prop in target) {\n\t\t\tdelete target[prop];\n\t\t} else {\n\t\t}\n\t};\n\n\t// obviously\n\t// del(\"chrome\");\n\n\t// ShapeDetector https://developer.chrome.com/docs/capabilities/shape-detection\n\tdel(\"BarcodeDetector\");\n\tdel(\"FaceDetector\");\n\tdel(\"TextDetector\");\n\n\t// background synchronization api\n\tif (iswindow) {\n\t\tdel(\"ServiceWorkerRegistration.prototype.sync\");\n\t}\n\tif (isemulatedsw) {\n\t\tdel(\"SyncManager\");\n\t\tdel(\"SyncEvent\");\n\t}\n\n\t// trustedtypes\n\tdel(\"TrustedHTML\");\n\tdel(\"TrustedScript\");\n\tdel(\"TrustedScriptURL\");\n\tdel(\"TrustedTypePolicy\");\n\tdel(\"TrustedTypePolicyFactory\");\n\tself.__defineGetter__(\"trustedTypes\", () => undefined);\n\n\t// whatever this is\n\tdel(\"Navigator.prototype.joinAdInterestGroup\");\n\n\tif (!iswindow) return;\n\t// DOM specific ones below here\n\n\tdel(\"MediaDevices.prototype.setCaptureHandleConfig\");\n\n\t// web bluetooth api\n\tdel(\"Navigator.prototype.bluetooth\");\n\tdel(\"Bluetooth\");\n\tdel(\"BluetoothDevice\");\n\tdel(\"BluetoothRemoteGATTServer\");\n\tdel(\"BluetoothRemoteGATTCharacteristic\");\n\tdel(\"BluetoothRemoteGATTDescriptor\");\n\tdel(\"BluetoothUUID\");\n\n\t// contact picker api\n\tdel(\"Navigator.prototype.contacts\");\n\tdel(\"ContactAddress\");\n\tdel(\"ContactManager\");\n\n\t// Idle Detection API\n\tdel(\"IdleDetector\");\n\n\t// Presentation API\n\tdel(\"Navigator.prototype.presentation\");\n\tdel(\"Presentation\");\n\tdel(\"PresentationConnection\");\n\tdel(\"PresentationReceiver\");\n\tdel(\"PresentationRequest\");\n\tdel(\"PresentationAvailability\");\n\tdel(\"PresentationConnectionAvailableEvent\");\n\tdel(\"PresentationConnectionCloseEvent\");\n\tdel(\"PresentationConnectionList\");\n\n\t// Window Controls Overlay API\n\tdel(\"WindowControlsOverlay\");\n\tdel(\"WindowControlsOverlayGeometryChangeEvent\");\n\tdel(\"Navigator.prototype.windowControlsOverlay\");\n\n\t// WebHID API\n\tdel(\"Navigator.prototype.hid\");\n\tdel(\"HID\");\n\tdel(\"HIDDevice\");\n\tdel(\"HIDConnectionEvent\");\n\tdel(\"HIDInputReportEvent\");\n\n\t// Navigation API (not chrome only but it's really annoying to implement)\n\tdel(\"navigation\");\n\tdel(\"NavigateEvent\");\n\tdel(\"NavigationActivation\");\n\tdel(\"NavigationCurrentEntryChangeEvent\");\n\tdel(\"NavigationDestination\");\n\tdel(\"NavigationHistoryEntry\");\n\tdel(\"NavigationTransition\");\n}\n","import { flagEnabled } from \"@/shared\";\nimport { ScramjetClient } from \"@client/index\";\n\nexport const enabled = (client: ScramjetClient) =>\n\tflagEnabled(\"captureErrors\", client.url);\nexport function argdbg(arg, recurse = []) {\n\tswitch (typeof arg) {\n\t\tcase \"string\":\n\t\t\tbreak;\n\t\tcase \"object\":\n\t\t\tif (\n\t\t\t\targ &&\n\t\t\t\targ[Symbol.iterator] &&\n\t\t\t\ttypeof arg[Symbol.iterator] === \"function\"\n\t\t\t)\n\t\t\t\tfor (const prop in arg) {\n\t\t\t\t\t// make sure it's not a getter\n\t\t\t\t\tconst desc = Object.getOwnPropertyDescriptor(arg, prop);\n\t\t\t\t\tif (desc && desc.get) continue;\n\n\t\t\t\t\tconst ar = arg[prop];\n\t\t\t\t\tif (recurse.includes(ar)) continue;\n\t\t\t\t\trecurse.push(ar);\n\t\t\t\t\targdbg(ar, recurse);\n\t\t\t\t}\n\t\t\tbreak;\n\t}\n}\n\nexport default function (client: ScramjetClient, self: typeof globalThis) {\n\tconst warn = console.warn;\n\tself.$scramerr = function scramerr(e) {\n\t\twarn(\"CAUGHT ERROR\", e);\n\t};\n\n\tself.$scramdbg = function scramdbg(args, t) {\n\t\tif (args && typeof args === \"object\" && args.length > 0) argdbg(args);\n\t\targdbg(t);\n\n\t\treturn t;\n\t};\n\n\tclient.Proxy(\"Promise.prototype.catch\", {\n\t\tapply(ctx) {\n\t\t\tif (ctx.args[0])\n\t\t\t\tctx.args[0] = new Proxy(ctx.args[0], {\n\t\t\t\t\tapply(target, that, args) {\n\t\t\t\t\t\t// console.warn(\"CAUGHT PROMISE REJECTION\", args);\n\t\t\t\t\t\tReflect.apply(target, that, args);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t},\n\t});\n}\n","import { config, flagEnabled } from \"@/shared\";\nimport { unrewriteUrl } from \"@rewriters/url\";\nimport { ScramjetClient } from \"@client/index\";\n\nexport const enabled = (client: ScramjetClient) =>\n\tflagEnabled(\"cleanErrors\", client.url);\n\nexport default function (client: ScramjetClient, _self: Self) {\n\t// v8 only. all we need to do is clean the scramjet urls from stack traces\n\tconst closure = (error, stack) => {\n\t\tlet newstack = error.stack;\n\n\t\tfor (let i = 0; i < stack.length; i++) {\n\t\t\tconst url = stack[i].getFileName();\n\n\t\t\ttry {\n\t\t\t\tif (url.endsWith(config.files.all)) {\n\t\t\t\t\t// strip stack frames including scramjet handlers from the trace\n\t\t\t\t\tconst lines = newstack.split(\"\\n\");\n\t\t\t\t\tconst line = lines.find((l) => l.includes(url));\n\t\t\t\t\tlines.splice(line, 1);\n\t\t\t\t\tnewstack = lines.join(\"\\n\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} catch {}\n\n\t\t\ttry {\n\t\t\t\tnewstack = newstack.replaceAll(url, unrewriteUrl(url));\n\t\t\t} catch {}\n\t\t}\n\n\t\treturn newstack;\n\t};\n\tclient.Trap(\"Error.prepareStackTrace\", {\n\t\tget(_ctx) {\n\t\t\t// this is a funny js quirk. the getter is ran every time you type something in console\n\t\t\treturn closure;\n\t\t},\n\t\tset(_value) {\n\t\t\t// just ignore it if a site tries setting their own. not much we can really do\n\t\t},\n\t});\n}\n","import { config } from \"@/shared\";\nimport { rewriteJs } from \"@rewriters/js\";\nimport { ScramjetClient } from \"@client/index\";\n\nexport default function (client: ScramjetClient, self: Self) {\n\t// used for proxying *direct eval*\n\t// eval(\"...\") -> eval($scramjet$rewrite(\"...\"))\n\tObject.defineProperty(self, config.globals.rewritefn, {\n\t\tvalue: function (js: any) {\n\t\t\tif (typeof js !== \"string\") return js;\n\n\t\t\tconst rewritten = rewriteJs(js, \"(direct eval proxy)\", client.meta);\n\n\t\t\treturn rewritten;\n\t\t},\n\t\twritable: false,\n\t\tconfigurable: false,\n\t});\n}\n\nexport function indirectEval(this: ScramjetClient, strict: boolean, js: any) {\n\t// > If the argument of eval() is not a string, eval() returns the argument unchanged\n\tif (typeof js !== \"string\") return js;\n\n\tlet indirection: typeof eval;\n\tif (this.url.hostname === \"accounts.google.com\") {\n\t\tconsole.log(\"USING STRICT EVAL - BOTGUARD\");\n\t\tindirection = new Function(`\n\t\t\t\"use strict\";\n\t\t\treturn eval;\n\t\t`) as typeof eval;\n\t} else {\n\t\tindirection = this.global.eval;\n\t}\n\n\treturn indirection(\n\t\trewriteJs(js, \"(indirect eval proxy)\", this.meta) as string\n\t);\n}\n","import { iswindow } from \"@client/entry\";\nimport { unrewriteUrl } from \"@rewriters/url\";\nimport { SCRAMJETCLIENT } from \"@/symbols\";\nimport { ScramjetClient } from \"@client/index\";\nimport { getOwnPropertyDescriptorHandler } from \"@client/helpers\";\n\nconst realOnEvent = Symbol.for(\"scramjet original onevent function\");\n\nexport default function (client: ScramjetClient, self: Self) {\n\tconst handlers = {\n\t\tmessage: {\n\t\t\t_init() {\n\t\t\t\tif (typeof this.data === \"object\" && \"$scramjet$type\" in this.data) {\n\t\t\t\t\t// this is a ctl message\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t},\n\t\t\tports() {\n\t\t\t\t// don't know why i have to do this?\n\t\t\t\treturn this.ports;\n\t\t\t},\n\t\t\tsource() {\n\t\t\t\tif (this.source === null) return null;\n\n\t\t\t\t// const scram: ScramjetClient = this.source[SCRAMJETCLIENT];\n\n\t\t\t\t// if (scram) return scram.globalProxy;\n\n\t\t\t\treturn this.source;\n\t\t\t},\n\t\t\torigin() {\n\t\t\t\tif (typeof this.data === \"object\" && \"$scramjet$origin\" in this.data)\n\t\t\t\t\treturn this.data.$scramjet$origin;\n\n\t\t\t\treturn client.url.origin;\n\t\t\t},\n\t\t\tdata() {\n\t\t\t\tif (typeof this.data === \"object\" && \"$scramjet$data\" in this.data)\n\t\t\t\t\treturn this.data.$scramjet$data;\n\n\t\t\t\treturn this.data;\n\t\t\t},\n\t\t},\n\t\thashchange: {\n\t\t\toldURL() {\n\t\t\t\treturn unrewriteUrl(this.oldURL);\n\t\t\t},\n\t\t\tnewURL() {\n\t\t\t\treturn unrewriteUrl(this.newURL);\n\t\t\t},\n\t\t},\n\t\tstorage: {\n\t\t\t_init() {\n\t\t\t\treturn this.key.startsWith(client.url.host + \"@\");\n\t\t\t},\n\t\t\tkey() {\n\t\t\t\treturn this.key.substring(this.key.indexOf(\"@\") + 1);\n\t\t\t},\n\t\t\turl() {\n\t\t\t\treturn unrewriteUrl(this.url);\n\t\t\t},\n\t\t},\n\t};\n\n\tfunction wraplistener(listener: (...args: any) => any) {\n\t\treturn new Proxy(listener, {\n\t\t\tapply(target, that, args) {\n\t\t\t\tconst realEvent: Event = args[0];\n\n\t\t\t\t// we only need to handle events dispatched from the browser\n\t\t\t\tif (realEvent.isTrusted) {\n\t\t\t\t\tconst type = realEvent.type;\n\n\t\t\t\t\tif (type in handlers) {\n\t\t\t\t\t\tconst handler = handlers[type];\n\n\t\t\t\t\t\tif (handler._init) {\n\t\t\t\t\t\t\tif (handler._init.call(realEvent) === false) return;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\targs[0] = new Proxy(realEvent, {\n\t\t\t\t\t\t\tget(target, prop, reciever) {\n\t\t\t\t\t\t\t\tconst value = Reflect.get(target, prop);\n\t\t\t\t\t\t\t\tif (prop in handler) {\n\t\t\t\t\t\t\t\t\treturn handler[prop].call(target);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (typeof value === \"function\") {\n\t\t\t\t\t\t\t\t\treturn new Proxy(value, {\n\t\t\t\t\t\t\t\t\t\tapply(target, that, args) {\n\t\t\t\t\t\t\t\t\t\t\tif (that === reciever) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn Reflect.apply(target, realEvent, args);\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\treturn Reflect.apply(target, that, args);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tgetOwnPropertyDescriptor: getOwnPropertyDescriptorHandler,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!self.event) {\n\t\t\t\t\tObject.defineProperty(self, \"event\", {\n\t\t\t\t\t\tget() {\n\t\t\t\t\t\t\treturn args[0];\n\t\t\t\t\t\t},\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tconst rv = Reflect.apply(target, that, args);\n\n\t\t\t\treturn rv;\n\t\t\t},\n\t\t\tgetOwnPropertyDescriptor: getOwnPropertyDescriptorHandler,\n\t\t});\n\t}\n\n\tclient.Proxy(\"EventTarget.prototype.addEventListener\", {\n\t\tapply(ctx) {\n\t\t\tif (typeof ctx.args[1] !== \"function\") return;\n\n\t\t\tconst origlistener = ctx.args[1];\n\t\t\tconst proxylistener = wraplistener(origlistener);\n\n\t\t\tctx.args[1] = proxylistener;\n\n\t\t\tlet arr = client.eventcallbacks.get(ctx.this);\n\t\t\tarr ||= [] as any;\n\t\t\tarr.push({\n\t\t\t\tevent: ctx.args[0] as string,\n\t\t\t\toriginalCallback: origlistener,\n\t\t\t\tproxiedCallback: proxylistener,\n\t\t\t});\n\t\t\tclient.eventcallbacks.set(ctx.this, arr);\n\t\t},\n\t});\n\n\tclient.Proxy(\"EventTarget.prototype.removeEventListener\", {\n\t\tapply(ctx) {\n\t\t\tif (typeof ctx.args[1] !== \"function\") return;\n\n\t\t\tconst arr = client.eventcallbacks.get(ctx.this);\n\t\t\tif (!arr) return;\n\n\t\t\tconst i = arr.findIndex(\n\t\t\t\t(e) => e.event === ctx.args[0] && e.originalCallback === ctx.args[1]\n\t\t\t);\n\t\t\tif (i === -1) return;\n\n\t\t\tconst r = arr.splice(i, 1);\n\t\t\tclient.eventcallbacks.set(ctx.this, arr);\n\n\t\t\tctx.args[1] = r[0].proxiedCallback;\n\t\t},\n\t});\n\n\tconst targets = [self.self, self.MessagePort.prototype] as Array<any>;\n\tif (iswindow) targets.push(self.HTMLElement.prototype);\n\tif (self.Worker) targets.push(self.Worker.prototype);\n\n\tfor (const target of targets) {\n\t\tconst keys = Reflect.ownKeys(target);\n\n\t\tfor (const key of keys) {\n\t\t\tif (\n\t\t\t\ttypeof key === \"string\" &&\n\t\t\t\tkey.startsWith(\"on\") &&\n\t\t\t\thandlers[key.slice(2)]\n\t\t\t) {\n\t\t\t\tconst descriptor = client.natives.call(\n\t\t\t\t\t\"Object.getOwnPropertyDescriptor\",\n\t\t\t\t\tnull,\n\t\t\t\t\ttarget,\n\t\t\t\t\tkey\n\t\t\t\t);\n\t\t\t\tif (!descriptor.get || !descriptor.set || !descriptor.configurable)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// these are the `onmessage`, `onclick`, etc. properties\n\t\t\t\tclient.RawTrap(target, key, {\n\t\t\t\t\tget(ctx) {\n\t\t\t\t\t\tif (this[realOnEvent]) return this[realOnEvent];\n\n\t\t\t\t\t\treturn ctx.get();\n\t\t\t\t\t},\n\t\t\t\t\tset(ctx, value: any) {\n\t\t\t\t\t\tthis[realOnEvent] = value;\n\n\t\t\t\t\t\tif (typeof value !== \"function\") return ctx.set(value);\n\n\t\t\t\t\t\tctx.set(wraplistener(value));\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}\n","import { rewriteJs } from \"@rewriters/js\";\nimport { ScramjetClient, ProxyCtx, Proxy } from \"@client/index\";\n\nfunction rewriteFunction(ctx: ProxyCtx, client: ScramjetClient) {\n\tconst stringifiedFunction = ctx.call().toString();\n\n\tconst content = rewriteJs(\n\t\t`return ${stringifiedFunction}`,\n\t\t\"(function proxy)\",\n\t\tclient.meta\n\t);\n\tctx.return(ctx.fn(content)());\n}\n\nexport default function (client: ScramjetClient, _self: Self) {\n\tconst handler: Proxy = {\n\t\tapply(ctx: ProxyCtx) {\n\t\t\trewriteFunction(ctx, client);\n\t\t},\n\t\tconstruct(ctx) {\n\t\t\trewriteFunction(ctx, client);\n\t\t},\n\t};\n\n\tclient.Proxy(\"Function\", handler);\n\n\tconst RawFunction = client.natives.call(\n\t\t\"eval\",\n\t\tnull,\n\t\t\"(function () {})\"\n\t).constructor;\n\tconst RawAsyncFunction = client.natives.call(\n\t\t\"eval\",\n\t\tnull,\n\t\t\"(async function () {})\"\n\t).constructor;\n\tconst RawGeneratorFunction = client.natives.call(\n\t\t\"eval\",\n\t\tnull,\n\t\t\"(function* () {})\"\n\t).constructor;\n\tconst RawAsyncGeneratorFunction = client.natives.call(\n\t\t\"eval\",\n\t\tnull,\n\t\t\"(async function* () {})\"\n\t).constructor;\n\n\tclient.RawProxy(RawFunction.prototype, \"constructor\", handler);\n\tclient.RawProxy(RawAsyncFunction.prototype, \"constructor\", handler);\n\tclient.RawProxy(RawGeneratorFunction.prototype, \"constructor\", handler);\n\tclient.RawProxy(RawAsyncGeneratorFunction.prototype, \"constructor\", handler);\n}\n","import { ScramjetClient } from \"@client/index\";\nimport { config } from \"@/shared\";\nimport { rewriteUrl } from \"@rewriters/url\";\n\nexport default function (client: ScramjetClient, self: Self) {\n\tconst boundimport = client.natives.call(\n\t\t\"Function\",\n\t\tnull,\n\t\t\"url\",\n\t\t\"return import(url)\"\n\t);\n\n\tObject.defineProperty(self, config.globals.importfn, {\n\t\tvalue: function (base: string, url: string) {\n\t\t\tconst resolved = new URL(url, base).href;\n\n\t\t\tif (\n\t\t\t\turl.includes(\":\") ||\n\t\t\t\turl.startsWith(\"/\") ||\n\t\t\t\turl.startsWith(\".\") ||\n\t\t\t\turl.startsWith(\"..\")\n\t\t\t) {\n\t\t\t\t// this is a url\n\t\t\t\treturn boundimport(`${rewriteUrl(resolved, client.meta)}?type=module`);\n\t\t\t} else {\n\t\t\t\t// this is a specifier handled by importmaps\n\t\t\t\treturn boundimport(url);\n\t\t\t}\n\t\t},\n\t\twritable: false,\n\t\tconfigurable: false,\n\t\tenumerable: false,\n\t});\n\tObject.defineProperty(self, config.globals.metafn, {\n\t\tvalue: function (metaobj: any, base: string) {\n\t\t\tmetaobj.url = base;\n\t\t\tmetaobj.resolve = function (url: string) {\n\t\t\t\treturn new URL(url, base).href;\n\t\t\t};\n\n\t\t\treturn metaobj;\n\t\t},\n\t\twritable: false,\n\t\tconfigurable: false,\n\t\tenumerable: false,\n\t});\n}\n","import { ScramjetClient } from \"@client/index\";\n\nexport default function (client: ScramjetClient) {\n\tclient.Proxy(\"IDBFactory.prototype.open\", {\n\t\tapply(ctx) {\n\t\t\tctx.args[0] = `${client.url.origin}@${ctx.args[0]}`;\n\t\t},\n\t});\n\n\tclient.Trap(\"IDBDatabase.prototype.name\", {\n\t\tget(ctx) {\n\t\t\tconst name = ctx.get() as string;\n\n\t\t\treturn name.substring(name.indexOf(\"@\") + 1);\n\t\t},\n\t});\n}\n","import { ScramjetClient } from \"@client/index\";\n\nexport default function (client: ScramjetClient) {\n\tclient.Proxy(\"StorageManager.prototype.getDirectory\", {\n\t\tapply(ctx) {\n\t\t\tconst rootPromise = ctx.call() as Promise<FileSystemDirectoryHandle>;\n\t\t\tctx.return(\n\t\t\t\t(async () => {\n\t\t\t\t\tconst root = await rootPromise;\n\t\t\t\t\tconst directory = await root.getDirectoryHandle(\n\t\t\t\t\t\t`${client.url.origin.replace(/\\/|\\s|\\./g, \"-\")}`,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcreate: true,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tObject.defineProperty(directory, \"name\", {\n\t\t\t\t\t\tvalue: \"\",\n\t\t\t\t\t\twritable: false,\n\t\t\t\t\t});\n\n\t\t\t\t\treturn directory;\n\t\t\t\t})()\n\t\t\t);\n\t\t},\n\t});\n}\n","import { iswindow } from \"@client/entry\";\nimport { SCRAMJETCLIENT } from \"@/symbols\";\nimport { ScramjetClient } from \"@client/index\";\nimport { POLLUTANT } from \"@client/shared/realm\";\n\nexport default function (client: ScramjetClient) {\n\tif (iswindow)\n\t\tclient.Proxy(\"window.postMessage\", {\n\t\t\tapply(ctx) {\n\t\t\t\t// so we need to send the real origin here, since the recieving window can't possibly know.\n\t\t\t\t// except, remember that this code is being ran in a different realm than the invoker, so if we ask our `client` it may give us the wrong origin\n\t\t\t\t// if we were given any object that came from the real realm we can use that to get the real origin\n\t\t\t\t// and this works in every case EXCEPT for the fact that all three arguments can be strings which are copied instead of cloned\n\t\t\t\t// so we have to use `$setrealm` which will pollute this with an object from the real realm\n\n\t\t\t\tlet pollutant;\n\n\t\t\t\tif (typeof ctx.args[0] === \"object\" && ctx.args[0] !== null) {\n\t\t\t\t\tpollutant = ctx.args[0]; // try to use the first object we can find because it's more reliable\n\t\t\t\t} else if (typeof ctx.args[2] === \"object\" && ctx.args[2] !== null) {\n\t\t\t\t\tpollutant = ctx.args[2]; // next try to use transfer\n\t\t\t\t} else if (\n\t\t\t\t\tctx.this &&\n\t\t\t\t\tPOLLUTANT in ctx.this &&\n\t\t\t\t\ttypeof ctx.this[POLLUTANT] === \"object\" &&\n\t\t\t\t\tctx.this[POLLUTANT] !== null\n\t\t\t\t) {\n\t\t\t\t\tpollutant = ctx.this[POLLUTANT]; // lastly try to use the object from $setrealm\n\t\t\t\t} else {\n\t\t\t\t\tpollutant = {}; // give up\n\t\t\t\t}\n\n\t\t\t\t// and now we can steal Function from the caller's realm\n\t\t\t\tconst {\n\t\t\t\t\tconstructor: { constructor: Function },\n\t\t\t\t} = pollutant;\n\n\t\t\t\t// invoking stolen function will give us the caller's globalThis, remember scramjet has already proxied it!!!\n\t\t\t\tconst callerGlobalThisProxied: Self = Function(\"return globalThis\")();\n\t\t\t\tconst callerClient = callerGlobalThisProxied[SCRAMJETCLIENT];\n\n\t\t\t\t// this WOULD be enough but the source argument of MessageEvent has to return the caller's window\n\t\t\t\t// and if we just call it normally it would be coming from here, which WILL NOT BE THE CALLER'S because the accessor is from the parent\n\t\t\t\t// so with the stolen function we wrap postmessage so the source will truly be the caller's window (remember that function is scramjet's!!!)\n\t\t\t\tconst wrappedPostMessage = Function(\"...args\", \"this(...args)\");\n\n\t\t\t\tctx.args[0] = {\n\t\t\t\t\t$scramjet$messagetype: \"window\",\n\t\t\t\t\t$scramjet$origin: callerClient.url.origin,\n\t\t\t\t\t$scramjet$data: ctx.args[0],\n\t\t\t\t};\n\n\t\t\t\t// * origin because obviously\n\t\t\t\tif (typeof ctx.args[1] === \"string\") ctx.args[1] = \"*\";\n\t\t\t\tif (typeof ctx.args[1] === \"object\") ctx.args[1].targetOrigin = \"*\";\n\n\t\t\t\tctx.return(wrappedPostMessage.call(ctx.fn, ...ctx.args));\n\t\t\t},\n\t\t});\n\n\tconst toproxy = [\"MessagePort.prototype.postMessage\"];\n\n\tif (self.Worker) toproxy.push(\"Worker.prototype.postMessage\");\n\tif (!iswindow) toproxy.push(\"self.postMessage\"); // only do the generic version if we're in a worker\n\n\tclient.Proxy(toproxy, {\n\t\tapply(ctx) {\n\t\t\t// origin/source doesn't need to be preserved - it's null in the message event\n\n\t\t\tctx.args[0] = {\n\t\t\t\t$scramjet$messagetype: \"worker\",\n\t\t\t\t$scramjet$data: ctx.args[0],\n\t\t\t};\n\t\t},\n\t});\n}\n","import { ScramjetClient } from \"@client/index\";\nimport { config } from \"@/shared\";\n\nexport const POLLUTANT = Symbol.for(\"scramjet realm pollutant\");\n\nexport default function (client: ScramjetClient, self: typeof globalThis) {\n\t// object.$setrealm({}).postMessage(...)\n\t// the empty object is the \"pollutant\" which can reconstruct the real realm\n\t// i explain more in postmessage.ts\n\tObject.defineProperty(self.Object.prototype, config.globals.setrealmfn, {\n\t\tvalue(pollution: object) {\n\t\t\t// this is bad!! sites could detect this\n\t\t\tObject.defineProperty(this, POLLUTANT, {\n\t\t\t\tvalue: pollution,\n\t\t\t\twritable: false,\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: false,\n\t\t\t});\n\n\t\t\treturn this;\n\t\t},\n\t\twritable: true,\n\t\tconfigurable: true,\n\t\tenumerable: false,\n\t});\n}\n","import { rewriteUrl, unrewriteUrl } from \"@rewriters/url\";\nimport { ScramjetClient } from \"@client/index\";\n\nexport default function (client: ScramjetClient) {\n\tclient.Proxy(\"EventSource\", {\n\t\tconstruct(ctx) {\n\t\t\tctx.args[0] = rewriteUrl(ctx.args[0], client.meta);\n\t\t},\n\t});\n\n\tclient.Trap(\"EventSource.prototype.url\", {\n\t\tget(ctx) {\n\t\t\tunrewriteUrl(ctx.get() as string);\n\t\t},\n\t});\n}\n","import { isemulatedsw } from \"@client/entry\";\nimport { rewriteUrl, unrewriteUrl } from \"@rewriters/url\";\nimport { ScramjetClient } from \"@client/index\";\n\nexport default function (client: ScramjetClient) {\n\tclient.Proxy(\"fetch\", {\n\t\tapply(ctx) {\n\t\t\tif (typeof ctx.args[0] === \"string\" || ctx.args[0] instanceof URL) {\n\t\t\t\tctx.args[0] = rewriteUrl(ctx.args[0], client.meta);\n\n\t\t\t\tif (isemulatedsw) ctx.args[0] += \"?from=swruntime\";\n\t\t\t}\n\t\t},\n\t});\n\n\tclient.Proxy(\"Request\", {\n\t\tconstruct(ctx) {\n\t\t\tif (typeof ctx.args[0] === \"string\" || ctx.args[0] instanceof URL) {\n\t\t\t\tctx.args[0] = rewriteUrl(ctx.args[0], client.meta);\n\n\t\t\t\tif (isemulatedsw) ctx.args[0] += \"?from=swruntime\";\n\t\t\t}\n\t\t},\n\t});\n\n\tclient.Trap(\"Response.prototype.url\", {\n\t\tget(ctx) {\n\t\t\treturn unrewriteUrl(ctx.get() as string);\n\t\t},\n\t});\n\n\tclient.Trap(\"Request.prototype.url\", {\n\t\tget(ctx) {\n\t\t\treturn unrewriteUrl(ctx.get() as string);\n\t\t},\n\t});\n}\n","import { type BareWebSocket } from \"@mercuryworkshop/bare-mux\";\nimport { ScramjetClient } from \"@client/index\";\n\ntype FakeWebSocketState = {\n\textensions: string;\n\tprotocol: string;\n\turl: string;\n\tbinaryType: string;\n\tbarews: BareWebSocket;\n\n\tonclose?: (ev: CloseEvent) => any;\n\tonerror?: (ev: Event) => any;\n\tonmessage?: (ev: MessageEvent) => any;\n\tonopen?: (ev: Event) => any;\n};\ntype FakeWebSocketStreamState = {\n\textensions: string;\n\tprotocol: string;\n\turl: string;\n\tbarews: BareWebSocket;\n\n\topened: any;\n\tclosed: any;\n\treadable: ReadableStream;\n\twritable: WritableStream;\n};\nexport default function (client: ScramjetClient, self: typeof globalThis) {\n\tconst socketmap: WeakMap<WebSocket, FakeWebSocketState> = new WeakMap();\n\tconst socketstreammap: WeakMap<object, FakeWebSocketStreamState> =\n\t\tnew WeakMap();\n\tclient.Proxy(\"WebSocket\", {\n\t\tconstruct(ctx) {\n\t\t\tconst fakeWebSocket = new EventTarget() as WebSocket;\n\t\t\tObject.setPrototypeOf(fakeWebSocket, ctx.fn.prototype);\n\t\t\tfakeWebSocket.constructor = ctx.fn;\n\n\t\t\tconst trustEvent = (ev: Event) =>\n\t\t\t\tnew Proxy(ev, {\n\t\t\t\t\tget(target, prop) {\n\t\t\t\t\t\tif (prop === \"isTrusted\") return true;\n\n\t\t\t\t\t\treturn Reflect.get(target, prop);\n\t\t\t\t\t},\n\t\t\t\t});\n\n\t\t\tconst barews = client.bare.createWebSocket(\n\t\t\t\tctx.args[0],\n\t\t\t\tctx.args[1],\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t\"User-Agent\": self.navigator.userAgent,\n\t\t\t\t\tOrigin: client.url.origin,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tconst state: FakeWebSocketState = {\n\t\t\t\textensions: \"\",\n\t\t\t\tprotocol: \"\",\n\t\t\t\turl: ctx.args[0],\n\t\t\t\tbinaryType: \"blob\",\n\t\t\t\tbarews,\n\n\t\t\t\tonclose: null,\n\t\t\t\tonerror: null,\n\t\t\t\tonmessage: null,\n\t\t\t\tonopen: null,\n\t\t\t};\n\n\t\t\tfunction fakeEventSend(fakeev: Event) {\n\t\t\t\tstate[\"on\" + fakeev.type]?.(trustEvent(fakeev));\n\t\t\t\tfakeWebSocket.dispatchEvent(fakeev);\n\t\t\t}\n\n\t\t\tbarews.addEventListener(\"open\", () => {\n\t\t\t\tfakeEventSend(new Event(\"open\"));\n\t\t\t});\n\t\t\tbarews.addEventListener(\"close\", (ev) => {\n\t\t\t\tfakeEventSend(new CloseEvent(\"close\", ev));\n\t\t\t});\n\t\t\tbarews.addEventListener(\"message\", async (ev) => {\n\t\t\t\tlet payload = ev.data;\n\t\t\t\tif (typeof payload === \"string\") {\n\t\t\t\t\t// DO NOTHING\n\t\t\t\t} else if (\"byteLength\" in payload) {\n\t\t\t\t\t// arraybuffer, convert to blob if needed or set the proper prototype\n\t\t\t\t\tif (state.binaryType === \"blob\") {\n\t\t\t\t\t\tpayload = new Blob([payload]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tObject.setPrototypeOf(payload, ArrayBuffer.prototype);\n\t\t\t\t\t}\n\t\t\t\t} else if (\"arrayBuffer\" in payload) {\n\t\t\t\t\t// blob, convert to arraybuffer if neccesary.\n\t\t\t\t\tif (state.binaryType === \"arraybuffer\") {\n\t\t\t\t\t\tpayload = await payload.arrayBuffer();\n\t\t\t\t\t\tObject.setPrototypeOf(payload, ArrayBuffer.prototype);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst fakeev = new MessageEvent(\"message\", {\n\t\t\t\t\tdata: payload,\n\t\t\t\t\torigin: ev.origin,\n\t\t\t\t\tlastEventId: ev.lastEventId,\n\t\t\t\t\tsource: ev.source,\n\t\t\t\t\tports: ev.ports,\n\t\t\t\t});\n\n\t\t\t\tfakeEventSend(fakeev);\n\t\t\t});\n\t\t\tbarews.addEventListener(\"error\", () => {\n\t\t\t\tfakeEventSend(new Event(\"error\"));\n\t\t\t});\n\n\t\t\tsocketmap.set(fakeWebSocket, state);\n\t\t\tctx.return(fakeWebSocket);\n\t\t},\n\t});\n\tclient.Trap(\"WebSocket.prototype.binaryType\", {\n\t\tget(ctx) {\n\t\t\tconst ws = socketmap.get(ctx.this);\n\n\t\t\treturn ws.binaryType;\n\t\t},\n\t\tset(ctx, v: string) {\n\t\t\tconst ws = socketmap.get(ctx.this);\n\t\t\tif (v === \"blob\" || v === \"arraybuffer\") ws.binaryType = v;\n\t\t},\n\t});\n\n\tclient.Trap(\"WebSocket.prototype.bufferedAmount\", {\n\t\tget() {\n\t\t\treturn 0;\n\t\t},\n\t});\n\n\tclient.Trap(\"WebSocket.prototype.extensions\", {\n\t\tget(ctx) {\n\t\t\tconst ws = socketmap.get(ctx.this);\n\n\t\t\treturn ws.extensions;\n\t\t},\n\t});\n\n\tclient.Trap(\"WebSocket.prototype.onclose\", {\n\t\tget(ctx) {\n\t\t\tconst ws = socketmap.get(ctx.this);\n\n\t\t\treturn ws.onclose;\n\t\t},\n\t\tset(ctx, v: (ev: CloseEvent) => any) {\n\t\t\tconst ws = socketmap.get(ctx.this);\n\t\t\tws.onclose = v;\n\t\t},\n\t});\n\n\tclient.Trap(\"WebSocket.prototype.onerror\", {\n\t\tget(ctx) {\n\t\t\tconst ws = socketmap.get(ctx.this);\n\n\t\t\treturn ws.onerror;\n\t\t},\n\t\tset(ctx, v: (ev: Event) => any) {\n\t\t\tconst ws = socketmap.get(ctx.this);\n\t\t\tws.onerror = v;\n\t\t},\n\t});\n\n\tclient.Trap(\"WebSocket.prototype.onmessage\", {\n\t\tget(ctx) {\n\t\t\tconst ws = socketmap.get(ctx.this);\n\n\t\t\treturn ws.onmessage;\n\t\t},\n\t\tset(ctx, v: (ev: MessageEvent) => any) {\n\t\t\tconst ws = socketmap.get(ctx.this);\n\t\t\tws.onmessage = v;\n\t\t},\n\t});\n\n\tclient.Trap(\"WebSocket.prototype.onopen\", {\n\t\tget(ctx) {\n\t\t\tconst ws = socketmap.get(ctx.this);\n\n\t\t\treturn ws.onopen;\n\t\t},\n\t\tset(ctx, v: (ev: Event) => any) {\n\t\t\tconst ws = socketmap.get(ctx.this);\n\t\t\tws.onopen = v;\n\t\t},\n\t});\n\n\tclient.Trap(\"WebSocket.prototype.url\", {\n\t\tget(ctx) {\n\t\t\tconst ws = socketmap.get(ctx.this);\n\n\t\t\treturn ws.url;\n\t\t},\n\t});\n\n\tclient.Trap(\"WebSocket.prototype.protocol\", {\n\t\tget(ctx) {\n\t\t\tconst ws = socketmap.get(ctx.this);\n\n\t\t\treturn ws.protocol;\n\t\t},\n\t});\n\n\tclient.Trap(\"WebSocket.prototype.readyState\", {\n\t\tget(ctx) {\n\t\t\tconst ws = socketmap.get(ctx.this);\n\n\t\t\treturn ws.barews.readyState;\n\t\t},\n\t});\n\n\tclient.Proxy(\"WebSocket.prototype.send\", {\n\t\tapply(ctx) {\n\t\t\tconst ws = socketmap.get(ctx.this);\n\n\t\t\tctx.return(ws.barews.send(ctx.args[0]));\n\t\t},\n\t});\n\n\tclient.Proxy(\"WebSocket.prototype.close\", {\n\t\tapply(ctx) {\n\t\t\tconst ws = socketmap.get(ctx.this);\n\t\t\tif (ctx.args[0] === undefined) ctx.args[0] = 1000;\n\t\t\tif (ctx.args[1] === undefined) ctx.args[1] = \"\";\n\t\t\tctx.return(ws.barews.close(ctx.args[0], ctx.args[1]));\n\t\t},\n\t});\n\n\tclient.Proxy(\"WebSocketStream\", {\n\t\tconstruct(ctx) {\n\t\t\tconst fakeWebSocket = {};\n\t\t\tObject.setPrototypeOf(fakeWebSocket, ctx.fn.prototype);\n\t\t\tfakeWebSocket.constructor = ctx.fn;\n\n\t\t\tconst barews = client.bare.createWebSocket(\n\t\t\t\tctx.args[0],\n\t\t\t\tctx.args[1],\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t\"User-Agent\": self.navigator.userAgent,\n\t\t\t\t\tOrigin: client.url.origin,\n\t\t\t\t}\n\t\t\t);\n\t\t\tctx.args[1]?.signal.addEventListener(\"abort\", () => {\n\t\t\t\tbarews.close(1000, \"\");\n\t\t\t});\n\t\t\tlet openResolver, closeResolver;\n\t\t\tlet openRejector;\n\t\t\tconst state: FakeWebSocketStreamState = {\n\t\t\t\textensions: \"\",\n\t\t\t\tprotocol: \"\",\n\t\t\t\turl: ctx.args[0],\n\t\t\t\tbarews,\n\n\t\t\t\topened: new Promise((resolve, reject) => {\n\t\t\t\t\topenResolver = resolve;\n\t\t\t\t\topenRejector = reject;\n\t\t\t\t}),\n\t\t\t\tclosed: new Promise((resolve) => {\n\t\t\t\t\tcloseResolver = resolve;\n\t\t\t\t}),\n\t\t\t\treadable: new ReadableStream({\n\t\t\t\t\tstart(controller) {\n\t\t\t\t\t\tbarews.addEventListener(\"message\", async (ev: MessageEvent) => {\n\t\t\t\t\t\t\tlet payload = ev.data;\n\t\t\t\t\t\t\tif (typeof payload === \"string\") {\n\t\t\t\t\t\t\t\t// DO NOTHING\n\t\t\t\t\t\t\t} else if (\"byteLength\" in payload) {\n\t\t\t\t\t\t\t\t// arraybuffer, set the realms prototype so its recognized\n\t\t\t\t\t\t\t\tObject.setPrototypeOf(payload, ArrayBuffer.prototype);\n\t\t\t\t\t\t\t} else if (\"arrayBuffer\" in payload) {\n\t\t\t\t\t\t\t\t// blob, convert to arraybuffer\n\t\t\t\t\t\t\t\tpayload = await payload.arrayBuffer();\n\t\t\t\t\t\t\t\tObject.setPrototypeOf(payload, ArrayBuffer.prototype);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcontroller.enqueue(payload);\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\twritable: new WritableStream({\n\t\t\t\t\twrite(chunk) {\n\t\t\t\t\t\tbarews.send(chunk);\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t};\n\t\t\tbarews.addEventListener(\"open\", () => {\n\t\t\t\topenResolver({\n\t\t\t\t\treadable: state.readable,\n\t\t\t\t\twritable: state.writable,\n\t\t\t\t\textensions: state.extensions,\n\t\t\t\t\tprotocol: state.protocol,\n\t\t\t\t});\n\t\t\t});\n\t\t\tbarews.addEventListener(\"close\", (ev: CloseEvent) => {\n\t\t\t\tcloseResolver({ code: ev.code, reason: ev.reason });\n\t\t\t});\n\n\t\t\tbarews.addEventListener(\"error\", (ev: Event) => {\n\t\t\t\topenRejector(ev);\n\t\t\t});\n\n\t\t\tsocketstreammap.set(fakeWebSocket, state);\n\t\t\tctx.return(fakeWebSocket);\n\t\t},\n\t});\n\n\tclient.Trap(\"WebSocketStream.prototype.closed\", {\n\t\tget(ctx) {\n\t\t\tconst ws = socketstreammap.get(ctx.this);\n\n\t\t\treturn ws.closed;\n\t\t},\n\t});\n\n\tclient.Trap(\"WebSocketStream.prototype.opened\", {\n\t\tget(ctx) {\n\t\t\tconst ws = socketstreammap.get(ctx.this);\n\n\t\t\treturn ws.opened;\n\t\t},\n\t});\n\n\tclient.Trap(\"WebSocketStream.prototype.url\", {\n\t\tget(ctx) {\n\t\t\tconst ws = socketstreammap.get(ctx.this);\n\n\t\t\treturn ws.url;\n\t\t},\n\t});\n\n\tclient.Proxy(\"WebSocketStream.prototype.close\", {\n\t\tapply(ctx) {\n\t\t\tconst ws = socketstreammap.get(ctx.this);\n\t\t\tif (ctx.args[0]) {\n\t\t\t\tif (ctx.args[0].closeCode === undefined) ctx.args[0].closeCode = 1000;\n\t\t\t\tif (ctx.args[0].reason === undefined) ctx.args[0].reason = \"\";\n\n\t\t\t\treturn ctx.return(\n\t\t\t\t\tws.barews.close(ctx.args[0].closeCode, ctx.args[0].reason)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn ctx.return(ws.barews.close(1000, \"\"));\n\t\t},\n\t});\n}\n","import { config, flagEnabled } from \"@/shared\";\nimport { rewriteUrl, unrewriteUrl } from \"@rewriters/url\";\nimport { ScramjetClient } from \"@client/index\";\n\nexport default function (client: ScramjetClient, self: Self) {\n\tlet worker;\n\tif (self.Worker && flagEnabled(\"syncxhr\", client.url)) {\n\t\tworker = client.natives.construct(\"Worker\", config.files.sync);\n\t}\n\tconst ARGS = Symbol(\"xhr original args\");\n\tconst HEADERS = Symbol(\"xhr headers\");\n\n\tclient.Proxy(\"XMLHttpRequest.prototype.open\", {\n\t\tapply(ctx) {\n\t\t\tif (ctx.args[1]) ctx.args[1] = rewriteUrl(ctx.args[1], client.meta);\n\t\t\tif (ctx.args[2] === undefined) ctx.args[2] = true;\n\t\t\tctx.this[ARGS] = ctx.args;\n\t\t},\n\t});\n\n\tclient.Proxy(\"XMLHttpRequest.prototype.setRequestHeader\", {\n\t\tapply(ctx) {\n\t\t\tconst headers = ctx.this[HEADERS] || (ctx.this[HEADERS] = {});\n\t\t\theaders[ctx.args[0]] = ctx.args[1];\n\t\t},\n\t});\n\n\tclient.Proxy(\"XMLHttpRequest.prototype.send\", {\n\t\tapply(ctx) {\n\t\t\tconst args = ctx.this[ARGS];\n\t\t\tif (!args || args[2]) return;\n\n\t\t\tif (!flagEnabled(\"syncxhr\", client.url)) {\n\t\t\t\tconsole.warn(\"ignoring request - sync xhr disabled in flags\");\n\n\t\t\t\treturn ctx.return(undefined);\n\t\t\t}\n\n\t\t\t// it's a sync request\n\t\t\t// sync xhr to service worker is not supported\n\t\t\t// there's a nice way of polyfilling this though, we can spin on an atomic using sharedarraybuffer. this will maintain the sync behavior\n\n\t\t\t//@ts-ignore\n\t\t\tconst sab = new SharedArrayBuffer(1024, { maxByteLength: 2147483647 });\n\t\t\tconst view = new DataView(sab);\n\n\t\t\tclient.natives.call(\"Worker.prototype.postMessage\", worker, {\n\t\t\t\tsab,\n\t\t\t\targs,\n\t\t\t\theaders: ctx.this[HEADERS],\n\t\t\t\tbody: ctx.args[0],\n\t\t\t});\n\n\t\t\tconst now = performance.now();\n\t\t\twhile (view.getUint8(0) === 0) {\n\t\t\t\tif (performance.now() - now > 1000) {\n\t\t\t\t\tthrow new Error(\"xhr timeout\");\n\t\t\t\t}\n\t\t\t\t/* spin */\n\t\t\t}\n\n\t\t\tconst status = view.getUint16(1);\n\t\t\tconst headersLength = view.getUint32(3);\n\n\t\t\tconst headersab = new Uint8Array(headersLength);\n\t\t\theadersab.set(new Uint8Array(sab.slice(7, 7 + headersLength)));\n\t\t\tconst headers = new TextDecoder().decode(headersab);\n\n\t\t\tconst bodyLength = view.getUint32(7 + headersLength);\n\t\t\tconst bodyab = new Uint8Array(bodyLength);\n\t\t\tbodyab.set(\n\t\t\t\tnew Uint8Array(\n\t\t\t\t\tsab.slice(11 + headersLength, 11 + headersLength + bodyLength)\n\t\t\t\t)\n\t\t\t);\n\t\t\tconst body = new TextDecoder().decode(bodyab);\n\n\t\t\t// these should be using proxies to not leak scram strings but who cares\n\t\t\tclient.RawTrap(ctx.this, \"status\", {\n\t\t\t\tget() {\n\t\t\t\t\treturn status;\n\t\t\t\t},\n\t\t\t});\n\t\t\tclient.RawTrap(ctx.this, \"responseText\", {\n\t\t\t\tget() {\n\t\t\t\t\treturn body;\n\t\t\t\t},\n\t\t\t});\n\t\t\tclient.RawTrap(ctx.this, \"response\", {\n\t\t\t\tget() {\n\t\t\t\t\tif (ctx.this.responseType === \"arraybuffer\") return bodyab.buffer;\n\n\t\t\t\t\treturn body;\n\t\t\t\t},\n\t\t\t});\n\t\t\tclient.RawTrap(ctx.this, \"responseXML\", {\n\t\t\t\tget() {\n\t\t\t\t\tconst parser = new DOMParser();\n\n\t\t\t\t\treturn parser.parseFromString(body, \"text/xml\");\n\t\t\t\t},\n\t\t\t});\n\t\t\tclient.RawTrap(ctx.this, \"getAllResponseHeaders\", {\n\t\t\t\tget() {\n\t\t\t\t\treturn () => headers;\n\t\t\t\t},\n\t\t\t});\n\t\t\tclient.RawTrap(ctx.this, \"getResponseHeader\", {\n\t\t\t\tget() {\n\t\t\t\t\treturn (header: string) => {\n\t\t\t\t\t\tconst re = new RegExp(`^${header}: (.*)$`, \"m\");\n\t\t\t\t\t\tconst match = re.exec(headers);\n\n\t\t\t\t\t\treturn match ? match[1] : null;\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t});\n\n\t\t\t// send has no return value right\n\t\t\tctx.return(undefined);\n\t\t},\n\t});\n\n\tclient.Trap(\"XMLHttpRequest.prototype.responseURL\", {\n\t\tget(ctx) {\n\t\t\treturn unrewriteUrl(ctx.get() as string);\n\t\t},\n\t});\n}\n","import { rewriteJs } from \"@rewriters/js\";\nimport { ScramjetClient } from \"@client/index\";\n\nexport default function (client: ScramjetClient, self: Self) {\n\tclient.Proxy([\"setTimeout\", \"setInterval\"], {\n\t\tapply(ctx) {\n\t\t\tif (ctx.args.length > 0 && typeof ctx.args[0] === \"string\") {\n\t\t\t\tctx.args[0] = rewriteJs(\n\t\t\t\t\tctx.args[0],\n\t\t\t\t\t\"(setTimeout string eval)\",\n\t\t\t\t\tclient.meta\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t});\n}\n","import { config, flagEnabled } from \"@/shared\";\nimport { SCRAMJETCLIENT, SCRAMJETCLIENTNAME } from \"@/symbols\";\nimport { ProxyCtx, ScramjetClient } from \"@client/index\";\n\nenum RewriteType {\n\tInsert = 0,\n\tReplace = 1,\n}\n\ntype Rewrite = {\n\tstart: number;\n} & (\n\t| {\n\t\t\ttype: RewriteType.Insert;\n\t\t\tsize: number;\n\t }\n\t| {\n\t\t\ttype: RewriteType.Replace;\n\t\t\tend: number;\n\t\t\tstr: string;\n\t }\n);\n\nexport type SourceMaps = Record<string, Rewrite[]>;\n\nfunction getEnd(rewrite: Rewrite): number {\n\tif (rewrite.type === RewriteType.Insert) {\n\t\treturn rewrite.start + rewrite.size;\n\t} else if (rewrite.type === RewriteType.Replace) {\n\t\treturn rewrite.end;\n\t}\n\tthrow \"unreachable\";\n}\n\nfunction registerRewrites(\n\tclient: ScramjetClient,\n\tbuf: Array<number>,\n\ttag: string\n) {\n\tconst sourcemap = Uint8Array.from(buf);\n\tconst view = new DataView(sourcemap.buffer);\n\tconst decoder = new TextDecoder(\"utf-8\");\n\n\tconst rewrites: Rewrite[] = [];\n\n\tconst rewritelen = view.getUint32(0, true);\n\tlet cursor = 4;\n\tfor (let i = 0; i < rewritelen; i++) {\n\t\tconst start = view.getUint32(cursor, true);\n\t\tcursor += 4;\n\t\tconst size = view.getUint32(cursor, true);\n\t\tcursor += 4;\n\n\t\tconst type = view.getUint8(cursor) as RewriteType;\n\t\tcursor += 1;\n\n\t\tif (type == RewriteType.Insert) {\n\t\t\trewrites.push({ type, start, size });\n\t\t} else if (type == RewriteType.Replace) {\n\t\t\tconst end = start + size;\n\n\t\t\tconst oldLen = view.getUint32(cursor, true);\n\t\t\tcursor += 4;\n\n\t\t\tconst oldStr = decoder.decode(\n\t\t\t\tsourcemap.subarray(cursor, cursor + oldLen)\n\t\t\t);\n\n\t\t\trewrites.push({ type, start, end, str: oldStr });\n\t\t}\n\t}\n\n\tclient.box.sourcemaps[tag] = rewrites;\n}\n\nconst SCRAMTAG = \"/*scramtag \";\n\nfunction extractTag(fn: string): [string, number, number] | null {\n\t// every function rewritten will have a scramtag comment\n\t// it will look like this:\n\t// function name()[possible whitespace]/*scramtag [index] [tag]*/[possible whitespace]{ ... }\n\n\tlet start = fn.indexOf(SCRAMTAG);\n\t// no scramtag, probably native function or stolen from scramjet\n\tif (start === -1) return null;\n\n\tconst end = fn.indexOf(\"*/\", start);\n\tif (end === -1) {\n\t\tconsole.log(fn, start, end);\n\t\tthrow new Error(\"unreachable\");\n\t}\n\n\tlet tag = fn.substring(start + 2, end).split(\" \");\n\n\tif (\n\t\ttag.length !== 3 ||\n\t\ttag[0] !== \"scramtag\" ||\n\t\t!Number.isSafeInteger(+tag[1])\n\t) {\n\t\tconsole.log(fn, start, end, tag);\n\t\tthrow new Error(\"invalid tag\");\n\t}\n\n\treturn [tag[2], start, +tag[1]];\n}\n\nfunction doUnrewrite(client: ScramjetClient, ctx: ProxyCtx) {\n\tconst stringified: string = ctx.fn.call(ctx.this);\n\n\tconst extracted = extractTag(stringified);\n\tif (!extracted) return ctx.return(stringified);\n\tconst [tag, tagOffset, tagStart] = extracted;\n\n\tconst fnStart = tagStart - tagOffset;\n\tconst fnEnd = fnStart + stringified.length;\n\tconst rewrites = client.box.sourcemaps[tag];\n\n\tif (!rewrites) {\n\t\tconsole.warn(\"failed to get rewrites for tag\", tag);\n\n\t\treturn ctx.return(stringified);\n\t}\n\n\tlet i = 0;\n\t// skip all rewrites in the file before the fn\n\twhile (i < rewrites.length) {\n\t\tif (rewrites[i].start < fnStart) i++;\n\t\telse break;\n\t}\n\n\tlet end = i;\n\twhile (end < rewrites.length) {\n\t\tif (getEnd(rewrites[end]) < fnEnd) end++;\n\t\telse break;\n\t}\n\tconst fnrewrites = rewrites.slice(i, end);\n\n\tlet newString = \"\";\n\tlet lastpos = 0;\n\n\tfor (const rewrite of fnrewrites) {\n\t\tnewString += stringified.slice(lastpos, rewrite.start - fnStart);\n\n\t\tif (rewrite.type === RewriteType.Insert) {\n\t\t\tlastpos = rewrite.start + rewrite.size - fnStart;\n\t\t} else if (rewrite.type === RewriteType.Replace) {\n\t\t\tnewString += rewrite.str;\n\t\t\tlastpos = rewrite.end - fnStart;\n\t\t} else {\n\t\t\tthrow \"unreachable\";\n\t\t}\n\t}\n\n\tnewString += stringified.slice(lastpos);\n\tnewString = newString.replace(`${SCRAMTAG}${tagStart} ${tag}*/`, \"\");\n\n\treturn ctx.return(newString);\n}\n\nexport const enabled = (client: ScramjetClient) =>\n\tflagEnabled(\"sourcemaps\", client.url);\n\nexport default function (client: ScramjetClient, self: Self) {\n\t// every script will push a sourcemap\n\tObject.defineProperty(self, config.globals.pushsourcemapfn, {\n\t\tvalue: (buf: Array<number>, tag: string) => {\n\t\t\tconst before = performance.now();\n\t\t\tregisterRewrites(client, buf, tag);\n\t\t\tdbg.time(client.meta, before, `scramtag parse for ${tag}`);\n\t\t},\n\t\tenumerable: false,\n\t\twritable: false,\n\t\tconfigurable: false,\n\t});\n\n\t// when we rewrite javascript it will make function.toString leak internals\n\t// this can lead to double rewrites which is bad\n\tclient.Proxy(\"Function.prototype.toString\", {\n\t\tapply(ctx) {\n\t\t\tconst before = performance.now();\n\t\t\tdoUnrewrite(client, ctx);\n\t\t\t// dbg.time(client.meta, before, `scramtag unrewrite for ${ctx.fn.name}`);\n\t\t},\n\t});\n}\n","import { BareMuxConnection } from \"@mercuryworkshop/bare-mux\";\nimport { rewriteUrl } from \"@rewriters/url\";\nimport { ScramjetClient } from \"@client/index\";\n\nexport default function (client: ScramjetClient, _self: typeof globalThis) {\n\tclient.Proxy(\"Worker\", {\n\t\tconstruct(ctx) {\n\t\t\tctx.args[0] = rewriteUrl(ctx.args[0], client.meta) + \"?dest=worker\";\n\n\t\t\tif (ctx.args[1] && ctx.args[1].type === \"module\") {\n\t\t\t\tctx.args[0] += \"&type=module\";\n\t\t\t}\n\n\t\t\tconst worker = ctx.call();\n\t\t\tconst conn = new BareMuxConnection();\n\n\t\t\t(async () => {\n\t\t\t\tconst port = await conn.getInnerPort();\n\t\t\t\tclient.natives.call(\n\t\t\t\t\t\"Worker.prototype.postMessage\",\n\t\t\t\t\tworker,\n\t\t\t\t\t{\n\t\t\t\t\t\t$scramjet$type: \"baremuxinit\",\n\t\t\t\t\t\tport,\n\t\t\t\t\t},\n\t\t\t\t\t[port]\n\t\t\t\t);\n\t\t\t})();\n\t\t},\n\t});\n\n\t// sharedworkers can only be constructed from window\n\tclient.Proxy(\"SharedWorker\", {\n\t\tconstruct(ctx) {\n\t\t\tctx.args[0] = rewriteUrl(ctx.args[0], client.meta) + \"?dest=sharedworker\";\n\n\t\t\tif (ctx.args[1] && typeof ctx.args[1] === \"string\")\n\t\t\t\tctx.args[1] = `${client.url.origin}@${ctx.args[1]}`;\n\n\t\t\tif (ctx.args[1] && typeof ctx.args[1] === \"object\") {\n\t\t\t\tif (ctx.args[1].type === \"module\") {\n\t\t\t\t\tctx.args[0] += \"&type=module\";\n\t\t\t\t}\n\n\t\t\t\tif (ctx.args[1].name) {\n\t\t\t\t\tctx.args[1].name = `${client.url.origin}@${ctx.args[1].name}`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst worker = ctx.call();\n\t\t\tconst conn = new BareMuxConnection();\n\n\t\t\t(async () => {\n\t\t\t\tconst port = await conn.getInnerPort();\n\t\t\t\tclient.natives.call(\n\t\t\t\t\t\"MessagePort.prototype.postMessage\",\n\t\t\t\t\tworker.port,\n\t\t\t\t\t{\n\t\t\t\t\t\t$scramjet$type: \"baremuxinit\",\n\t\t\t\t\t\tport,\n\t\t\t\t\t},\n\t\t\t\t\t[port]\n\t\t\t\t);\n\t\t\t})();\n\t\t},\n\t});\n\n\tclient.Proxy(\"Worklet.prototype.addModule\", {\n\t\tapply(ctx) {\n\t\t\tif (ctx.args[0])\n\t\t\t\tctx.args[0] = rewriteUrl(ctx.args[0], client.meta) + \"?dest=worklet\";\n\t\t},\n\t});\n}\n","import { iswindow } from \"@client/entry\";\nimport { SCRAMJETCLIENT } from \"@/symbols\";\nimport { ScramjetClient } from \"@client/index\";\nimport { config } from \"@/shared\";\n// import { argdbg } from \"@client/shared/err\";\nimport { indirectEval } from \"@client/shared/eval\";\n\nexport function createWrapFn(client: ScramjetClient, self: typeof globalThis) {\n\treturn function (identifier: any, strict: boolean) {\n\t\tif (identifier === self.location) return client.locationProxy;\n\t\tif (identifier === self.eval) return indirectEval.bind(client, strict);\n\n\t\tif (iswindow) {\n\t\t\tif (identifier === self.parent) {\n\t\t\t\tif (SCRAMJETCLIENT in self.parent) {\n\t\t\t\t\t// ... then we're in a subframe, and the parent frame is also in a proxy context, so we should return its proxy\n\t\t\t\t\treturn self.parent;\n\t\t\t\t} else {\n\t\t\t\t\t// ... then we should pretend we aren't nested and return the current window\n\t\t\t\t\treturn self;\n\t\t\t\t}\n\t\t\t} else if (identifier === self.top) {\n\t\t\t\t// instead of returning top, we need to return the uppermost parent that's inside a scramjet context\n\t\t\t\tlet current = self;\n\n\t\t\t\tfor (;;) {\n\t\t\t\t\tconst test = current.parent.self;\n\t\t\t\t\tif (test === current) break; // there is no parent, actual or emulated.\n\n\t\t\t\t\t// ... then `test` represents a window outside of the proxy context, and therefore `current` is the topmost window in the proxy context\n\t\t\t\t\tif (!(SCRAMJETCLIENT in test)) break;\n\n\t\t\t\t\t// test is also insde a proxy, so we should continue up the chain\n\t\t\t\t\tcurrent = test;\n\t\t\t\t}\n\n\t\t\t\treturn current;\n\t\t\t}\n\t\t}\n\n\t\treturn identifier;\n\t};\n}\n\nexport const order = 4;\nexport default function (client: ScramjetClient, self: typeof globalThis) {\n\tObject.defineProperty(self, config.globals.wrapfn, {\n\t\tvalue: client.wrapfn,\n\t\twritable: false,\n\t\tconfigurable: false,\n\t\tenumerable: false,\n\t});\n\tObject.defineProperty(self, config.globals.wrappropertyfn, {\n\t\tvalue: function (str) {\n\t\t\tif (\n\t\t\t\tstr === \"location\" ||\n\t\t\t\tstr === \"parent\" ||\n\t\t\t\tstr === \"top\" ||\n\t\t\t\tstr === \"eval\"\n\t\t\t)\n\t\t\t\treturn config.globals.wrappropertybase + str;\n\n\t\t\treturn str;\n\t\t},\n\t\twritable: false,\n\t\tconfigurable: false,\n\t\tenumerable: false,\n\t});\n\tObject.defineProperty(self, config.globals.cleanrestfn, {\n\t\tvalue: function (obj) {\n\t\t\t// TODO\n\t\t},\n\t\twritable: false,\n\t\tconfigurable: false,\n\t\tenumerable: false,\n\t});\n\n\tObject.defineProperty(\n\t\tself.Object.prototype,\n\t\tconfig.globals.wrappropertybase + \"location\",\n\t\t{\n\t\t\tget: function () {\n\t\t\t\t// if (this.location.constructor.toString().includes(\"Location\")) {\n\n\t\t\t\tif (this === self || this === self.document) {\n\t\t\t\t\treturn client.locationProxy;\n\t\t\t\t}\n\n\t\t\t\treturn this.location;\n\t\t\t},\n\t\t\tset(value: any) {\n\t\t\t\tif (this === self || this === self.document) {\n\t\t\t\t\tclient.url = value;\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.location = value;\n\t\t\t},\n\t\t\tconfigurable: false,\n\t\t\tenumerable: false,\n\t\t}\n\t);\n\tObject.defineProperty(\n\t\tself.Object.prototype,\n\t\tconfig.globals.wrappropertybase + \"parent\",\n\t\t{\n\t\t\tget: function () {\n\t\t\t\treturn client.wrapfn(this.parent, false);\n\t\t\t},\n\t\t\tset(value: any) {\n\t\t\t\t// i guess??\n\t\t\t\tthis.parent = value;\n\t\t\t},\n\t\t\tconfigurable: false,\n\t\t\tenumerable: false,\n\t\t}\n\t);\n\tObject.defineProperty(\n\t\tself.Object.prototype,\n\t\tconfig.globals.wrappropertybase + \"top\",\n\t\t{\n\t\t\tget: function () {\n\t\t\t\treturn client.wrapfn(this.top, false);\n\t\t\t},\n\t\t\tset(value: any) {\n\t\t\t\tthis.top = value;\n\t\t\t},\n\t\t\tconfigurable: false,\n\t\t\tenumerable: false,\n\t\t}\n\t);\n\tObject.defineProperty(\n\t\tself.Object.prototype,\n\t\tconfig.globals.wrappropertybase + \"eval\",\n\t\t{\n\t\t\tget: function () {\n\t\t\t\treturn client.wrapfn(this.eval, true);\n\t\t\t},\n\t\t\tset(value: any) {\n\t\t\t\tthis.eval = value;\n\t\t\t},\n\t\t\tconfigurable: false,\n\t\t\tenumerable: false,\n\t\t}\n\t);\n\n\tself.$scramitize = function (v) {\n\t\tif (v === location) debugger;\n\t\tif (iswindow) {\n\t\t\t// if (v === self.parent) debugger;\n\t\t\tif (v === self.top) debugger;\n\t\t}\n\n\t\tif (typeof v === \"string\" && v.includes(\"scramjet\")) debugger;\n\t\tif (typeof v === \"string\" && v.includes(location.origin)) debugger;\n\n\t\treturn v;\n\t};\n\n\t// location = \"...\" can't be rewritten as wrapfn(location) = ..., so instead it will actually be rewritten as\n\t// ((t)=>$scramjet$tryset(location,\"+=\",t)||location+=t)(...);\n\t// it has to be a discrete function because there's always the possibility that \"location\" is a local variable\n\t// we have to use an IIFE to avoid duplicating side-effects in the getter\n\tObject.defineProperty(self, config.globals.trysetfn, {\n\t\tvalue: function (lhs: any, op: string, rhs: any) {\n\t\t\t// TODO: not cross frame safe\n\t\t\tif (lhs instanceof self.Location) {\n\t\t\t\t// @ts-ignore\n\t\t\t\tclient.locationProxy.href = rhs;\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t},\n\t\twritable: false,\n\t\tconfigurable: false,\n\t});\n}\n","import { ScramjetClient } from \"./client\";\nimport { SourceMaps } from \"./shared/sourcemaps\";\n\nexport class SingletonBox {\n\tclients: ScramjetClient[] = [];\n\tglobals: Map<Self, ScramjetClient> = new Map();\n\tdocuments: Map<Document, ScramjetClient> = new Map();\n\tlocations: Map<Location, ScramjetClient> = new Map();\n\n\tsourcemaps: SourceMaps = {};\n\n\tconstructor(public ownerclient: ScramjetClient) {}\n\n\tregisterClient(client: ScramjetClient, global: Self) {\n\t\tthis.clients.push(client);\n\t\tthis.globals.set(global, client);\n\t\tthis.documents.set(global.document, client);\n\t\tthis.locations.set(global.location, client);\n\t}\n}\n","import { unrewriteUrl } from \"@rewriters/url\";\nimport { ScramjetClient } from \"@client/index\";\n\nexport class ScramjetServiceWorkerRuntime {\n\trecvport: MessagePort;\n\tconstructor(public client: ScramjetClient) {\n\t\t// @ts-ignore\n\t\tself.onconnect = (cevent: MessageEvent) => {\n\t\t\tconst port = cevent.ports[0];\n\t\t\tdbg.log(\"sw\", \"connected\");\n\n\t\t\tport.addEventListener(\"message\", (event) => {\n\t\t\t\tconsole.log(\"sw\", event.data);\n\t\t\t\tif (\"scramjet$type\" in event.data) {\n\t\t\t\t\tif (event.data.scramjet$type === \"init\") {\n\t\t\t\t\t\tthis.recvport = event.data.scramjet$port;\n\t\t\t\t\t\tthis.recvport.postMessage({ scramjet$type: \"init\" });\n\t\t\t\t\t} else {\n\t\t\t\t\t\thandleMessage.call(this, client, event.data);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tport.start();\n\t\t};\n\t}\n\n\thook() {\n\t\t// @ts-ignore\n\t\tthis.client.global.registration = {\n\t\t\t// TODO IMPLEMENT SCOPES\n\t\t\tscope: this.client.url.href,\n\t\t\tactive: {\n\t\t\t\tscriptURL: this.client.url.href,\n\t\t\t\tstate: \"activated\",\n\t\t\t\tonstatechange: null,\n\t\t\t\tonerror: null,\n\n\t\t\t\tpostMessage: () => {},\n\t\t\t\taddEventListener: () => {},\n\t\t\t\tremoveEventListener: () => {},\n\t\t\t\tdispatchEvent: (_e: Event): boolean => {\n\t\t\t\t\treturn false;\n\t\t\t\t},\n\t\t\t},\n\t\t\tshowNotification: async () => {},\n\t\t\tunregister: async () => true,\n\t\t\t//@ts-ignore\n\t\t\tupdate: async () => {},\n\t\t\tinstalling: null,\n\t\t\twaiting: null,\n\t\t};\n\n\t\t// @ts-ignore\n\t\tthis.client.global.ServiceWorkerGlobalScope = this.client.global;\n\t}\n}\n\nfunction handleMessage(\n\tthis: ScramjetServiceWorkerRuntime,\n\tclient: ScramjetClient,\n\tdata: MessageW2R\n) {\n\tconst port = this.recvport;\n\tconst type = data.scramjet$type;\n\tconst token = data.scramjet$token;\n\tconst handlers = client.eventcallbacks.get(self);\n\n\tif (type === \"fetch\") {\n\t\tdbg.log(\"ee\", data);\n\t\tconst fetchhandlers = handlers.filter((event) => event.event === \"fetch\");\n\t\tif (!fetchhandlers) return;\n\n\t\tfor (const handler of fetchhandlers) {\n\t\t\tconst request = data.scramjet$request;\n\n\t\t\tconst Request = client.natives[\"Request\"];\n\t\t\tconst fakeRequest = new Request(unrewriteUrl(request.url), {\n\t\t\t\tbody: request.body,\n\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\tmethod: request.method,\n\t\t\t\tmode: \"same-origin\",\n\t\t\t});\n\n\t\t\tObject.defineProperty(fakeRequest, \"destination\", {\n\t\t\t\tvalue: request.destinitation,\n\t\t\t});\n\n\t\t\t// TODO: clean up, maybe put into a class\n\t\t\tconst fakeFetchEvent: any = new Event(\"fetch\");\n\t\t\tfakeFetchEvent.request = fakeRequest;\n\t\t\tlet responded = false;\n\t\t\tfakeFetchEvent.respondWith = (response: Response | Promise<Response>) => {\n\t\t\t\tresponded = true;\n\t\t\t\t(async () => {\n\t\t\t\t\tresponse = await response;\n\t\t\t\t\tconst message: MessageR2W = {\n\t\t\t\t\t\tscramjet$type: \"fetch\",\n\t\t\t\t\t\tscramjet$token: token,\n\t\t\t\t\t\tscramjet$response: {\n\t\t\t\t\t\t\tbody: response.body,\n\t\t\t\t\t\t\theaders: Array.from(response.headers.entries()),\n\t\t\t\t\t\t\tstatus: response.status,\n\t\t\t\t\t\t\tstatusText: response.statusText,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\n\t\t\t\t\tdbg.log(\"sw\", \"responding\", message);\n\t\t\t\t\tport.postMessage(message, [response.body]);\n\t\t\t\t})();\n\t\t\t};\n\n\t\t\tdbg.log(\"to fn\", fakeFetchEvent);\n\t\t\thandler.proxiedCallback(trustEvent(fakeFetchEvent));\n\t\t\tif (!responded) {\n\t\t\t\tconsole.log(\"sw\", \"no response\");\n\t\t\t\tport.postMessage({\n\t\t\t\t\tscramjet$type: \"fetch\",\n\t\t\t\t\tscramjet$token: token,\n\t\t\t\t\tscramjet$response: false,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction trustEvent(event: Event): Event {\n\treturn new Proxy(event, {\n\t\tget(target, prop, _reciever) {\n\t\t\tif (prop === \"isTrusted\") return true;\n\n\t\t\treturn Reflect.get(target, prop);\n\t\t},\n\t});\n}\n\nexport type TransferrableResponse = {\n\tbody: ReadableStream;\n\theaders: [string, string][];\n\tstatus: number;\n\tstatusText: string;\n};\n\nexport type TransferrableRequest = {\n\tbody: ReadableStream;\n\theaders: [string, string][];\n\tdestinitation: RequestDestination;\n\tmethod: Request[\"method\"];\n\tmode: Request[\"mode\"];\n\turl: string;\n};\n\ntype FetchResponseMessage = {\n\tscramjet$type: \"fetch\";\n\tscramjet$response: TransferrableResponse;\n};\n\ntype FetchRequestMessage = {\n\tscramjet$type: \"fetch\";\n\tscramjet$request: TransferrableRequest;\n};\n\n// r2w = runtime to (service) worker\n\ntype MessageTypeR2W = FetchResponseMessage;\ntype MessageTypeW2R = FetchRequestMessage;\n\ntype MessageCommon = {\n\tscramjet$type: string;\n\tscramjet$token: number;\n};\n\nexport type MessageR2W = MessageCommon & MessageTypeR2W;\nexport type MessageW2R = MessageCommon &\n\tMessageTypeW2R & { scramjet$port?: MessagePort };\n","import { rewriteUrl } from \"../../shared/rewriters/url\";\nimport { ScramjetClient } from \"@client/index\";\n\nexport default function (client: ScramjetClient) {\n\tclient.Proxy(\"importScripts\", {\n\t\tapply(ctx) {\n\t\t\tfor (const i in ctx.args) {\n\t\t\t\tctx.args[i] = rewriteUrl(ctx.args[i], client.meta);\n\t\t\t}\n\t\t},\n\t});\n}\n","import {\n\tcodecDecode,\n\tcodecEncode,\n\tconfig,\n\tloadCodecs,\n\tsetConfig,\n} from \"@/shared/index\";\nimport { ScramjetConfig, ScramjetInitConfig, ScramjetDB } from \"@/types\";\nimport { ScramjetFrame } from \"@/controller/frame\";\nimport { MessageW2C } from \"@/worker\";\nimport { openDB, IDBPDatabase } from \"idb\";\nimport {\n\tScramjetEvents,\n\tScramjetGlobalDownloadEvent,\n\tScramjetGlobalEvent,\n\tScramjetGlobalEvents,\n} from \"@client/events\";\n\nexport class ScramjetController extends EventTarget {\n\tprivate db: IDBPDatabase<ScramjetDB>;\n\n\tconstructor(config: Partial<ScramjetInitConfig>) {\n\t\tsuper();\n\t\t// sane ish defaults\n\t\tconst defaultConfig: ScramjetInitConfig = {\n\t\t\t// wisp: \"/wisp/\",\n\t\t\tprefix: \"/scramjet/\",\n\t\t\tglobals: {\n\t\t\t\twrapfn: \"$scramjet$wrap\",\n\t\t\t\twrappropertybase: \"$scramjet__\",\n\t\t\t\twrappropertyfn: \"$scramjet$prop\",\n\t\t\t\tcleanrestfn: \"$scramjet$clean\",\n\t\t\t\timportfn: \"$scramjet$import\",\n\t\t\t\trewritefn: \"$scramjet$rewrite\",\n\t\t\t\tmetafn: \"$scramjet$meta\",\n\t\t\t\tsetrealmfn: \"$scramjet$setrealm\",\n\t\t\t\tpushsourcemapfn: \"$scramjet$pushsourcemap\",\n\t\t\t\ttrysetfn: \"$scramjet$tryset\",\n\t\t\t\ttemplocid: \"$scramjet$temploc\",\n\t\t\t\ttempunusedid: \"$scramjet$tempunused\",\n\t\t\t},\n\t\t\tfiles: {\n\t\t\t\twasm: \"/scramjet.wasm.wasm\",\n\t\t\t\tall: \"/scramjet.all.js\",\n\t\t\t\tsync: \"/scramjet.sync.js\",\n\t\t\t},\n\t\t\tflags: {\n\t\t\t\tserviceworkers: false,\n\t\t\t\tsyncxhr: false,\n\t\t\t\tstrictRewrites: true,\n\t\t\t\trewriterLogs: false,\n\t\t\t\tcaptureErrors: true,\n\t\t\t\tcleanErrors: false,\n\t\t\t\tscramitize: false,\n\t\t\t\tsourcemaps: true,\n\t\t\t\tdestructureRewrites: false,\n\t\t\t\tinterceptDownloads: false,\n\t\t\t\tallowInvalidJs: true,\n\t\t\t\tallowFailedIntercepts: true,\n\t\t\t},\n\t\t\tsiteFlags: {},\n\t\t\tcodec: {\n\t\t\t\tencode: (url: string) => {\n\t\t\t\t\tif (!url) return url;\n\n\t\t\t\t\treturn encodeURIComponent(url);\n\t\t\t\t},\n\t\t\t\tdecode: (url: string) => {\n\t\t\t\t\tif (!url) return url;\n\n\t\t\t\t\treturn decodeURIComponent(url);\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\n\t\tconst deepMerge = (target: any, source: any): any => {\n\t\t\tfor (const key in source) {\n\t\t\t\tif (source[key] instanceof Object && key in target) {\n\t\t\t\t\tObject.assign(source[key], deepMerge(target[key], source[key]));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn Object.assign(target || {}, source);\n\t\t};\n\n\t\tconst newConfig = deepMerge(defaultConfig, config);\n\t\tnewConfig.codec.encode = newConfig.codec.encode.toString();\n\t\tnewConfig.codec.decode = newConfig.codec.decode.toString();\n\t\tsetConfig(newConfig as ScramjetConfig);\n\t}\n\n\tasync init(): Promise<void> {\n\t\tloadCodecs();\n\n\t\tawait this.openIDB();\n\t\tnavigator.serviceWorker.controller?.postMessage({\n\t\t\tscramjet$type: \"loadConfig\",\n\t\t\tconfig,\n\t\t});\n\t\tdbg.log(\"config loaded\");\n\n\t\tnavigator.serviceWorker.addEventListener(\"message\", (e) => {\n\t\t\tif (!(\"scramjet$type\" in e.data)) return;\n\t\t\tconst data: MessageW2C = e.data;\n\n\t\t\tif (data.scramjet$type === \"download\") {\n\t\t\t\tthis.dispatchEvent(new ScramjetGlobalDownloadEvent(data.download));\n\t\t\t}\n\t\t});\n\t}\n\n\tcreateFrame(frame?: HTMLIFrameElement): ScramjetFrame {\n\t\tif (!frame) {\n\t\t\tframe = document.createElement(\"iframe\");\n\t\t}\n\n\t\treturn new ScramjetFrame(this, frame);\n\t}\n\n\tencodeUrl(url: string | URL): string {\n\t\tif (typeof url === \"string\") url = new URL(url);\n\n\t\tif (url.protocol != \"http:\" && url.protocol != \"https:\") {\n\t\t\treturn url.href;\n\t\t}\n\n\t\tconst encodedHash = codecEncode(url.hash.slice(1));\n\t\tconst realHash = encodedHash ? \"#\" + encodedHash : \"\";\n\t\turl.hash = \"\";\n\n\t\treturn config.prefix + codecEncode(url.href) + realHash;\n\t}\n\n\tdecodeUrl(url: string | URL) {\n\t\tif (url instanceof URL) url = url.toString();\n\t\tconst prefixed = location.origin + config.prefix;\n\n\t\treturn codecDecode(url.slice(prefixed.length));\n\t}\n\n\tasync openIDB(): Promise<IDBPDatabase<ScramjetDB>> {\n\t\tconst db = await openDB<ScramjetDB>(\"$scramjet\", 1, {\n\t\t\tupgrade(db) {\n\t\t\t\tif (!db.objectStoreNames.contains(\"config\")) {\n\t\t\t\t\tdb.createObjectStore(\"config\");\n\t\t\t\t}\n\t\t\t\tif (!db.objectStoreNames.contains(\"cookies\")) {\n\t\t\t\t\tdb.createObjectStore(\"cookies\");\n\t\t\t\t}\n\t\t\t\tif (!db.objectStoreNames.contains(\"redirectTrackers\")) {\n\t\t\t\t\tdb.createObjectStore(\"redirectTrackers\");\n\t\t\t\t}\n\t\t\t\tif (!db.objectStoreNames.contains(\"referrerPolicies\")) {\n\t\t\t\t\tdb.createObjectStore(\"referrerPolicies\");\n\t\t\t\t}\n\t\t\t\tif (!db.objectStoreNames.contains(\"publicSuffixList\")) {\n\t\t\t\t\tdb.createObjectStore(\"publicSuffixList\");\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\n\t\tthis.db = db;\n\t\tawait this.#saveConfig();\n\t\treturn db;\n\t}\n\n\tasync #saveConfig() {\n\t\tif (!this.db) {\n\t\t\tconsole.error(\"Store not ready!\");\n\n\t\t\treturn;\n\t\t}\n\t\tawait this.db.put(\"config\", config, \"config\");\n\t}\n\n\tasync modifyConfig(newconfig: Partial<ScramjetInitConfig>) {\n\t\tsetConfig(Object.assign({}, config, newconfig));\n\t\tloadCodecs();\n\n\t\tawait this.#saveConfig();\n\t\tnavigator.serviceWorker.controller?.postMessage({\n\t\t\tscramjet$type: \"loadConfig\",\n\t\t\tconfig,\n\t\t});\n\t}\n\n\taddEventListener<K extends keyof ScramjetGlobalEvents>(\n\t\ttype: K,\n\t\tlistener: (event: ScramjetGlobalEvents[K]) => void,\n\t\toptions?: boolean | AddEventListenerOptions\n\t): void {\n\t\tsuper.addEventListener(type, listener as EventListener, options);\n\t}\n}\n","/**\n * @fileoverview Contains abstractions for using Scrmajet under an iframe.\n */\n\nimport { ScramjetController } from \"@/controller/index\";\nimport type { ScramjetClient } from \"@client/index\";\nimport type { ScramjetEvent, ScramjetEvents } from \"@client/events\";\nimport { SCRAMJETCLIENT, SCRAMJETFRAME } from \"@/symbols\";\nfunction createFrameId() {\n\treturn `${Array(8)\n\t\t.fill(0)\n\t\t.map(() => Math.floor(Math.random() * 36).toString(36))\n\t\t.join(\"\")}`;\n}\n\n/**\n * An abstraction over proxy iframe creation, which lets you manage instances of Scramjet and not have to worry about the proxy internals, since everything you need is already proxified.\n *\n * @example\n * ```typescript\n * const { ScramjetController } = $scramjetLoadController();\n * const scramjet = new ScramjetController({ prefix: \"/scramjet/\" });\n * await scramjet.init();\n *\n * const frame = scramjet.createFrame();\n * document.body.appendChild(frame.frame);\n *\n * // Navigate to a URL\n * frame.go(\"https://example.com\");\n *\n * // Listen for proxified navigation events\n * frame.addEventListener(\"urlchange\", (e) => {\n * console.log(\"URL changed to:\", e.url);\n * });\n *\n * // Go back\n * frame.back();\n * // Go forward\n * frame.forward();\n * // Reload page\n * frame.reload();\n * ```\n */\nexport class ScramjetFrame extends EventTarget {\n\t/**\n\t * Create a ScramjetFrame instance. You likely won't need to interact the {@link ScramjetFrame.constructor | constructor} directly.\n\t * You can instead use {@link ScramjetController.createFrame} on your existing `ScramjetController`.\n\t *\n\t * @param controller The `ScramjetController` instance that manages this frame with.\n\t * @param frame The frame to be controlled for you under Scramjet.\n\t */\n\tconstructor(\n\t\tprivate controller: ScramjetController,\n\t\tpublic frame: HTMLIFrameElement\n\t) {\n\t\tsuper();\n\t\tframe.name = createFrameId();\n\t\tframe[SCRAMJETFRAME] = this;\n\t}\n\n\t/**\n\t * Returns the {@link ScramjetClient} instance running inside the iframe's contentWindow.\n\t *\n\t * @returns The `ScramjetClient` instance.\n\t */\n\tget client(): ScramjetClient {\n\t\treturn this.frame.contentWindow.window[SCRAMJETCLIENT];\n\t}\n\n\t/**\n\t * Returns the proxified URL.\n\t *\n\t * @returns The proxified URL.\n\t */\n\tget url(): URL {\n\t\treturn this.client.url;\n\t}\n\n\t/**\n\t * Navigates the iframe to a new URL under Scramjet.\n\t *\n\t * @example\n\t * ```typescript\n\t * frame.go(\"https://example.net\");\n\t * ```\n\t *\n\t * @param url A real URL to navigate to\n\t */\n\tgo(url: string | URL) {\n\t\tif (url instanceof URL) url = url.toString();\n\n\t\tdbg.log(\"navigated to\", url);\n\n\t\tthis.frame.src = this.controller.encodeUrl(url);\n\t}\n\n\t/**\n\t * Goes backwards in the browser history.\n\t */\n\tback() {\n\t\tthis.frame.contentWindow?.history.back();\n\t}\n\n\t/**\n\t * Goes forward in the browser history.\n\t */\n\tforward() {\n\t\tthis.frame.contentWindow?.history.forward();\n\t}\n\n\t/**\n\t * Reloads the iframe.\n\t */\n\treload() {\n\t\tthis.frame.contentWindow?.location.reload();\n\t}\n\n\t/**\n\t * Binds event listeners to listen for proxified navigation events in Scramjet.\n\t *\n\t * @example\n\t * ```typescript\n\t * // Listen for URL changes\n\t * frame.addEventListener(\"urlchange\", (event) => {\n\t * console.log(\"URL changed:\", event.url);\n\t * document.title = event.url; // Update page title\n\t * });\n\t *\n\t * // Listen for navigation events\n\t * frame.addEventListener(\"navigate\", (event) => {\n\t * console.log(\"Navigating to:\", event.url);\n\t * });\n\t * ```\n\t *\n\t * @param type Type of event to listen for.\n\t * @param listener Event listener to dispatch.\n\t * @param options Options for the event listener.\n\t */\n\taddEventListener<K extends keyof ScramjetEvents>(\n\t\ttype: K,\n\t\tlistener: (event: ScramjetEvents[K]) => void,\n\t\toptions?: boolean | AddEventListenerOptions\n\t): void {\n\t\tsuper.addEventListener(type, listener as EventListener, options);\n\t}\n}\n","export * from \"./frame\";\nexport * from \"./controller\";\nconsole.warn(\n\t\"you are using the last version of scramjet v1, if possible, please upgrade to v2 for better performance and more features\"\n);\n","// import { flagEnabled } from \"@/shared\";\nimport type { URLMeta } from \"@rewriters/url\";\n\nconst logfuncs = {\n\tlog: console.log,\n\twarn: console.warn,\n\terror: console.error,\n\tdebug: console.debug,\n\tinfo: console.info,\n};\n\nexport default {\n\tfmt: function (severity: string, message: string, ...args: any[]) {\n\t\tconst old = Error.prepareStackTrace;\n\n\t\tError.prepareStackTrace = (_, stack) => {\n\t\t\tstack.shift(); // stack();\n\t\t\tstack.shift(); // fmt();\n\t\t\tstack.shift();\n\n\t\t\tlet fmt = \"\";\n\t\t\tfor (let i = 1; i < Math.min(2, stack.length); i++) {\n\t\t\t\tif (stack[i].getFunctionName()) {\n\t\t\t\t\t// const f = stack[i].getThis()?.constructor?.name;\n\t\t\t\t\t// if (f) fmt += `${f}.`\n\t\t\t\t\tfmt += `${stack[i].getFunctionName()} -> ` + fmt;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfmt += stack[0].getFunctionName() || \"Anonymous\";\n\n\t\t\treturn fmt;\n\t\t};\n\n\t\tconst fmt = (function stack() {\n\t\t\ttry {\n\t\t\t\tthrow new Error();\n\t\t\t} catch (e) {\n\t\t\t\treturn e.stack;\n\t\t\t}\n\t\t})();\n\n\t\tError.prepareStackTrace = old;\n\n\t\tthis.print(severity, fmt, message, ...args);\n\t},\n\tprint(severity: string, tag: string, message: string, ...args: any[]) {\n\t\tconst fn = logfuncs[severity] || logfuncs.log;\n\t\tconst bg = {\n\t\t\tlog: \"#000\",\n\t\t\twarn: \"#f80\",\n\t\t\terror: \"#f00\",\n\t\t\tdebug: \"transparent\",\n\t\t}[severity];\n\t\tconst fg = {\n\t\t\tlog: \"#fff\",\n\t\t\twarn: \"#fff\",\n\t\t\terror: \"#fff\",\n\t\t\tdebug: \"gray\",\n\t\t}[severity];\n\t\tconst padding = {\n\t\t\tlog: 2,\n\t\t\twarn: 4,\n\t\t\terror: 4,\n\t\t\tdebug: 0,\n\t\t}[severity];\n\n\t\tfn(\n\t\t\t`%c${tag}%c ${message}`,\n\t\t\t`\n \tbackground-color: ${bg};\n \tcolor: ${fg};\n \tpadding: ${padding}px;\n \tfont-weight: bold;\n \tfont-family: monospace;\n \tfont-size: 0.9em;\n `,\n\t\t\t`${severity === \"debug\" ? \"color: gray\" : \"\"}`,\n\t\t\t...args\n\t\t);\n\t},\n\tlog: function (message: string, ...args: any[]) {\n\t\tthis.fmt(\"log\", message, ...args);\n\t},\n\twarn: function (message: string, ...args: any[]) {\n\t\tthis.fmt(\"warn\", message, ...args);\n\t},\n\terror: function (message: string, ...args: any[]) {\n\t\tthis.fmt(\"error\", message, ...args);\n\t},\n\tdebug: function (message: string, ...args: any[]) {\n\t\tthis.fmt(\"debug\", message, ...args);\n\t},\n\ttime(meta: URLMeta, before: number, type: string) {\n\t\tif (1) return;\n\t\tconst after = performance.now();\n\t\tconst duration = after - before;\n\n\t\tlet timespan: string;\n\t\tif (duration < 1) {\n\t\t\ttimespan = \"BLAZINGLY FAST\";\n\t\t} else if (duration < 500) {\n\t\t\ttimespan = \"decent speed\";\n\t\t} else {\n\t\t\ttimespan = \"really slow\";\n\t\t}\n\t\tthis.print(\n\t\t\t\"debug\",\n\t\t\t\"[time]\",\n\t\t\t`${type} was ${timespan} (${duration.toFixed(2)}ms)`\n\t\t);\n\t},\n};\n","// thnank you node unblocker guy\nimport parse from \"set-cookie-parser\";\n\nexport type Cookie = {\n\tname: string;\n\tvalue: string;\n\tpath?: string;\n\texpires?: string;\n\tmaxAge?: number;\n\tdomain?: string;\n\tsecure?: boolean;\n\thttpOnly?: boolean;\n\tsameSite?: \"strict\" | \"lax\" | \"none\";\n};\n\nexport class CookieStore {\n\tprivate cookies: Record<string, Cookie> = {};\n\n\tsetCookies(cookies: string[], url: URL) {\n\t\tfor (const str of cookies) {\n\t\t\tconst parsed = parse(str);\n\t\t\tconst domain = parsed.domain;\n\t\t\tconst sameSite = parsed.sameSite;\n\t\t\tconst cookie: Cookie = {\n\t\t\t\tdomain,\n\t\t\t\tsameSite,\n\t\t\t\t...parsed[0],\n\t\t\t};\n\n\t\t\tif (!cookie.domain) cookie.domain = \".\" + url.hostname;\n\t\t\tif (!cookie.domain.startsWith(\".\")) cookie.domain = \".\" + cookie.domain;\n\t\t\tif (!cookie.path) cookie.path = \"/\";\n\t\t\tif (!cookie.sameSite) cookie.sameSite = \"lax\";\n\t\t\tif (cookie.expires) cookie.expires = cookie.expires.toString();\n\n\t\t\tconst id = `${cookie.domain}@${cookie.path}@${cookie.name}`;\n\t\t\tthis.cookies[id] = cookie;\n\t\t}\n\t}\n\n\tgetCookies(url: URL, fromJs: boolean): string {\n\t\tconst now = new Date();\n\t\tconst cookies = Object.values(this.cookies);\n\n\t\tconst validCookies: Cookie[] = [];\n\n\t\tfor (const cookie of cookies) {\n\t\t\tif (cookie.expires && new Date(cookie.expires) < now) {\n\t\t\t\tdelete this.cookies[`${cookie.domain}@${cookie.path}@${cookie.name}`];\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (cookie.secure && url.protocol !== \"https:\") continue;\n\t\t\tif (cookie.httpOnly && fromJs) continue;\n\t\t\tif (!url.pathname.startsWith(cookie.path)) continue;\n\n\t\t\tif (cookie.domain.startsWith(\".\")) {\n\t\t\t\tif (!url.hostname.endsWith(cookie.domain.slice(1))) continue;\n\t\t\t}\n\n\t\t\tvalidCookies.push(cookie);\n\t\t}\n\n\t\treturn validCookies\n\t\t\t.map((cookie) => `${cookie.name}=${cookie.value}`)\n\t\t\t.join(\"; \");\n\t}\n\n\tload(cookies: string) {\n\t\tif (typeof cookies === \"object\") return cookies;\n\t\tthis.cookies = JSON.parse(cookies);\n\t}\n\n\tdump(): string {\n\t\treturn JSON.stringify(this.cookies);\n\t}\n}\n","export class ScramjetHeaders {\n\theaders = {};\n\n\tset(key: string, v: string) {\n\t\tthis.headers[key.toLowerCase()] = v;\n\t}\n}\n","import { CookieStore } from \"@/shared/cookie\";\nimport { rewriteCss } from \"@rewriters/css\";\nimport { rewriteHtml, rewriteSrcset } from \"@rewriters/html\";\nimport { rewriteUrl, unrewriteBlob, URLMeta } from \"@rewriters/url\";\n\nexport const htmlRules: {\n\t[key: string]: \"*\" | string[] | ((...any: any[]) => string | null);\n\tfn: (value: string, meta: URLMeta, cookieStore: CookieStore) => string | null;\n}[] = [\n\t{\n\t\tfn: (value: string, meta: URLMeta) => {\n\t\t\treturn rewriteUrl(value, meta);\n\t\t},\n\n\t\t// url rewrites\n\t\tsrc: [\"embed\", \"script\", \"img\", \"frame\", \"source\", \"input\", \"track\"],\n\t\thref: [\"a\", \"link\", \"area\", \"use\", \"image\"],\n\t\tdata: [\"object\"],\n\t\taction: [\"form\"],\n\t\tformaction: [\"button\", \"input\", \"textarea\", \"submit\"],\n\t\tposter: [\"video\"],\n\t\t\"xlink:href\": [\"image\"],\n\t},\n\t{\n\t\tfn: (value: string, meta: URLMeta) => {\n\t\t\tlet url = rewriteUrl(value, meta);\n\t\t\t// if (meta.topFrameName)\n\t\t\t// \turl += `?topFrame=${meta.topFrameName}&parentFrame=${meta.parentFrameName}`;\n\n\t\t\treturn url;\n\t\t},\n\t\tsrc: [\"iframe\"],\n\t},\n\t{\n\t\t// is this a good idea?\n\t\tfn: (value: string, meta: URLMeta) => {\n\t\t\treturn null;\n\t\t},\n\t\tsandbox: [\"iframe\"],\n\t},\n\t{\n\t\tfn: (value: string, meta: URLMeta) => {\n\t\t\tif (value.startsWith(\"blob:\")) {\n\t\t\t\t// for media elements specifically they must take the original blob\n\t\t\t\t// because they can't be fetch'd\n\t\t\t\treturn unrewriteBlob(value);\n\t\t\t}\n\n\t\t\treturn rewriteUrl(value, meta);\n\t\t},\n\t\tsrc: [\"video\", \"audio\"],\n\t},\n\t{\n\t\tfn: () => \"\",\n\n\t\tintegrity: [\"script\", \"link\"],\n\t},\n\t{\n\t\tfn: () => null,\n\n\t\t// csp stuff that must be deleted\n\t\tnonce: \"*\",\n\t\tcsp: [\"iframe\"],\n\t\tcredentialless: [\"iframe\"],\n\t},\n\t{\n\t\tfn: (value: string, meta: URLMeta) => rewriteSrcset(value, meta),\n\n\t\t// srcset\n\t\tsrcset: [\"img\", \"source\"],\n\t\timagesrcset: [\"link\"],\n\t},\n\t{\n\t\tfn: (value: string, meta: URLMeta, cookieStore: CookieStore) =>\n\t\t\trewriteHtml(\n\t\t\t\tvalue,\n\t\t\t\tcookieStore,\n\t\t\t\t{\n\t\t\t\t\t// for srcdoc origin is the origin of the page that the iframe is on. base and path get dropped\n\t\t\t\t\torigin: new URL(meta.origin.origin),\n\t\t\t\t\tbase: new URL(meta.origin.origin),\n\t\t\t\t},\n\t\t\t\ttrue\n\t\t\t),\n\n\t\t// srcdoc\n\t\tsrcdoc: [\"iframe\"],\n\t},\n\t{\n\t\tfn: (value: string, meta: URLMeta) => rewriteCss(value, meta),\n\t\tstyle: \"*\",\n\t},\n\t{\n\t\tfn: (value: string, meta: URLMeta) => {\n\t\t\tif (value === \"_top\" || value === \"_unfencedTop\")\n\t\t\t\treturn meta.topFrameName;\n\t\t\telse if (value === \"_parent\") return meta.parentFrameName;\n\t\t\telse return value;\n\t\t},\n\t\ttarget: [\"a\", \"base\"],\n\t},\n];\n","import { ScramjetConfig, ScramjetFlags } from \"@/types\";\n\nexport * from \"./cookie\";\nexport * from \"./headers\";\nexport * from \"./htmlRules\";\nexport * from \"./rewriters\";\nexport * from \"./security\";\n\nexport let codecEncode: (input: string) => string;\nexport let codecDecode: (input: string) => string;\n\nconst nativeFunction = Function;\nexport function loadCodecs() {\n\tcodecEncode = nativeFunction(`return ${config.codec.encode}`)() as any;\n\tcodecDecode = nativeFunction(`return ${config.codec.decode}`)() as any;\n}\n\nexport function flagEnabled(flag: keyof ScramjetFlags, url: URL): boolean {\n\tconst value = config.flags[flag];\n\tfor (const regex in config.siteFlags) {\n\t\tconst partialflags = config.siteFlags[regex];\n\t\tif (new RegExp(regex).test(url.href) && flag in partialflags) {\n\t\t\treturn partialflags[flag];\n\t\t}\n\t}\n\n\treturn value;\n}\n\nexport let config: ScramjetConfig;\nexport function setConfig(newConfig: ScramjetConfig) {\n\tconfig = newConfig;\n\tloadCodecs();\n}\n","import { URLMeta, rewriteUrl, unrewriteUrl } from \"@rewriters/url\";\n\nexport function rewriteCss(css: string, meta: URLMeta) {\n\treturn handleCss(\"rewrite\", css, meta);\n}\n\nexport function unrewriteCss(css: string) {\n\treturn handleCss(\"unrewrite\", css);\n}\n\nfunction handleCss(type: \"rewrite\" | \"unrewrite\", css: string, meta?: URLMeta) {\n\t// regex from vk6 (https://github.com/ading2210)\n\tconst urlRegex = /url\\(['\"]?(.+?)['\"]?\\)/gm;\n\tconst Atruleregex =\n\t\t/@import\\s+(url\\s*?\\(.{0,9999}?\\)|['\"].{0,9999}?['\"]|.{0,9999}?)($|\\s|;)/gm;\n\tcss = new String(css).toString();\n\tcss = css.replace(urlRegex, (match, url) => {\n\t\tconst encodedUrl =\n\t\t\ttype === \"rewrite\"\n\t\t\t\t? rewriteUrl(url.trim(), meta)\n\t\t\t\t: unrewriteUrl(url.trim());\n\n\t\treturn match.replace(url, encodedUrl);\n\t});\n\tcss = css.replace(Atruleregex, (match, importStatement) => {\n\t\treturn match.replace(\n\t\t\timportStatement,\n\t\t\timportStatement.replace(\n\t\t\t\t/^(url\\(['\"]?|['\"]|)(.+?)(['\"]|['\"]?\\)|)$/gm,\n\t\t\t\t(match, firstQuote, url, endQuote) => {\n\t\t\t\t\tif (firstQuote.startsWith(\"url\")) {\n\t\t\t\t\t\treturn match;\n\t\t\t\t\t}\n\t\t\t\t\tconst encodedUrl =\n\t\t\t\t\t\ttype === \"rewrite\"\n\t\t\t\t\t\t\t? rewriteUrl(url.trim(), meta)\n\t\t\t\t\t\t\t: unrewriteUrl(url.trim());\n\n\t\t\t\t\treturn `${firstQuote}${encodedUrl}${endQuote}`;\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t});\n\n\treturn css;\n}\n","import type {\n\tdefault as BareClient,\n\tBareHeaders,\n} from \"@mercuryworkshop/bare-mux\";\nimport { rewriteUrl, type URLMeta } from \"@rewriters/url\";\nimport { getSiteDirective } from \"@/shared/security/siteTests\";\n\ninterface StoredReferrerPolicies {\n\tget(url: string): Promise<{ policy: string; referrer: string } | null>;\n\tset(url: string, policy: string, referrer: string): Promise<void>;\n}\n\n/**\n * Headers for security policy features that haven't been emulated yet\n */\nconst SEC_HEADERS = new Set([\n\t\"cross-origin-embedder-policy\",\n\t\"cross-origin-opener-policy\",\n\t\"cross-origin-resource-policy\",\n\t\"content-security-policy\",\n\t\"content-security-policy-report-only\",\n\t\"expect-ct\",\n\t\"feature-policy\",\n\t\"origin-isolation\",\n\t\"strict-transport-security\",\n\t\"upgrade-insecure-requests\",\n\t\"x-content-type-options\",\n\t\"x-download-options\",\n\t\"x-frame-options\",\n\t\"x-permitted-cross-domain-policies\",\n\t\"x-powered-by\",\n\t\"x-xss-protection\",\n\t// This needs to be emulated, but for right now it isn't that important of a feature to be worried about\n\t// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Clear-Site-Data\n\t\"clear-site-data\",\n]);\n\n/**\n * Headers that are actually URLs that need to be rewritten\n */\nconst URL_HEADERS = new Set([\"location\", \"content-location\", \"referer\"]);\n\nfunction rewriteLinkHeader(link: string, meta: URLMeta) {\n\treturn link.replace(/<(.*)>/gi, (match) => rewriteUrl(match, meta));\n}\n\n/**\n * Rewrites response headers\n * @param rawHeaders Headers before they were rewritten\n * @param meta Parsed Proxy URL\n * @param client `BareClient` instance used for fetching\n * @param isNavigationRequest Whether the request is a navigation request\n */\nexport async function rewriteHeaders(\n\trawHeaders: BareHeaders,\n\tmeta: URLMeta,\n\tclient: BareClient,\n\tstoredReferrerPolicies: StoredReferrerPolicies\n) {\n\tconst headers = {};\n\n\tfor (const key in rawHeaders) {\n\t\theaders[key.toLowerCase()] = rawHeaders[key];\n\t}\n\n\tfor (const cspHeader of SEC_HEADERS) {\n\t\tdelete headers[cspHeader];\n\t}\n\n\tfor (const urlHeader of URL_HEADERS) {\n\t\tif (headers[urlHeader])\n\t\t\theaders[urlHeader] = rewriteUrl(\n\t\t\t\theaders[urlHeader]?.toString() as string,\n\t\t\t\tmeta\n\t\t\t);\n\t}\n\n\tif (typeof headers[\"link\"] === \"string\") {\n\t\theaders[\"link\"] = rewriteLinkHeader(headers[\"link\"], meta);\n\t} else if (Array.isArray(headers[\"link\"])) {\n\t\theaders[\"link\"] = headers[\"link\"].map((link) =>\n\t\t\trewriteLinkHeader(link, meta)\n\t\t);\n\t}\n\n\t// Emulate the referrer policy to set it back to what it should've been without Force Referrer in place\n\tif (typeof headers[\"referer\"] === \"string\") {\n\t\tconst referrerUrl = new URL(headers[\"referer\"]);\n\t\tconst storedPolicyData = await storedReferrerPolicies.get(referrerUrl.href);\n\t\tif (storedPolicyData) {\n\t\t\tconst storedReferrerPolicy = storedPolicyData.policy\n\t\t\t\t.toLowerCase()\n\t\t\t\t.split(\",\")\n\t\t\t\t.map((rawDir) => rawDir.trim());\n\t\t\tif (\n\t\t\t\tstoredReferrerPolicy.includes(\"no-referrer\") ||\n\t\t\t\t(storedReferrerPolicy.includes(\"no-referrer-when-downgrade\") &&\n\t\t\t\t\tmeta.origin.protocol === \"http:\" &&\n\t\t\t\t\treferrerUrl.protocol === \"https:\")\n\t\t\t) {\n\t\t\t\tdelete headers[\"referer\"];\n\t\t\t} else if (storedReferrerPolicy.includes(\"origin\")) {\n\t\t\t\theaders[\"referer\"] = referrerUrl.origin;\n\t\t\t} else if (storedReferrerPolicy.includes(\"origin-when-cross-origin\")) {\n\t\t\t\tif (referrerUrl.origin !== meta.origin.origin) {\n\t\t\t\t\theaders[\"referer\"] = referrerUrl.origin;\n\t\t\t\t} else {\n\t\t\t\t\theaders[\"referer\"] = referrerUrl.href;\n\t\t\t\t}\n\t\t\t} else if (storedReferrerPolicy.includes(\"same-origin\")) {\n\t\t\t\tif (referrerUrl.origin === meta.origin.origin) {\n\t\t\t\t\theaders[\"referer\"] = referrerUrl.href;\n\t\t\t\t} else {\n\t\t\t\t\tdelete headers[\"referer\"];\n\t\t\t\t}\n\t\t\t} else if (storedReferrerPolicy.includes(\"strict-origin\")) {\n\t\t\t\tif (\n\t\t\t\t\tmeta.origin.protocol === \"http:\" &&\n\t\t\t\t\treferrerUrl.protocol === \"https:\"\n\t\t\t\t) {\n\t\t\t\t\tdelete headers[\"referer\"];\n\t\t\t\t} else {\n\t\t\t\t\theaders[\"referer\"] = referrerUrl.origin;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// `strict-origin-when-cross-origin` is the default behavior anyway\n\t\t\telse {\n\t\t\t\tif (referrerUrl.origin === meta.origin.origin) {\n\t\t\t\t\theaders[\"referer\"] = referrerUrl.href;\n\t\t\t\t} else if (\n\t\t\t\t\tmeta.origin.protocol === \"http:\" &&\n\t\t\t\t\treferrerUrl.protocol === \"https:\"\n\t\t\t\t) {\n\t\t\t\t\tdelete headers[\"referer\"];\n\t\t\t\t} else {\n\t\t\t\t\theaders[\"referer\"] = referrerUrl.origin;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (\n\t\ttypeof headers[\"sec-fetch-dest\"] === \"string\" &&\n\t\theaders[\"sec-fetch-dest\"] === \"\"\n\t) {\n\t\theaders[\"sec-fetch-dest\"] = \"empty\";\n\t}\n\n\tif (\n\t\ttypeof headers[\"sec-fetch-site\"] === \"string\" &&\n\t\theaders[\"sec-fetch-site\"] !== \"none\"\n\t) {\n\t\tif (typeof headers[\"referer\"] === \"string\") {\n\t\t\theaders[\"sec-fetch-site\"] = await getSiteDirective(\n\t\t\t\tmeta,\n\t\t\t\tnew URL(headers[\"referer\"]),\n\t\t\t\tclient\n\t\t\t);\n\t\t} else {\n\t\t\tconsole.warn(\n\t\t\t\t\"Missing referrer header; can't rewrite sec-fetch-site properly. Falling back to unsafe deletion.\"\n\t\t\t);\n\t\t\tdelete headers[\"sec-fetch-site\"];\n\t\t}\n\t}\n\n\treturn headers;\n}\n","import { ElementType, Parser } from \"htmlparser2\";\nimport { ChildNode, DomHandler, Element, Comment } from \"domhandler\";\nimport render from \"dom-serializer\";\nimport { URLMeta, rewriteUrl } from \"@rewriters/url\";\nimport { rewriteCss } from \"@rewriters/css\";\nimport { rewriteJs } from \"@rewriters/js\";\nimport { CookieStore } from \"@/shared/cookie\";\nimport { config } from \"@/shared\";\nimport { htmlRules } from \"@/shared/htmlRules\";\n\nexport function getInjectScripts<T>(\n\tcookieStore: CookieStore,\n\tscript: (src: string) => T\n): T[] {\n\tconst dump = JSON.stringify(cookieStore.dump());\n\tconst injected = `\n\t\tself.COOKIE = ${dump};\n\t\t$scramjetLoadClient().loadAndHook(${JSON.stringify(config)});\n\t\tif (\"document\" in self && document?.currentScript) {\n\t\t\tdocument.currentScript.remove();\n\t\t}\n\t`;\n\n\t// for compatibility purpose\n\tconst base64Injected = bytesToBase64(encoder.encode(injected));\n\n\treturn [\n\t\tscript(config.files.wasm),\n\t\tscript(config.files.all),\n\t\tscript(\"data:application/javascript;base64,\" + base64Injected),\n\t];\n}\n\nconst encoder = new TextEncoder();\nfunction rewriteHtmlInner(\n\thtml: string,\n\tcookieStore: CookieStore,\n\tmeta: URLMeta,\n\tfromTop: boolean = false\n) {\n\tconst handler = new DomHandler((err, dom) => dom);\n\tconst parser = new Parser(handler);\n\n\tparser.write(html);\n\tparser.end();\n\ttraverseParsedHtml(handler.root, cookieStore, meta);\n\n\tfunction findhead(node) {\n\t\tif (node.type === ElementType.Tag && node.name === \"head\") {\n\t\t\treturn node as Element;\n\t\t} else if (node.childNodes) {\n\t\t\tfor (const child of node.childNodes) {\n\t\t\t\tconst head = findhead(child);\n\t\t\t\tif (head) return head;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tif (fromTop) {\n\t\tlet head = findhead(handler.root);\n\t\tif (!head) {\n\t\t\thead = new Element(\"head\", {}, []);\n\t\t\thandler.root.children.unshift(head);\n\t\t}\n\n\t\tconst script = (src: string) => new Element(\"script\", { src });\n\t\thead.children.unshift(...getInjectScripts(cookieStore, script));\n\t}\n\n\treturn render(handler.root, {\n\t\tencodeEntities: \"utf8\",\n\t\tdecodeEntities: false,\n\t});\n}\n\nexport function rewriteHtml(\n\thtml: string,\n\tcookieStore: CookieStore,\n\tmeta: URLMeta,\n\tfromTop: boolean = false\n) {\n\tconst before = performance.now();\n\tconst ret = rewriteHtmlInner(html, cookieStore, meta, fromTop);\n\tdbg.time(meta, before, \"html rewrite\");\n\n\treturn ret;\n}\n\n// type ParseState = {\n// \tbase: string;\n// \torigin?: URL;\n// };\n\nexport function unrewriteHtml(html: string) {\n\tconst handler = new DomHandler((err, dom) => dom);\n\tconst parser = new Parser(handler);\n\n\tparser.write(html);\n\tparser.end();\n\n\tfunction traverse(node: ChildNode) {\n\t\tif (\"attribs\" in node) {\n\t\t\tfor (const key in node.attribs) {\n\t\t\t\tif (key == \"scramjet-attr-script-source-src\") {\n\t\t\t\t\tif (node.children[0] && \"data\" in node.children[0])\n\t\t\t\t\t\tnode.children[0].data = atob(node.attribs[key]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (key.startsWith(\"scramjet-attr-\")) {\n\t\t\t\t\tnode.attribs[key.slice(\"scramjet-attr-\".length)] = node.attribs[key];\n\t\t\t\t\tdelete node.attribs[key];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (\"childNodes\" in node) {\n\t\t\tfor (const child of node.childNodes) {\n\t\t\t\ttraverse(child);\n\t\t\t}\n\t\t}\n\t}\n\n\ttraverse(handler.root);\n\n\treturn render(handler.root, {\n\t\tdecodeEntities: false,\n\t});\n}\n\n// i need to add the attributes in during rewriting\n\nfunction traverseParsedHtml(\n\tnode: any,\n\tcookieStore: CookieStore,\n\tmeta: URLMeta\n) {\n\tif (node.name === \"base\" && node.attribs.href !== undefined) {\n\t\tmeta.base = new URL(node.attribs.href, meta.origin);\n\t}\n\n\tif (node.attribs) {\n\t\tfor (const rule of htmlRules) {\n\t\t\tfor (const attr in rule) {\n\t\t\t\tconst sel = rule[attr.toLowerCase()];\n\t\t\t\tif (typeof sel === \"function\") continue;\n\n\t\t\t\tif (sel === \"*\" || sel.includes(node.name)) {\n\t\t\t\t\tif (node.attribs[attr] !== undefined) {\n\t\t\t\t\t\tconst value = node.attribs[attr];\n\t\t\t\t\t\tconst v = rule.fn(value, meta, cookieStore);\n\n\t\t\t\t\t\tif (v === null) delete node.attribs[attr];\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tnode.attribs[attr] = v;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnode.attribs[`scramjet-attr-${attr}`] = value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (const [attr, value] of Object.entries(node.attribs)) {\n\t\t\tif (eventAttributes.includes(attr)) {\n\t\t\t\tnode.attribs[`scramjet-attr-${attr}`] = value;\n\t\t\t\tnode.attribs[attr] = rewriteJs(\n\t\t\t\t\tvalue as string,\n\t\t\t\t\t`(inline ${attr} on element)`,\n\t\t\t\t\tmeta\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (node.name === \"style\" && node.children[0] !== undefined)\n\t\tnode.children[0].data = rewriteCss(node.children[0].data, meta);\n\n\tif (\n\t\tnode.name === \"script\" &&\n\t\tnode.attribs.type === \"module\" &&\n\t\tnode.attribs.src\n\t)\n\t\tnode.attribs.src = node.attribs.src + \"?type=module\";\n\n\tif (\n\t\tnode.name === \"script\" &&\n\t\tnode.attribs.type === \"importmap\" &&\n\t\tnode.children[0] !== undefined\n\t) {\n\t\tlet json = node.children[0].data;\n\t\ttry {\n\t\t\tconst map = JSON.parse(json);\n\t\t\tif (map.imports) {\n\t\t\t\tfor (const key in map.imports) {\n\t\t\t\t\tlet url = map.imports[key];\n\t\t\t\t\tif (typeof url === \"string\") {\n\t\t\t\t\t\turl = rewriteUrl(url, meta);\n\t\t\t\t\t\tmap.imports[key] = url;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnode.children[0].data = JSON.stringify(map);\n\t\t} catch (e) {\n\t\t\tconsole.error(\"Failed to parse importmap JSON:\", e);\n\t\t}\n\t}\n\tif (\n\t\tnode.name === \"script\" &&\n\t\t/(application|text)\\/javascript|module|undefined/.test(node.attribs.type) &&\n\t\tnode.children[0] !== undefined\n\t) {\n\t\tlet js = node.children[0].data;\n\t\tconst module = node.attribs.type === \"module\" ? true : false;\n\t\tnode.attribs[\"scramjet-attr-script-source-src\"] = bytesToBase64(\n\t\t\tencoder.encode(js)\n\t\t);\n\t\tconst htmlcomment = /<!--[\\s\\S]*?-->/g;\n\t\tjs = js.replace(htmlcomment, \"\");\n\t\tnode.children[0].data = rewriteJs(\n\t\t\tjs,\n\t\t\t\"(inline script element)\",\n\t\t\tmeta,\n\t\t\tmodule\n\t\t);\n\t}\n\n\tif (node.name === \"meta\" && node.attribs[\"http-equiv\"] !== undefined) {\n\t\tif (\n\t\t\tnode.attribs[\"http-equiv\"].toLowerCase() === \"content-security-policy\"\n\t\t) {\n\t\t\t// just delete it. this needs to be emulated eventually but like\n\t\t\tnode = new Comment(node.attribs.content);\n\t\t} else if (\n\t\t\tnode.attribs[\"http-equiv\"] === \"refresh\" &&\n\t\t\tnode.attribs.content.includes(\"url\")\n\t\t) {\n\t\t\tconst contentArray = node.attribs.content.split(\"url=\");\n\t\t\tif (contentArray[1])\n\t\t\t\tcontentArray[1] = rewriteUrl(contentArray[1].trim(), meta);\n\t\t\tnode.attribs.content = contentArray.join(\"url=\");\n\t\t}\n\t}\n\n\tif (node.childNodes) {\n\t\tfor (const childNode in node.childNodes) {\n\t\t\tnode.childNodes[childNode] = traverseParsedHtml(\n\t\t\t\tnode.childNodes[childNode],\n\t\t\t\tcookieStore,\n\t\t\t\tmeta\n\t\t\t);\n\t\t}\n\t}\n\n\treturn node;\n}\n\nexport function rewriteSrcset(srcset: string, meta: URLMeta) {\n\tconst sources = srcset.split(/ .*,/).map((src) => src.trim());\n\tconst rewrittenSources = sources.map((source) => {\n\t\t// Split into URLs and descriptors (if any)\n\t\t// e.g. url0, url1 1.5x, url2 2x\n\t\tconst [url, ...descriptors] = source.split(/\\s+/);\n\n\t\t// Rewrite the URLs and keep the descriptors (if any)\n\t\tconst rewrittenUrl = rewriteUrl(url.trim(), meta);\n\n\t\treturn descriptors.length > 0\n\t\t\t? `${rewrittenUrl} ${descriptors.join(\" \")}`\n\t\t\t: rewrittenUrl;\n\t});\n\n\treturn rewrittenSources.join(\", \");\n}\n\n// function base64ToBytes(base64) {\n// \tconst binString = atob(base64);\n\n// \treturn Uint8Array.from(binString, (m) => m.codePointAt(0));\n// }\n\nfunction bytesToBase64(bytes: Uint8Array) {\n\tconst binString = Array.from(bytes, (byte) =>\n\t\tString.fromCodePoint(byte)\n\t).join(\"\");\n\n\treturn btoa(binString);\n}\nconst eventAttributes = [\n\t\"onbeforexrselect\",\n\t\"onabort\",\n\t\"onbeforeinput\",\n\t\"onbeforematch\",\n\t\"onbeforetoggle\",\n\t\"onblur\",\n\t\"oncancel\",\n\t\"oncanplay\",\n\t\"oncanplaythrough\",\n\t\"onchange\",\n\t\"onclick\",\n\t\"onclose\",\n\t\"oncontentvisibilityautostatechange\",\n\t\"oncontextlost\",\n\t\"oncontextmenu\",\n\t\"oncontextrestored\",\n\t\"oncuechange\",\n\t\"ondblclick\",\n\t\"ondrag\",\n\t\"ondragend\",\n\t\"ondragenter\",\n\t\"ondragleave\",\n\t\"ondragover\",\n\t\"ondragstart\",\n\t\"ondrop\",\n\t\"ondurationchange\",\n\t\"onemptied\",\n\t\"onended\",\n\t\"onerror\",\n\t\"onfocus\",\n\t\"onformdata\",\n\t\"oninput\",\n\t\"oninvalid\",\n\t\"onkeydown\",\n\t\"onkeypress\",\n\t\"onkeyup\",\n\t\"onload\",\n\t\"onloadeddata\",\n\t\"onloadedmetadata\",\n\t\"onloadstart\",\n\t\"onmousedown\",\n\t\"onmouseenter\",\n\t\"onmouseleave\",\n\t\"onmousemove\",\n\t\"onmouseout\",\n\t\"onmouseover\",\n\t\"onmouseup\",\n\t\"onmousewheel\",\n\t\"onpause\",\n\t\"onplay\",\n\t\"onplaying\",\n\t\"onprogress\",\n\t\"onratechange\",\n\t\"onreset\",\n\t\"onresize\",\n\t\"onscroll\",\n\t\"onsecuritypolicyviolation\",\n\t\"onseeked\",\n\t\"onseeking\",\n\t\"onselect\",\n\t\"onslotchange\",\n\t\"onstalled\",\n\t\"onsubmit\",\n\t\"onsuspend\",\n\t\"ontimeupdate\",\n\t\"ontoggle\",\n\t\"onvolumechange\",\n\t\"onwaiting\",\n\t\"onwebkitanimationend\",\n\t\"onwebkitanimationiteration\",\n\t\"onwebkitanimationstart\",\n\t\"onwebkittransitionend\",\n\t\"onwheel\",\n\t\"onauxclick\",\n\t\"ongotpointercapture\",\n\t\"onlostpointercapture\",\n\t\"onpointerdown\",\n\t\"onpointermove\",\n\t\"onpointerrawupdate\",\n\t\"onpointerup\",\n\t\"onpointercancel\",\n\t\"onpointerover\",\n\t\"onpointerout\",\n\t\"onpointerenter\",\n\t\"onpointerleave\",\n\t\"onselectstart\",\n\t\"onselectionchange\",\n\t\"onanimationend\",\n\t\"onanimationiteration\",\n\t\"onanimationstart\",\n\t\"ontransitionrun\",\n\t\"ontransitionstart\",\n\t\"ontransitionend\",\n\t\"ontransitioncancel\",\n\t\"oncopy\",\n\t\"oncut\",\n\t\"onpaste\",\n\t\"onscrollend\",\n\t\"onscrollsnapchange\",\n\t\"onscrollsnapchanging\",\n];\n","import { config, flagEnabled } from \"@/shared\";\nimport { URLMeta } from \"@rewriters/url\";\n\nimport { getRewriter, JsRewriterOutput, textDecoder } from \"@rewriters/wasm\";\n\nError.stackTraceLimit = 50;\n\ntype RewriterResult = {\n\tjs: string | Uint8Array;\n\tmap: Uint8Array | null;\n\ttag: string;\n\terrors: string[];\n};\nfunction rewriteJsWasm(\n\tinput: string | Uint8Array,\n\tsource: string | null,\n\tmeta: URLMeta,\n\tmodule: boolean\n): RewriterResult {\n\tlet [rewriter, ret] = getRewriter(meta);\n\n\ttry {\n\t\tlet out: JsRewriterOutput;\n\t\tconst before = performance.now();\n\t\t// try {\n\t\tif (typeof input === \"string\") {\n\t\t\tout = rewriter.rewrite_js(\n\t\t\t\tinput,\n\t\t\t\tmeta.base.href,\n\t\t\t\tsource || \"(unknown)\",\n\t\t\t\tmodule\n\t\t\t);\n\t\t} else {\n\t\t\tout = rewriter.rewrite_js_bytes(\n\t\t\t\tinput,\n\t\t\t\tmeta.base.href,\n\t\t\t\tsource || \"(unknown)\",\n\t\t\t\tmodule\n\t\t\t);\n\t\t}\n\t\t// } catch (err) {\n\t\t// \tconst err1 = err as Error;\n\t\t// \tconsole.warn(\n\t\t// \t\t\"failed rewriting js for\",\n\t\t// \t\tsource,\n\t\t// \t\terr1.message,\n\t\t// \t\tinput instanceof Uint8Array ? textDecoder.decode(input) : input\n\t\t// \t);\n\n\t\t// \treturn { js: input, tag: \"\", map: null };\n\t\t// }\n\t\tdbg.time(meta, before, `oxc rewrite for \"${source || \"(unknown)\"}\"`);\n\n\t\tconst { js, map, scramtag, errors } = out;\n\n\t\treturn {\n\t\t\tjs: typeof input === \"string\" ? textDecoder.decode(js) : js,\n\t\t\ttag: scramtag,\n\t\t\tmap,\n\t\t\terrors,\n\t\t};\n\t} finally {\n\t\tret();\n\t}\n}\n\nexport function rewriteJsInner(\n\tjs: string | Uint8Array,\n\turl: string | null,\n\tmeta: URLMeta,\n\tmodule = false\n) {\n\treturn rewriteJsWasm(js, url, meta, module);\n}\n\nexport function rewriteJs(\n\tjs: string | Uint8Array,\n\turl: string | null,\n\tmeta: URLMeta,\n\tmodule = false\n): string | Uint8Array {\n\ttry {\n\t\tconst res = rewriteJsInner(js, url, meta, module);\n\t\tlet newjs = res.js;\n\n\t\tif (flagEnabled(\"sourcemaps\", meta.base)) {\n\t\t\tconst pushmap = globalThis[config.globals.pushsourcemapfn];\n\t\t\tif (pushmap) {\n\t\t\t\tpushmap(Array.from(res.map), res.tag);\n\t\t\t} else {\n\t\t\t\tif (newjs instanceof Uint8Array) {\n\t\t\t\t\tnewjs = new TextDecoder().decode(newjs);\n\t\t\t\t}\n\t\t\t\tconst sourcemapfn = `${config.globals.pushsourcemapfn}([${res.map.join(\",\")}], \"${res.tag}\");`;\n\n\t\t\t\t// don't put the sourcemap call before \"use strict\"\n\t\t\t\tconst strictMode = /^\\s*(['\"])use strict\\1;?/;\n\t\t\t\tif (strictMode.test(newjs)) {\n\t\t\t\t\tnewjs = newjs.replace(strictMode, `$&\\n${sourcemapfn}`);\n\t\t\t\t} else {\n\t\t\t\t\tnewjs = `${sourcemapfn}\\n${newjs}`;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (flagEnabled(\"rewriterLogs\", meta.base)) {\n\t\t\tfor (const error of res.errors) {\n\t\t\t\tconsole.error(\"oxc parse error\", error);\n\t\t\t}\n\t\t}\n\n\t\treturn newjs;\n\t} catch (err) {\n\t\tconsole.warn(\n\t\t\t\"failed rewriting js for\",\n\t\t\turl || \"(unknown)\",\n\t\t\terr.message,\n\t\t\tjs instanceof Uint8Array ? textDecoder.decode(js) : js\n\t\t);\n\t\tif (flagEnabled(\"allowInvalidJs\", meta.base)) {\n\t\t\treturn js;\n\t\t} else {\n\t\t\tthrow err;\n\t\t}\n\t}\n}\n","import { codecDecode, codecEncode } from \"@/shared\";\nimport { config } from \"@/shared\";\nimport { rewriteJs } from \"@rewriters/js\";\n\nexport type URLMeta = {\n\torigin: URL;\n\tbase: URL;\n\ttopFrameName?: string;\n\tparentFrameName?: string;\n};\n\nfunction tryCanParseURL(url: string, origin?: string | URL): URL | null {\n\ttry {\n\t\treturn new URL(url, origin);\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nexport function rewriteBlob(url: string, meta: URLMeta) {\n\tconst blob = new URL(url.substring(\"blob:\".length));\n\n\treturn \"blob:\" + meta.origin.origin + blob.pathname;\n}\n\nexport function unrewriteBlob(url: string) {\n\tconst blob = new URL(url.substring(\"blob:\".length));\n\n\treturn \"blob:\" + location.origin + blob.pathname;\n}\n\nexport function rewriteUrl(url: string | URL, meta: URLMeta) {\n\tif (url instanceof URL) url = url.toString();\n\n\tif (url.startsWith(\"javascript:\")) {\n\t\treturn (\n\t\t\t\"javascript:\" +\n\t\t\trewriteJs(url.slice(\"javascript:\".length), \"(javascript: url)\", meta)\n\t\t);\n\t} else if (url.startsWith(\"blob:\")) {\n\t\treturn location.origin + config.prefix + url;\n\t} else if (url.startsWith(\"data:\")) {\n\t\treturn location.origin + config.prefix + url;\n\t} else if (url.startsWith(\"mailto:\") || url.startsWith(\"about:\")) {\n\t\treturn url;\n\t} else {\n\t\tlet base = meta.base.href;\n\n\t\tif (base.startsWith(\"about:\")) base = unrewriteUrl(self.location.href); // jank!!!!! weird jank!!!\n\t\tconst realUrl = tryCanParseURL(url, base);\n\t\tif (!realUrl) return url;\n\t\tconst encodedHash = codecEncode(realUrl.hash.slice(1));\n\t\tconst realHash = encodedHash ? \"#\" + encodedHash : \"\";\n\t\trealUrl.hash = \"\";\n\n\t\treturn (\n\t\t\tlocation.origin + config.prefix + codecEncode(realUrl.href) + realHash\n\t\t);\n\t}\n}\n\nexport function unrewriteUrl(url: string | URL) {\n\tif (url instanceof URL) url = url.toString();\n\t// remove query string\n\t// if (url.includes(\"?\")) {\n\t// \turl = url.split(\"?\")[0];\n\t// }\n\n\tconst prefixed = location.origin + config.prefix;\n\n\tif (url.startsWith(\"javascript:\")) {\n\t\t//TODO\n\t\treturn url;\n\t} else if (url.startsWith(\"blob:\")) {\n\t\t// realistically this shouldn't happen\n\t\treturn url;\n\t} else if (url.startsWith(prefixed + \"blob:\")) {\n\t\treturn url.substring(prefixed.length);\n\t} else if (url.startsWith(prefixed + \"data:\")) {\n\t\treturn url.substring(prefixed.length);\n\t} else if (url.startsWith(\"mailto:\") || url.startsWith(\"about:\")) {\n\t\treturn url;\n\t} else {\n\t\tconst realUrl = tryCanParseURL(url);\n\t\tif (!realUrl) return url;\n\t\tconst decodedHash = codecDecode(realUrl.hash.slice(1));\n\t\tconst realHash = decodedHash ? \"#\" + decodedHash : \"\";\n\t\trealUrl.hash = \"\";\n\n\t\treturn codecDecode(realUrl.href.slice(prefixed.length) + realHash);\n\t}\n}\n","// i am a cat. i like to be petted. i like to be fed. i like to be\nimport { initSync, Rewriter } from \"../../../rewriter/wasm/out/wasm.js\";\nimport type { JsRewriterOutput } from \"../../../rewriter/wasm/out/wasm.js\";\nimport { codecDecode, codecEncode, config, flagEnabled } from \"@/shared\";\n\nexport type { JsRewriterOutput, Rewriter };\n\nimport { rewriteUrl, URLMeta } from \"@rewriters/url\";\nimport { htmlRules } from \"@/shared/htmlRules\";\nimport { rewriteCss } from \"@rewriters/css\";\nimport { rewriteJs } from \"@rewriters/js\";\nimport { getInjectScripts } from \"@rewriters/html\";\nimport { CookieStore } from \"@/shared/cookie\";\n\nlet wasm_u8: Uint8Array<ArrayBuffer>;\n\ndeclare const REWRITERWASM: string | undefined;\nif (REWRITERWASM)\n\twasm_u8 = Uint8Array.from(atob(REWRITERWASM), (c) => c.charCodeAt(0));\nelse if (self.WASM)\n\twasm_u8 = Uint8Array.from(atob(self.WASM), (c) => c.charCodeAt(0));\n\n// only use in sw\nexport async function asyncSetWasm() {\n\tconst buf = await fetch(config.files.wasm).then((r) => r.arrayBuffer());\n\twasm_u8 = new Uint8Array(buf);\n}\n\nexport const textDecoder = new TextDecoder();\nlet MAGIC = \"\\0asm\".split(\"\").map((x) => x.charCodeAt(0));\n\nfunction initWasm() {\n\tif (!(wasm_u8 instanceof Uint8Array))\n\t\tthrow new Error(\"rewriter wasm not found (was it fetched correctly?)\");\n\n\tif (![...wasm_u8.slice(0, 4)].every((x, i) => x === MAGIC[i]))\n\t\tthrow new Error(\n\t\t\t\"rewriter wasm does not have wasm magic (was it fetched correctly?)\\nrewriter wasm contents: \" +\n\t\t\t\ttextDecoder.decode(wasm_u8)\n\t\t);\n\n\tinitSync({\n\t\tmodule: new WebAssembly.Module(wasm_u8),\n\t});\n}\n\nlet rewriters = [];\nexport function getRewriter(meta: URLMeta): [Rewriter, () => void] {\n\tinitWasm();\n\n\tlet obj: { rewriter: Rewriter; inUse: boolean };\n\tlet index = rewriters.findIndex((x) => !x.inUse);\n\tlet len = rewriters.length;\n\n\tif (index === -1) {\n\t\tif (flagEnabled(\"rewriterLogs\", meta.base))\n\t\t\tconsole.log(`creating new rewriter, ${len} rewriters made already`);\n\n\t\tlet rewriter = new Rewriter({\n\t\t\tconfig,\n\t\t\tshared: {\n\t\t\t\trewrite: {\n\t\t\t\t\thtmlRules,\n\t\t\t\t\trewriteUrl,\n\t\t\t\t\trewriteCss,\n\t\t\t\t\trewriteJs,\n\t\t\t\t\tgetHtmlInjectCode(cookieStore: CookieStore, foundHead: boolean) {\n\t\t\t\t\t\tlet inject = getInjectScripts(\n\t\t\t\t\t\t\tcookieStore,\n\t\t\t\t\t\t\t(src) => `<script src=\"${src}\"></script>`\n\t\t\t\t\t\t).join(\"\");\n\t\t\t\t\t\treturn foundHead ? `<head>${inject}</head>` : inject;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tflagEnabled,\n\t\t\tcodec: {\n\t\t\t\tencode: codecEncode,\n\t\t\t\tdecode: codecDecode,\n\t\t\t},\n\t\t});\n\t\tobj = { rewriter, inUse: false };\n\t\trewriters.push(obj);\n\t} else {\n\t\tif (flagEnabled(\"rewriterLogs\", meta.base))\n\t\t\tconsole.log(\n\t\t\t\t`using cached rewriter ${index} from list of ${len} rewriters`\n\t\t\t);\n\n\t\tobj = rewriters[index];\n\t}\n\tobj.inUse = true;\n\n\treturn [obj.rewriter, () => (obj.inUse = false)];\n}\n","import { config } from \"@/shared\";\nimport { rewriteJs } from \"@rewriters/js\";\nimport { URLMeta } from \"@rewriters/url\";\n\nexport function rewriteWorkers(\n\tjs: string | Uint8Array,\n\ttype: string,\n\turl: string,\n\tmeta: URLMeta\n) {\n\tlet str = \"\";\n\tconst module = type === \"module\";\n\tconst script = (script) => {\n\t\tif (module) {\n\t\t\tstr += `import \"${config.files[script]}\"\\n`;\n\t\t} else {\n\t\t\tstr += `importScripts(\"${config.files[script]}\");\\n`;\n\t\t}\n\t};\n\n\tscript(\"wasm\");\n\tscript(\"all\");\n\tstr += `$scramjetLoadClient().loadAndHook(${JSON.stringify(config)});`;\n\n\tlet rewritten = rewriteJs(js, url, meta, module);\n\tif (rewritten instanceof Uint8Array) {\n\t\trewritten = new TextDecoder().decode(rewritten);\n\t}\n\n\tstr += rewritten;\n\n\treturn str;\n}\n","import {\n\ttype RedirectTracker,\n\ttype ReferrerPolicyData,\n\ttype SiteDirective,\n\tScramjetDB,\n} from \"@/types\";\nimport { openDB, IDBPDatabase } from \"idb\";\n\n// Persist the redirect trackers for an hour\nconst TRACKER_EXPIRY = 60 * 60 * 1000;\nconst SITE_HIERARCHY: Record<SiteDirective, number> = {\n\tnone: 0,\n\t\"same-origin\": 1,\n\t\"same-site\": 2,\n\t\"cross-site\": 3,\n};\n\n/**\n * Gets a connection to the IndexedDB database\n *\n * @returns Promise that resolves to the database connection\n */\nasync function getDB(): Promise<IDBPDatabase<ScramjetDB>> {\n\treturn openDB<ScramjetDB>(\"$scramjet\", 1);\n}\n\n/**\n * Retrieves a redirect tracker for a given URL\n *\n * @param url The URL to look up\n * @returns Redirect tracker if found, or `null`\n */\nasync function getTracker(url: string): Promise<RedirectTracker | null> {\n\tconst db = await getDB();\n\treturn (await db.get(\"redirectTrackers\", url)) || null;\n}\n\n/**\n * Store or update a redirect tracker for a given URL\n *\n * @param url URL to store the tracker for\n * @param tracker Redirect tracker data to store\n */\nasync function setTracker(\n\turl: string,\n\ttracker: RedirectTracker\n): Promise<void> {\n\tconst db = await getDB();\n\tawait db.put(\"redirectTrackers\", tracker, url);\n}\n\n/**\n * Delete a redirect tracker for a given URL\n *\n * @param url URL whose tracker should be deleted\n */\nasync function deleteTracker(url: string): Promise<void> {\n\tconst db = await getDB();\n\tawait db.delete(\"redirectTrackers\", url);\n}\n\n/**\n * Initialize tracking for a new request that might redirect\n *\n * @param requestUrl URL of the request being made\n * @param referrer Referrer URL of the request, or `null`\n * @param initialSite Initial Sec-Fetch-Site directive\n */\nexport async function initializeTracker(\n\trequestUrl: string,\n\treferrer: string | null,\n\tinitialSite: string\n): Promise<void> {\n\tconst existing = await getTracker(requestUrl);\n\tif (existing) {\n\t\treturn;\n\t}\n\n\tawait setTracker(requestUrl, {\n\t\toriginalReferrer: referrer || \"\",\n\t\tmostRestrictiveSite: initialSite as SiteDirective,\n\t\treferrerPolicy: \"\",\n\t\tchainStarted: Date.now(),\n\t});\n}\n\n/**\n * Update tracker when a redirect is encountered\n *\n * @param originalUrl URL that is redirecting\n * @param redirectUrl URL being redirected to\n * @param newReferrerPolicy Referrer Policy from the redirect response\n */\nexport async function updateTracker(\n\toriginalUrl: string,\n\tredirectUrl: string,\n\tnewReferrerPolicy?: string\n): Promise<void> {\n\tconst tracker = await getTracker(originalUrl);\n\tif (!tracker) return;\n\n\tawait deleteTracker(originalUrl);\n\tif (newReferrerPolicy) {\n\t\ttracker.referrerPolicy = newReferrerPolicy;\n\t}\n\tawait setTracker(redirectUrl, tracker);\n}\n\n/**\n * Get most restrictive site value for a request\n *\n * @param requestUrl The URL of the current request\n * @param currentSite The current `Sec-Fetch-Site` directive for this request\n * @returns Most restrictive `Sec-Fetch-Site` directive from the redirect chain\n */\nexport async function getMostRestrictiveSite(\n\trequestUrl: string,\n\tcurrentSite: string\n): Promise<string> {\n\tconst tracker = await getTracker(requestUrl);\n\tif (!tracker) return currentSite;\n\n\tconst trackedValue = SITE_HIERARCHY[tracker.mostRestrictiveSite];\n\tconst currentValue = SITE_HIERARCHY[currentSite as SiteDirective] ?? 0;\n\n\tif (currentValue > trackedValue) {\n\t\ttracker.mostRestrictiveSite = currentSite as SiteDirective;\n\t\tawait setTracker(requestUrl, tracker);\n\n\t\treturn currentSite;\n\t}\n\n\treturn tracker.mostRestrictiveSite;\n}\n\n/**\n * Clean up tracker after request completes\n * @param requestUrl URL of the completed request\n */\nexport async function cleanTracker(requestUrl: string): Promise<void> {\n\tawait deleteTracker(requestUrl);\n}\n\n/**\n * Clean up expired trackers\n */\nexport async function cleanExpiredTrackers(): Promise<void> {\n\tconst now = Date.now();\n\tconst db = await getDB();\n\tconst tx = db.transaction(\"redirectTrackers\", \"readwrite\");\n\n\tfor await (const cursor of tx.store) {\n\t\tconst tracker = cursor.value as RedirectTracker;\n\t\tif (now - tracker.chainStarted > TRACKER_EXPIRY) {\n\t\t\tcursor.delete();\n\t\t}\n\t}\n\n\tawait tx.done;\n}\n\n/**\n * Store referrer policy for a URL\n *\n * @param url URL to store the policy for\n * @param policy Referrer policy to store\n * @param referrer The referrer URL that set this policy\n */\nexport async function storeReferrerPolicy(\n\turl: string,\n\tpolicy: string,\n\treferrer: string\n): Promise<void> {\n\tconst db = await getDB();\n\tconst data: ReferrerPolicyData = { policy, referrer };\n\tawait db.put(\"referrerPolicies\", data, url);\n}\n\n/**\n * Get referrer policy data for a URL\n *\n * @param url URL to get the policy for\n * @returns Referrer policy data if found, or `null`\n */\nexport async function getReferrerPolicy(\n\turl: string\n): Promise<ReferrerPolicyData | null> {\n\tconst db = await getDB();\n\treturn (await db.get(\"referrerPolicies\", url)) || null;\n}\n","import { type URLMeta } from \"@rewriters/url\";\n\nimport type {\n\tdefault as BareClient,\n\tBareResponseFetch,\n} from \"@mercuryworkshop/bare-mux\";\nimport { ScramjetDB } from \"@/types\";\nimport { openDB, IDBPDatabase } from \"idb\";\n\n// Cache every hour\nconst CACHE_DURATION_MINUTES = 60;\nconst CACHE_KEY = \"publicSuffixList\";\n\n/**\n * Gets a connection to the IndexedDB database\n *\n * @returns Resolves to the database connection\n */\nasync function getDB(): Promise<IDBPDatabase<ScramjetDB>> {\n\treturn openDB<ScramjetDB>(\"$scramjet\", 1);\n}\n\n/**\n * Gets cached Public Suffix List\n *\n * @returns Cached Public Suffix List data if not expired, or `null`\n */\nasync function getCachedSuffixList(): Promise<{\n\tdata: string[];\n\texpiry: number;\n} | null> {\n\tconst db = await getDB();\n\treturn (await db.get(\"publicSuffixList\", CACHE_KEY)) || null;\n}\n\n/**\n * Stores public suffix list\n *\n * @param data Public Suffix list data to cache\n */\nasync function setCachedSuffixList(data: string[]): Promise<void> {\n\tconst db = await getDB();\n\tawait db.put(\n\t\t\"publicSuffixList\",\n\t\t{\n\t\t\tdata,\n\t\t\texpiry: Date.now() + CACHE_DURATION_MINUTES * 60 * 1000,\n\t\t},\n\t\tCACHE_KEY\n\t);\n}\n\n/**\n * Emulate `Sec-Fetch-Site` header using the referrer (another reason why Force Referrer is now a needed SJ feature)\n */\nexport async function getSiteDirective(\n\tmeta: URLMeta,\n\treferrerURL: URL,\n\tclient: BareClient\n): Promise<string> {\n\tif (!referrerURL) {\n\t\treturn \"none\";\n\t}\n\n\tif (meta.origin.origin === referrerURL.origin) {\n\t\treturn \"same-origin\";\n\t}\n\n\tconst sameSite = await isSameSite(meta.origin, referrerURL, client);\n\tif (sameSite) {\n\t\treturn \"same-site\";\n\t}\n\n\treturn \"cross-site\";\n}\n\n/**\n * Tests if the two URLs are from the same site.\n * This will be used in the response header rewriter.\n *\n * @see https://developer.mozilla.org/en-US/docs/Glossary/Site\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-Fetch-Site#directives\n *\n * @param url1 First URL to compare\n * @param url2 Second URL to compare\n * @param client `BareClient` instance used for fetching\n * @returns Whether the two URLs are from the same site\n *\n * @throws {Error} If an error occurs while getting the Public Suffix List\n */\nexport async function isSameSite(\n\turl1: URL,\n\turl2: URL,\n\tclient: BareClient\n): Promise<boolean> {\n\tconst registrableDomain1 = await getRegistrableDomain(url1, client);\n\tconst registrableDomain2 = await getRegistrableDomain(url2, client);\n\n\treturn registrableDomain1 === registrableDomain2;\n}\n\n/**\n * Gets the registrable domain (eTLD+1) for a URL\n * @param url URL to get registrable domain for\n * @param client `BareClient` instance for fetching public suffix list\n * @returns Registrable domain\n */\nasync function getRegistrableDomain(\n\turl: URL,\n\tclient: BareClient\n): Promise<string> {\n\tconst publicSuffixes = await getPublicSuffixList(client);\n\n\tconst hostname = url.hostname.toLowerCase();\n\tconst labels = hostname.split(\".\");\n\tlet matchedSuffix = \"\";\n\n\tlet isException = false;\n\tfor (const suffix of publicSuffixes) {\n\t\tconst actualSuffix = suffix.startsWith(\"!\") ? suffix.substring(1) : suffix;\n\t\tconst suffixLabels = actualSuffix.split(\".\");\n\n\t\tif (matchesSuffix(labels, suffixLabels)) {\n\t\t\tif (suffix.startsWith(\"!\")) {\n\t\t\t\tmatchedSuffix = actualSuffix;\n\t\t\t\tisException = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!isException && actualSuffix.length > matchedSuffix.length) {\n\t\t\t\tmatchedSuffix = actualSuffix;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!matchedSuffix) {\n\t\treturn labels.slice(-2).join(\".\");\n\t}\n\n\tconst suffixLabelCount = matchedSuffix.split(\".\").length;\n\tconst domainLabelCount = isException\n\t\t? suffixLabelCount\n\t\t: suffixLabelCount + 1;\n\n\treturn labels.slice(-domainLabelCount).join(\".\");\n}\n\n/**\n * Checks if hostname labels match a suffix pattern\n * @param hostnameLabels Labels of the hostname (split by `.`)\n * @param suffixLabels Labels of the suffix pattern (split by `.`)\n * @returns Whether the hostname matches the suffix\n */\nfunction matchesSuffix(\n\thostnameLabels: string[],\n\tsuffixLabels: string[]\n): boolean {\n\tif (hostnameLabels.length < suffixLabels.length) {\n\t\treturn false;\n\t}\n\n\tconst offset = hostnameLabels.length - suffixLabels.length;\n\tfor (let i = 0; i < suffixLabels.length; i++) {\n\t\tconst hostLabel = hostnameLabels[offset + i];\n\t\tconst suffixLabel = suffixLabels[i];\n\n\t\tif (suffixLabel === \"*\") {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (hostLabel !== suffixLabel) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\n/**\n * Gets parsed Public Suffix list from the API.\n *\n * Complies with the standard format.\n * @see https://github.com/publicsuffix/list/wiki/Format#format\n *\n * @param {BareClient} client `BareClient` instance used for fetching\n * @returns {Promise<string[]>} Parsed Public Suffix list\n *\n * @throws {Error} If an error occurs while fetching from the Public Suffix List\n */\nexport async function getPublicSuffixList(\n\tclient: BareClient\n): Promise<string[]> {\n\tconst cached = await getCachedSuffixList();\n\tif (cached && Date.now() < cached.expiry) {\n\t\treturn cached.data;\n\t}\n\n\tlet publicSuffixesResponse: BareResponseFetch;\n\ttry {\n\t\tpublicSuffixesResponse = await client.fetch(\n\t\t\t\"https://publicsuffix.org/list/public_suffix_list.dat\"\n\t\t);\n\t} catch (err) {\n\t\tthrow new Error(`Failed to fetch public suffix list: ${err}`);\n\t}\n\tconst publicSuffixesRaw = await publicSuffixesResponse.text();\n\n\tconst publicSuffixes = publicSuffixesRaw\n\t\t.split(\"\\n\")\n\t\t.map((line) => {\n\t\t\tconst trimmed = line.trim();\n\t\t\tconst spaceIndex = trimmed.indexOf(\" \");\n\n\t\t\treturn spaceIndex > -1 ? trimmed.substring(0, spaceIndex) : trimmed;\n\t\t})\n\t\t.filter((line) => line && !line.startsWith(\"//\"));\n\n\tawait setCachedSuffixList(publicSuffixes);\n\n\treturn publicSuffixes;\n}\n","/**\n * @fileoverview\n * See `types.ts` for context on these symbols.\n */\n\nexport const SCRAMJETCLIENTNAME = \"scramjet client global\";\nexport const SCRAMJETCLIENT = Symbol.for(SCRAMJETCLIENTNAME);\nexport const SCRAMJETFRAME = Symbol.for(\"scramjet frame handle\");\n","export function errorTemplate(trace: string, fetchedURL: string) {\n\t// turn script into a data URI so we don\"t have to escape any HTML values\n\tconst script = `\n errorTrace.value = ${JSON.stringify(trace)};\n fetchedURL.textContent = ${JSON.stringify(fetchedURL)};\n for (const node of document.querySelectorAll(\"#hostname\")) node.textContent = ${JSON.stringify(location.hostname)};\n reload.addEventListener(\"click\", () => location.reload());\n version.textContent = ${JSON.stringify((globalThis as any).$scramjetVersion?.version || \"unknown\")};\n build.textContent = ${JSON.stringify((globalThis as any).$scramjetVersion?.build || \"unknown\")};\n\n document.getElementById('copy-button').addEventListener('click', async () => {\n const text = document.getElementById('errorTrace').value;\n await navigator.clipboard.writeText(text);\n const btn = document.getElementById('copy-button');\n btn.textContent = 'Copied!';\n setTimeout(() => btn.textContent = 'Copy', 2000);\n });\n `;\n\n\treturn `<!DOCTYPE html>\n <html>\n <head>\n <meta charset=\"utf-8\" />\n <title>Scramjet</title>\n <style>\n :root {\n --deep: #080602;\n --shallow: #181412;\n --beach: #f1e8e1;\n --shore: #b1a8a1;\n --accent: #ffa938;\n --font-sans: -apple-system, system-ui, BlinkMacSystemFont, sans-serif;\n --font-monospace: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n }\n\n *:not(div,p,span,ul,li,i,span) {\n background-color: var(--deep);\n color: var(--beach);\n font-family: var(--font-sans);\n }\n\n textarea,\n button {\n background-color: var(--shallow);\n border-radius: 0.6em;\n padding: 0.6em;\n border: none;\n appearance: none;\n font-family: var(--font-sans);\n color: var(--beach);\n }\n\n button.primary {\n background-color: var(--accent);\n color: var(--deep);\n font-weight: bold;\n }\n\n textarea {\n resize: none;\n height: 20em;\n text-align: left;\n font-family: var(--font-monospace);\n }\n\n body {\n width: 100vw;\n height: 100vh;\n justify-content: center;\n align-items: center;\n }\n\n body,\n html,\n #inner {\n display: flex;\n align-items: center;\n flex-direction: column;\n gap: 0.5em;\n overflow: hidden;\n }\n\n #inner {\n z-index: 100;\n }\n\n #cover {\n position: absolute;\n width: 100%;\n height: 100%;\n background-color: color-mix(in srgb, var(--deep) 70%, transparent);\n z-index: 99;\n }\n\n #info {\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n gap: 1em;\n }\n\n #version-wrapper {\n width: auto;\n text-align: right;\n position: absolute;\n top: 0.5rem;\n right: 0.5rem;\n font-size: 0.8rem;\n color: var(--shore)!important;\n i {\n background-color: color-mix(in srgb, var(--deep), transparent 50%);\n border-radius: 9999px;\n padding: 0.2em 0.5em;\n }\n z-index: 101;\n }\n\n #errorTrace-wrapper {\n position: relative;\n width: fit-content;\n }\n\n #copy-button {\n position: absolute;\n top: 0.5em;\n right: 0.5em;\n padding: 0.23em;\n cursor: pointer;\n opacity: 0;\n transition: opacity 0.4s;\n font-size: 0.9em;\n }\n\n #errorTrace-wrapper:hover #copy-button {\n opacity: 1;\n }\n </style>\n </head>\n <body>\n <div id=\"cover\"></div>\n <div id=\"inner\">\n <h1 id=\"errorTitle\">Uh oh!</h1>\n <p>There was an error loading <b id=\"fetchedURL\"></b></p>\n <!-- <p id=\"errorMessage\">Internal Server Error</p> -->\n\n <div id=\"info\">\n <div id=\"errorTrace-wrapper\">\n <textarea id=\"errorTrace\" cols=\"40\" rows=\"10\" readonly></textarea>\n <button id=\"copy-button\" class=\"primary\">Copy</button>\n </div>\n <div id=\"troubleshooting\">\n <p>Try:</p>\n <ul>\n <li>Checking your internet connection</li>\n <li>Verifying you entered the correct address</li>\n <li>Clearing the site data</li>\n <li>Contacting <b id=\"hostname\"></b>'s administrator</li>\n <li>Verify the server isn't censored</li>\n </ul>\n <p>If you're the administrator of <b id=\"hostname\"></b>, try:</p>\n <ul>\n <li>Restarting your server</li>\n <li>Updating Scramjet</li>\n <li>Troubleshooting the error on the <a href=\"https://github.com/MercuryWorkshop/scramjet\" target=\"_blank\">GitHub repository</a></li>\n </ul>\n </div>\n </div>\n <br>\n <button id=\"reload\" class=\"primary\">Reload</button>\n </div>\n <p id=\"version-wrapper\"><i>Scramjet v<span id=\"version\"></span> (build <span id=\"build\"></span>)</i></p>\n <script src=\"${\"data:application/javascript,\" + encodeURIComponent(script)}\"></script>\n </body>\n </html>\n `;\n}\n\nexport function renderError(err: unknown, fetchedURL: string) {\n\tconst headers = {\n\t\t\"content-type\": \"text/html\",\n\t};\n\tif (crossOriginIsolated) {\n\t\theaders[\"Cross-Origin-Embedder-Policy\"] = \"require-corp\";\n\t}\n\n\treturn new Response(errorTemplate(String(err), fetchedURL), {\n\t\tstatus: 500,\n\t\theaders: headers,\n\t});\n}\n","import { type MessageW2R, type MessageR2W } from \"@client/swruntime\";\n\nexport class FakeServiceWorker {\n\tsyncToken = 0;\n\tpromises: Record<number, (val?: MessageR2W) => void> = {};\n\tmessageChannel = new MessageChannel();\n\tconnected = false;\n\n\tconstructor(\n\t\tpublic handle: MessagePort,\n\t\tpublic origin: string\n\t) {\n\t\tthis.messageChannel.port1.addEventListener(\"message\", (event) => {\n\t\t\tif (\"scramjet$type\" in event.data) {\n\t\t\t\tif (event.data.scramjet$type === \"init\") {\n\t\t\t\t\tthis.connected = true;\n\t\t\t\t} else {\n\t\t\t\t\tthis.handleMessage(event.data);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis.messageChannel.port1.start();\n\n\t\tthis.handle.postMessage(\n\t\t\t{\n\t\t\t\tscramjet$type: \"init\",\n\t\t\t\tscramjet$port: this.messageChannel.port2,\n\t\t\t},\n\t\t\t[this.messageChannel.port2]\n\t\t);\n\t}\n\n\thandleMessage(data: MessageR2W) {\n\t\tconst cb = this.promises[data.scramjet$token];\n\t\tif (cb) {\n\t\t\tcb(data);\n\t\t\tdelete this.promises[data.scramjet$token];\n\t\t}\n\t}\n\n\tasync fetch(request: Request): Promise<Response | false> {\n\t\tconst token = this.syncToken++;\n\n\t\tconst message: MessageW2R = {\n\t\t\tscramjet$type: \"fetch\",\n\t\t\tscramjet$token: token,\n\t\t\tscramjet$request: {\n\t\t\t\turl: request.url,\n\t\t\t\tbody: request.body,\n\t\t\t\theaders: Array.from(request.headers.entries()),\n\t\t\t\tmethod: request.method,\n\t\t\t\tmode: request.mode,\n\t\t\t\tdestinitation: request.destination,\n\t\t\t},\n\t\t};\n\n\t\tconst transfer = request.body ? [request.body] : [];\n\n\t\tthis.handle.postMessage(message, transfer);\n\n\t\tconst { scramjet$response: r } = (await new Promise((resolve) => {\n\t\t\tthis.promises[token] = resolve;\n\t\t})) as MessageR2W;\n\n\t\tif (!r) return false;\n\n\t\treturn new Response(r.body, {\n\t\t\theaders: r.headers,\n\t\t\tstatus: r.status,\n\t\t\tstatusText: r.statusText,\n\t\t});\n\t}\n}\n","import BareClient, { BareResponseFetch } from \"@mercuryworkshop/bare-mux\";\nimport { MessageW2C, ScramjetServiceWorker } from \"@/worker\";\nimport { renderError } from \"@/worker/error\";\nimport { FakeServiceWorker } from \"@/worker/fakesw\";\nimport { CookieStore } from \"@/shared/cookie\";\n\nimport { getSiteDirective } from \"@/shared/security/siteTests\";\nimport {\n\tinitializeTracker,\n\tupdateTracker,\n\tcleanTracker,\n\tgetMostRestrictiveSite,\n\tstoreReferrerPolicy,\n\tgetReferrerPolicy,\n} from \"@/shared/security/forceReferrer\";\n\nimport { unrewriteBlob, unrewriteUrl, type URLMeta } from \"@rewriters/url\";\nimport { rewriteJs } from \"@rewriters/js\";\nimport { ScramjetHeaders } from \"@/shared/headers\";\nimport { config, flagEnabled } from \"@/shared\";\nimport { rewriteHeaders } from \"@rewriters/headers\";\nimport { rewriteHtml } from \"@rewriters/html\";\nimport { rewriteCss } from \"@rewriters/css\";\nimport { rewriteWorkers } from \"@rewriters/worker\";\nimport { ScramjetDownload } from \"@client/events\";\n\nfunction isRedirect(response: BareResponseFetch) {\n\treturn response.status >= 300 && response.status < 400;\n}\n\nfunction isDownload(responseHeaders: object, destination: string): boolean {\n\tif ([\"document\", \"iframe\"].includes(destination)) {\n\t\tconst header = responseHeaders[\"content-disposition\"];\n\t\tif (header) {\n\t\t\tif (header === \"inline\") {\n\t\t\t\treturn false; // force it to show in browser\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\t// check mime type as fallback\n\t\t\tconst displayableMimes = [\n\t\t\t\t// Text types\n\t\t\t\t\"text/html\",\n\t\t\t\t\"text/plain\",\n\t\t\t\t\"text/css\",\n\t\t\t\t\"text/javascript\",\n\t\t\t\t\"text/xml\",\n\t\t\t\t\"application/javascript\",\n\t\t\t\t\"application/json\",\n\t\t\t\t\"application/xml\",\n\t\t\t\t\"application/pdf\",\n\t\t\t];\n\t\t\tconst contentType = responseHeaders[\"content-type\"]\n\t\t\t\t?.split(\";\")[0]\n\t\t\t\t.trim()\n\t\t\t\t.toLowerCase();\n\t\t\tif (\n\t\t\t\tcontentType &&\n\t\t\t\t!displayableMimes.includes(contentType) &&\n\t\t\t\t!contentType.startsWith(\"text\") &&\n\t\t\t\t!contentType.startsWith(\"image\") &&\n\t\t\t\t!contentType.startsWith(\"font\") &&\n\t\t\t\t!contentType.startsWith(\"video\")\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n}\n\nexport async function handleFetch(\n\tthis: ScramjetServiceWorker,\n\trequest: Request,\n\tclient: Client | null\n) {\n\ttry {\n\t\tconst requestUrl = new URL(request.url);\n\n\t\tif (requestUrl.pathname === this.config.files.wasm) {\n\t\t\treturn fetch(this.config.files.wasm).then(async (x) => {\n\t\t\t\tconst buf = await x.arrayBuffer();\n\t\t\t\tconst b64 = btoa(\n\t\t\t\t\tnew Uint8Array(buf)\n\t\t\t\t\t\t.reduce(\n\t\t\t\t\t\t\t(data, byte) => (data.push(String.fromCharCode(byte)), data),\n\t\t\t\t\t\t\t[]\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join(\"\")\n\t\t\t\t);\n\n\t\t\t\tlet payload = \"\";\n\t\t\t\tpayload +=\n\t\t\t\t\t\"if ('document' in self && document.currentScript) { document.currentScript.remove(); }\\n\";\n\t\t\t\tpayload += `self.WASM = '${b64}';`;\n\n\t\t\t\treturn new Response(payload, {\n\t\t\t\t\theaders: { \"content-type\": \"text/javascript\" },\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tlet scriptType = \"\";\n\t\tlet topFrameName;\n\t\tlet parentFrameName;\n\n\t\tconst extraParams: Record<string, string> = {};\n\t\tfor (const [param, value] of [...requestUrl.searchParams.entries()]) {\n\t\t\tswitch (param) {\n\t\t\t\tcase \"type\":\n\t\t\t\t\tscriptType = value;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"dest\":\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"topFrame\":\n\t\t\t\t\ttopFrameName = value;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"parentFrame\":\n\t\t\t\t\tparentFrameName = value;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tdbg.warn(\n\t\t\t\t\t\t`${requestUrl.href} extraneous query parameter ${param}. Assuming <form> element`\n\t\t\t\t\t);\n\t\t\t\t\textraParams[param] = value;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\trequestUrl.searchParams.delete(param);\n\t\t}\n\n\t\tconst url = new URL(unrewriteUrl(requestUrl));\n\t\t// now that we're past unrewriting it's safe to add back the params\n\t\tfor (const [param, value] of Object.entries(extraParams)) {\n\t\t\turl.searchParams.set(param, value);\n\t\t}\n\n\t\tconst meta: URLMeta = {\n\t\t\torigin: url,\n\t\t\tbase: url,\n\t\t\ttopFrameName,\n\t\t\tparentFrameName,\n\t\t};\n\n\t\tif (\n\t\t\trequestUrl.pathname.startsWith(`${this.config.prefix}blob:`) ||\n\t\t\trequestUrl.pathname.startsWith(`${this.config.prefix}data:`)\n\t\t) {\n\t\t\tlet dataUrl = requestUrl.pathname.substring(this.config.prefix.length);\n\t\t\tif (dataUrl.startsWith(\"blob:\")) {\n\t\t\t\tdataUrl = unrewriteBlob(dataUrl);\n\t\t\t}\n\n\t\t\tconst response: Partial<BareResponseFetch> = await fetch(dataUrl, {});\n\t\t\tconst url = dataUrl.startsWith(\"blob:\") ? dataUrl : \"(data url)\";\n\t\t\tresponse.finalURL = url;\n\t\t\tlet body: BodyType;\n\n\t\t\tif (response.body) {\n\t\t\t\tbody = await rewriteBody(\n\t\t\t\t\tresponse as BareResponseFetch,\n\t\t\t\t\tmeta,\n\t\t\t\t\trequest.destination,\n\t\t\t\t\tscriptType,\n\t\t\t\t\tthis.cookieStore\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst headers = Object.fromEntries(response.headers.entries());\n\n\t\t\tif (crossOriginIsolated) {\n\t\t\t\theaders[\"Cross-Origin-Opener-Policy\"] = \"same-origin\";\n\t\t\t\theaders[\"Cross-Origin-Embedder-Policy\"] = \"require-corp\";\n\t\t\t}\n\n\t\t\treturn new Response(body, {\n\t\t\t\tstatus: response.status,\n\t\t\t\tstatusText: response.statusText,\n\t\t\t\theaders: headers,\n\t\t\t});\n\t\t}\n\n\t\tconst activeWorker: FakeServiceWorker | null = this.serviceWorkers.find(\n\t\t\t(w) => w.origin === url.origin\n\t\t);\n\n\t\tif (\n\t\t\tactiveWorker?.connected &&\n\t\t\trequestUrl.searchParams.get(\"from\") !== \"swruntime\"\n\t\t) {\n\t\t\t// TODO: check scope\n\t\t\tconst r = await activeWorker.fetch(request);\n\t\t\tif (r) return r;\n\t\t}\n\t\tif (url.origin === new URL(request.url).origin) {\n\t\t\tthrow new Error(\n\t\t\t\t\"attempted to fetch from same origin - this means the site has obtained a reference to the real origin, aborting\"\n\t\t\t);\n\t\t}\n\n\t\tconst headers = new ScramjetHeaders();\n\t\tfor (const [key, value] of request.headers.entries()) {\n\t\t\theaders.set(key, value);\n\t\t}\n\n\t\tif (client && new URL(client.url).pathname.startsWith(config.prefix)) {\n\t\t\t// TODO: i was against cors emulation but we might actually break stuff if we send full origin/referrer always\n\t\t\tconst clientURL = new URL(unrewriteUrl(client.url));\n\t\t\tif (clientURL.toString().includes(\"youtube.com\")) {\n\t\t\t\t// console.log(headers);\n\t\t\t} else {\n\t\t\t\t// Force referrer to unsafe-url for all requests\n\t\t\t\theaders.set(\"Referer\", clientURL.href);\n\t\t\t\theaders.set(\"Origin\", clientURL.origin);\n\t\t\t}\n\t\t}\n\n\t\tconst cookies = this.cookieStore.getCookies(url, false);\n\n\t\tif (cookies.length) {\n\t\t\theaders.set(\"Cookie\", cookies);\n\t\t}\n\n\t\t// Check if we should emulate a top-level navigation\n\t\tlet isTopLevelProxyNavigation = false;\n\t\tif (\n\t\t\trequest.destination === \"iframe\" &&\n\t\t\trequest.mode === \"navigate\" &&\n\t\t\trequest.referrer &&\n\t\t\trequest.referrer !== \"no-referrer\" &&\n\t\t\trequest.referrer !== location.origin + config.prefix + \"no-referrer\"\n\t\t) {\n\t\t\t// Trace back through the referrer chain, checking if each was an iframe navigation using the clients, until we find a non-iframe parent on a non-proxy page\n\t\t\tlet currentReferrer = request.referrer;\n\t\t\tconst allClients = await self.clients.matchAll({ type: \"window\" });\n\n\t\t\t// Trace backwards\n\t\t\twhile (currentReferrer) {\n\t\t\t\tif (!currentReferrer.includes(config.prefix)) {\n\t\t\t\t\tisTopLevelProxyNavigation = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Find the parent for this iteration\n\t\t\t\tconst parentChainClient = allClients.find(\n\t\t\t\t\t(c) => c.url === currentReferrer\n\t\t\t\t);\n\n\t\t\t\t// Get the next referrer policy that applies to this parent\n\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\tconst parentPolicyData = await getReferrerPolicy(currentReferrer);\n\n\t\t\t\tif (!parentPolicyData || !parentPolicyData.referrer) {\n\t\t\t\t\t// Check if this ends at the proxy origin\n\t\t\t\t\tif (\n\t\t\t\t\t\tparentChainClient &&\n\t\t\t\t\t\tcurrentReferrer.startsWith(location.origin)\n\t\t\t\t\t) {\n\t\t\t\t\t\tisTopLevelProxyNavigation = true;\n\t\t\t\t\t}\n\t\t\t\t\t// Results are inclusive\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Check if this was an iframe navigation by looking at the client\n\t\t\t\tif (parentChainClient && parentChainClient.frameType === \"nested\") {\n\t\t\t\t\t// Continue checking the chain\n\t\t\t\t\tcurrentReferrer = parentPolicyData.referrer;\n\t\t\t\t} else {\n\t\t\t\t\t// Results are inclusive\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (isTopLevelProxyNavigation) {\n\t\t\theaders.set(\"Sec-Fetch-Dest\", \"document\");\n\t\t\theaders.set(\"Sec-Fetch-Mode\", \"navigate\");\n\t\t} else {\n\t\t\t// Convert empty destination to \"empty\" string per spec\n\t\t\theaders.set(\"Sec-Fetch-Dest\", request.destination || \"empty\");\n\t\t\theaders.set(\"Sec-Fetch-Mode\", request.mode);\n\t\t}\n\n\t\tlet siteDirective = \"none\";\n\t\tif (\n\t\t\trequest.referrer &&\n\t\t\trequest.referrer !== \"\" &&\n\t\t\trequest.referrer !== \"no-referrer\" &&\n\t\t\trequest.referrer !== location.origin + config.prefix + \"no-referrer\"\n\t\t) {\n\t\t\tif (request.referrer.includes(config.prefix)) {\n\t\t\t\tconst unrewrittenReferrer = unrewriteUrl(request.referrer);\n\t\t\t\tif (unrewrittenReferrer) {\n\t\t\t\t\tconst referrerUrl = new URL(unrewrittenReferrer);\n\t\t\t\t\tsiteDirective = await getSiteDirective(\n\t\t\t\t\t\tmeta,\n\t\t\t\t\t\treferrerUrl,\n\t\t\t\t\t\tthis.client\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tawait initializeTracker(\n\t\t\turl.toString(),\n\t\t\trequest.referrer ? unrewriteUrl(request.referrer) : null,\n\t\t\tsiteDirective\n\t\t);\n\n\t\theaders.set(\n\t\t\t\"Sec-Fetch-Site\",\n\t\t\tawait getMostRestrictiveSite(url.toString(), siteDirective)\n\t\t);\n\n\t\tconst ev = new ScramjetRequestEvent(\n\t\t\turl,\n\t\t\theaders.headers,\n\t\t\trequest.body,\n\t\t\trequest.method,\n\t\t\trequest.destination,\n\t\t\tclient\n\t\t);\n\t\tthis.dispatchEvent(ev);\n\n\t\tconst response =\n\t\t\t(await ev.response) ||\n\t\t\t((await this.client.fetch(ev.url, {\n\t\t\t\tmethod: ev.method,\n\t\t\t\tbody: ev.body,\n\t\t\t\theaders: ev.requestHeaders,\n\t\t\t\tcredentials: \"omit\",\n\t\t\t\tmode: request.mode === \"cors\" ? request.mode : \"same-origin\",\n\t\t\t\tcache: request.cache,\n\t\t\t\tredirect: \"manual\",\n\t\t\t\t// @ts-ignore why the fuck is this not typed microsoft\n\t\t\t\tduplex: \"half\",\n\t\t\t})) as BareResponseFetch);\n\t\tresponse.finalURL = ev.url.href;\n\n\t\treturn await handleResponse(\n\t\t\turl,\n\t\t\tmeta,\n\t\t\tscriptType,\n\t\t\trequest.destination,\n\t\t\trequest.mode,\n\t\t\tresponse,\n\t\t\tthis.cookieStore,\n\t\t\tclient,\n\t\t\tthis.client,\n\t\t\tthis,\n\t\t\trequest.referrer\n\t\t);\n\t} catch (err) {\n\t\tconst errorDetails = {\n\t\t\tmessage: err.message,\n\t\t\turl: request.url,\n\t\t\tdestination: request.destination,\n\t\t};\n\t\tif (err.cause) {\n\t\t\terrorDetails[\"cause\"] = err.cause;\n\t\t\tif (err.cause instanceof AggregateError) {\n\t\t\t\terrorDetails[\"causeErrors\"] = err.cause.errors;\n\t\t\t}\n\t\t}\n\t\tif (err.stack) {\n\t\t\terrorDetails[\"stack\"] = err.stack;\n\t\t}\n\n\t\tconsole.error(\"ERROR FROM SERVICE WORKER FETCH: \", errorDetails);\n\t\tconsole.error(err);\n\n\t\tif (![\"document\", \"iframe\"].includes(request.destination))\n\t\t\treturn new Response(undefined, { status: 500 });\n\n\t\tconst formattedError = Object.entries(errorDetails)\n\t\t\t.map(\n\t\t\t\t([key, value]) =>\n\t\t\t\t\t`${key.charAt(0).toUpperCase() + key.slice(1)}: ${value}`\n\t\t\t)\n\t\t\t.join(\"\\n\\n\");\n\n\t\treturn renderError(formattedError, unrewriteUrl(request.url));\n\t}\n}\n\nasync function handleResponse(\n\turl: URL,\n\tmeta: URLMeta,\n\tscriptType: string,\n\tdestination: RequestDestination,\n\tmode: RequestMode,\n\tresponse: BareResponseFetch,\n\tcookieStore: CookieStore,\n\tclient: Client,\n\tbareClient: BareClient,\n\tswtarget: ScramjetServiceWorker,\n\treferrer: string\n): Promise<Response> {\n\tlet responseBody: BodyType;\n\t// response.rawHeaders = {};\n\t// for (let h of response.raw_headers) {\n\t// \tconst key = h[0];\n\t// \tconst value = h[1];\n\t// \tif (response.rawHeaders[key] === undefined) {\n\t// \t\tresponse.rawHeaders[key] = value;\n\t// \t} else if (Array.isArray(response.rawHeaders[key])) {\n\t// \t\t(response.rawHeaders[key] as string[]).push(value);\n\t// \t} else {\n\t// \t\tresponse.rawHeaders[key] = [response.rawHeaders[key] as string, value];\n\t// \t}\n\t// }\n\tconst isNavigationRequest =\n\t\tmode === \"navigate\" && [\"document\", \"iframe\"].includes(destination);\n\tconst responseHeaders = await rewriteHeaders(\n\t\tresponse.rawHeaders,\n\t\tmeta,\n\t\tbareClient,\n\t\t{ get: getReferrerPolicy, set: storeReferrerPolicy }\n\t);\n\n\t// Store referrer policy from navigation responses for Force Referrer\n\tif (isNavigationRequest && responseHeaders[\"referrer-policy\"] && referrer) {\n\t\tawait storeReferrerPolicy(\n\t\t\turl.href,\n\t\t\tresponseHeaders[\"referrer-policy\"],\n\t\t\treferrer\n\t\t);\n\t}\n\n\tif (isRedirect(response)) {\n\t\tconst redirectUrl = new URL(unrewriteUrl(responseHeaders[\"location\"]));\n\n\t\tawait updateTracker(\n\t\t\turl.toString(),\n\t\t\tredirectUrl.toString(),\n\t\t\tresponseHeaders[\"referrer-policy\"]\n\t\t);\n\n\t\tconst redirectMeta = {\n\t\t\torigin: redirectUrl,\n\t\t\tbase: redirectUrl,\n\t\t};\n\t\tconst newSiteDirective = await getSiteDirective(\n\t\t\tredirectMeta,\n\t\t\turl,\n\t\t\tbareClient\n\t\t);\n\t\tawait getMostRestrictiveSite(redirectUrl.toString(), newSiteDirective);\n\n\t\t// ensure that ?type=module is not lost in a redirect\n\t\tif (scriptType) {\n\t\t\tconst url = new URL(responseHeaders[\"location\"]);\n\t\t\turl.searchParams.set(\"type\", scriptType);\n\t\t\tresponseHeaders[\"location\"] = url.href;\n\t\t}\n\t}\n\n\tconst maybeHeaders = responseHeaders[\"set-cookie\"] || [];\n\tfor (const cookie in maybeHeaders) {\n\t\tif (client) {\n\t\t\tconst promise = swtarget.dispatch(client, {\n\t\t\t\tscramjet$type: \"cookie\",\n\t\t\t\tcookie,\n\t\t\t\turl: url.href,\n\t\t\t});\n\t\t\tif (destination !== \"document\" && destination !== \"iframe\") {\n\t\t\t\tawait promise;\n\t\t\t}\n\t\t}\n\t}\n\n\tawait cookieStore.setCookies(\n\t\tmaybeHeaders instanceof Array ? maybeHeaders : [maybeHeaders],\n\t\turl\n\t);\n\n\tfor (const header in responseHeaders) {\n\t\t// flatten everything past here\n\t\tif (Array.isArray(responseHeaders[header]))\n\t\t\tresponseHeaders[header] = responseHeaders[header][0];\n\t}\n\n\tif (isDownload(responseHeaders, destination) && !isRedirect(response)) {\n\t\tif (flagEnabled(\"interceptDownloads\", url)) {\n\t\t\tif (!client) {\n\t\t\t\tthrow new Error(\"cant find client\");\n\t\t\t}\n\t\t\tlet filename: string | null = null;\n\t\t\tconst disp = responseHeaders[\"content-disposition\"];\n\t\t\tif (typeof disp === \"string\") {\n\t\t\t\tconst filenameMatch = disp.match(/filename=[\"']?([^\"';\\n]*)[\"']?/i);\n\t\t\t\tif (filenameMatch && filenameMatch[1]) {\n\t\t\t\t\tfilename = filenameMatch[1];\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst length = responseHeaders[\"content-length\"];\n\n\t\t\t// there's no reliable way of finding the top level client that made the request\n\t\t\t// just take the first one and hope\n\t\t\tlet clis = await clients.matchAll({});\n\t\t\t// only want controller windows\n\t\t\tclis = clis.filter((e) => !e.url.includes(config.prefix));\n\t\t\tif (clis.length < 1) {\n\t\t\t\tthrow Error(\n\t\t\t\t\t\"couldn't find a controller client to dispatch download to\"\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst download: ScramjetDownload = {\n\t\t\t\tfilename,\n\t\t\t\turl: url.href,\n\t\t\t\ttype: responseHeaders[\"content-type\"],\n\t\t\t\tbody: response.body,\n\t\t\t\tlength: Number(length),\n\t\t\t};\n\t\t\tclis[0].postMessage(\n\t\t\t\t{\n\t\t\t\t\tscramjet$type: \"download\",\n\t\t\t\t\tdownload,\n\t\t\t\t} as MessageW2C,\n\t\t\t\t[response.body]\n\t\t\t);\n\n\t\t\t// endless vortex reference\n\t\t\tawait new Promise(() => {});\n\t\t} else {\n\t\t\t// manually rewrite for regular browser download\n\t\t\tconst header = responseHeaders[\"content-disposition\"];\n\n\t\t\t// validate header and test for filename\n\t\t\tif (!/\\s*?((inline|attachment);\\s*?)filename=/i.test(header)) {\n\t\t\t\t// if filename= wasn\"t specified then maybe the remote specified to download this as an attachment?\n\t\t\t\t// if it\"s invalid then we can still possibly test for the attachment/inline type\n\t\t\t\tconst type = /^\\s*?attachment/i.test(header) ? \"attachment\" : \"inline\";\n\n\t\t\t\t// set the filename\n\t\t\t\tconst [filename] = new URL(response.finalURL).pathname\n\t\t\t\t\t.split(\"/\")\n\t\t\t\t\t.slice(-1);\n\n\t\t\t\tresponseHeaders[\"content-disposition\"] =\n\t\t\t\t\t`${type}; filename=${JSON.stringify(filename)}`;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (response.body && !isRedirect(response)) {\n\t\tresponseBody = await rewriteBody(\n\t\t\tresponse,\n\t\t\tmeta,\n\t\t\tdestination,\n\t\t\tscriptType,\n\t\t\tcookieStore\n\t\t);\n\t}\n\n\tif (responseHeaders[\"accept\"] === \"text/event-stream\") {\n\t\tresponseHeaders[\"content-type\"] = \"text/event-stream\";\n\t}\n\n\t// scramjet runtime can use features that permissions-policy blocks\n\tdelete responseHeaders[\"permissions-policy\"];\n\n\tif (\n\t\tcrossOriginIsolated &&\n\t\t[\n\t\t\t\"document\",\n\t\t\t\"iframe\",\n\t\t\t\"worker\",\n\t\t\t\"sharedworker\",\n\t\t\t\"style\",\n\t\t\t\"script\",\n\t\t].includes(destination)\n\t) {\n\t\tresponseHeaders[\"Cross-Origin-Embedder-Policy\"] = \"require-corp\";\n\t\tresponseHeaders[\"Cross-Origin-Opener-Policy\"] = \"same-origin\";\n\t}\n\n\tconst ev = new ScramjetHandleResponseEvent(\n\t\tresponseBody,\n\t\tresponseHeaders,\n\t\tresponse.status,\n\t\tresponse.statusText,\n\t\tdestination,\n\t\turl,\n\t\tresponse,\n\t\tclient\n\t);\n\tswtarget.dispatchEvent(ev);\n\n\t// Clean up tracker if not a redirect\n\tif (!isRedirect(response)) {\n\t\tawait cleanTracker(url.toString());\n\t}\n\n\treturn new Response(ev.responseBody, {\n\t\theaders: ev.responseHeaders as HeadersInit,\n\t\tstatus: ev.status,\n\t\tstatusText: ev.statusText,\n\t});\n}\n\nasync function rewriteBody(\n\tresponse: BareResponseFetch,\n\tmeta: URLMeta,\n\tdestination: RequestDestination,\n\tworkertype: string,\n\tcookieStore: CookieStore\n): Promise<BodyType> {\n\tswitch (destination) {\n\t\tcase \"iframe\":\n\t\tcase \"document\":\n\t\t\tif (response.headers.get(\"content-type\")?.startsWith(\"text/html\")) {\n\t\t\t\t// note from percs: i think this has the potential to be slow asf, but for right now its fine (we should probably look for a better solution)\n\t\t\t\t// another note from percs: regex seems to be broken, gonna comment this out\n\t\t\t\t/*\n const buf = await response.arrayBuffer();\n const decode = new TextDecoder(\"utf-8\").decode(buf);\n const charsetHeader = response.headers.get(\"content-type\");\n const charset =\n charsetHeader?.split(\"charset=\")[1] ||\n decode.match(/charset=([^\"]+)/)?.[1] ||\n \"utf-8\";\n const htmlContent = charset\n ? new TextDecoder(charset).decode(buf)\n : decode;\n */\n\t\t\t\treturn rewriteHtml(await response.text(), cookieStore, meta, true);\n\t\t\t} else {\n\t\t\t\treturn response.body;\n\t\t\t}\n\t\tcase \"script\": {\n\t\t\treturn rewriteJs(\n\t\t\t\tnew Uint8Array(await response.arrayBuffer()),\n\t\t\t\tresponse.finalURL,\n\t\t\t\tmeta,\n\t\t\t\tworkertype === \"module\"\n\t\t\t) as unknown as ArrayBuffer;\n\t\t}\n\t\tcase \"style\":\n\t\t\treturn rewriteCss(await response.text(), meta);\n\t\tcase \"sharedworker\":\n\t\tcase \"worker\":\n\t\t\treturn rewriteWorkers(\n\t\t\t\tnew Uint8Array(await response.arrayBuffer()),\n\t\t\t\tworkertype,\n\t\t\t\tresponse.finalURL,\n\t\t\t\tmeta\n\t\t\t);\n\t\tdefault:\n\t\t\treturn response.body;\n\t}\n}\n\ntype BodyType = string | ArrayBuffer | Blob | ReadableStream<any>;\n\nexport class ScramjetHandleResponseEvent extends Event {\n\tconstructor(\n\t\tpublic responseBody: BodyType,\n\t\tpublic responseHeaders: Record<string, string>,\n\t\tpublic status: number,\n\t\tpublic statusText: string,\n\t\tpublic destination: string,\n\t\tpublic url: URL,\n\t\tpublic rawResponse: BareResponseFetch,\n\t\tpublic client: Client\n\t) {\n\t\tsuper(\"handleResponse\");\n\t}\n}\n\nexport class ScramjetRequestEvent extends Event {\n\tconstructor(\n\t\tpublic url: URL,\n\t\tpublic requestHeaders: Record<string, string>,\n\t\tpublic body: BodyType,\n\t\tpublic method: string,\n\t\tpublic destination: string,\n\t\tpublic client: Client\n\t) {\n\t\tsuper(\"request\");\n\t}\n\tpublic response?: BareResponseFetch | Promise<BareResponseFetch>;\n}\n","/**\n * @fileoverview Contains the core Service Worker logic for Scramjet, which handles the initial request interception and handles client management for the Scramjet service.\n */\n\nimport { FakeServiceWorker } from \"@/worker/fakesw\";\nimport { handleFetch } from \"@/worker/fetch\";\nimport BareClient from \"@mercuryworkshop/bare-mux\";\nimport { ScramjetConfig, ScramjetDB } from \"@/types\";\nimport { asyncSetWasm } from \"@rewriters/wasm\";\nimport { CookieStore } from \"@/shared/cookie\";\nimport { openDB } from \"idb\";\nimport { config, loadCodecs, setConfig } from \"@/shared\";\nimport { ScramjetDownload } from \"@client/events\";\nexport * from \"./error\";\nexport * from \"./fetch\";\nexport * from \"./fakesw\";\n\n/**\n * Main `ScramjetServiceWorker` class created by the `$scramjetLoadWorker` factory, which handles routing the proxy and contains the core logic for request interception.\n */\nexport class ScramjetServiceWorker extends EventTarget {\n\t/**\n\t * `BareClient` instance to fetch requests under a chosen proxy transport.\n\t */\n\tclient: BareClient;\n\t/**\n\t * Current ScramjetConfig saved in memory.\n\t */\n\tconfig: ScramjetConfig;\n\n\t/**\n\t * Recorded sync messages in the message queue.\n\t */\n\tsyncPool: Record<number, (val?: any) => void> = {};\n\t/**\n\t * Current sync token for collected messages in the queue.\n\t */\n\tsynctoken = 0;\n\n\t/**\n\t * Scramjet's cookie jar for cookie emulation through other storage means, connected to a client.\n\t */\n\tcookieStore = new CookieStore();\n\n\t/**\n\t * Fake service worker registrations, so that some sites don't complain.\n\t * This will eventually be replaced with a NestedSW feature under a flag in the future, but this will remain for stability even then.\n\t */\n\tserviceWorkers: FakeServiceWorker[] = [];\n\n\t/**\n\t * Initializes the `BareClient` Scramjet uses to fetch requests under a chosen proxy transport, the cookie jar store for proxifying cookies, and inits the listeners for emulation features and dynamic configs set through the Scramjet Controller.\n\t */\n\tconstructor() {\n\t\tsuper();\n\t\tthis.client = new BareClient();\n\n\t\t(async () => {\n\t\t\tconst db = await openDB<ScramjetDB>(\"$scramjet\", 1);\n\t\t\tconst cookies = await db.get(\"cookies\", \"cookies\");\n\t\t\tif (cookies) {\n\t\t\t\tthis.cookieStore.load(cookies);\n\t\t\t}\n\t\t})();\n\n\t\taddEventListener(\"message\", async ({ data }: { data: MessageC2W }) => {\n\t\t\tif (!(\"scramjet$type\" in data)) return;\n\n\t\t\tif (\"scramjet$token\" in data) {\n\t\t\t\t// (ack message)\n\t\t\t\tconst cb = this.syncPool[data.scramjet$token];\n\t\t\t\tdelete this.syncPool[data.scramjet$token];\n\t\t\t\tcb(data);\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (data.scramjet$type === \"registerServiceWorker\") {\n\t\t\t\tthis.serviceWorkers.push(new FakeServiceWorker(data.port, data.origin));\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (data.scramjet$type === \"cookie\") {\n\t\t\t\tthis.cookieStore.setCookies([data.cookie], new URL(data.url));\n\t\t\t\tconst db = await openDB<ScramjetDB>(\"$scramjet\", 1);\n\t\t\t\tawait db.put(\"cookies\", JSON.parse(this.cookieStore.dump()), \"cookies\");\n\t\t\t}\n\n\t\t\tif (data.scramjet$type === \"loadConfig\") {\n\t\t\t\tthis.config = data.config;\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Dispatches a message in the message queues.\n\t */\n\tasync dispatch(client: Client, data: MessageW2C): Promise<MessageC2W> {\n\t\tconst token = this.synctoken++;\n\t\tlet cb: (val: MessageC2W) => void;\n\t\tconst promise: Promise<MessageC2W> = new Promise((r) => (cb = r));\n\t\tthis.syncPool[token] = cb;\n\t\tdata.scramjet$token = token;\n\n\t\tclient.postMessage(data);\n\n\t\treturn await promise;\n\t}\n\n\t/**\n\t * Persists the current Scramjet config into an IndexedDB store.\n\t * Remember, this is because the Scramjet config can be dynamically updated via the Scramjet Controller APIs.\n\t *\n\t * @example\n\t * self.addEventListener(\"fetch\", async (ev) => {\n\t * await scramjet.loadConfig();\n\t *\n\t * ...\n\t * });\n\t */\n\tasync loadConfig() {\n\t\tif (this.config) return;\n\n\t\tconst db = await openDB<ScramjetDB>(\"$scramjet\", 1);\n\t\tthis.config = await db.get(\"config\", \"config\");\n\n\t\tif (this.config) {\n\t\t\tsetConfig(this.config);\n\t\t\tawait asyncSetWasm();\n\t\t}\n\t}\n\n\t/**\n\t * Whether to route a request from a `FetchEvent` in Scramjet.\n\t *\n\t * @example\n\t * self.addEventListener(\"fetch\", async (ev) => {\n\t * ...\n\t *\n\t * if (scramjet.route(ev)) {\n\t * ...\n\t * }\n\t * });\n\t * ```\n\t */\n\troute({ request }: FetchEvent) {\n\t\tif (request.url.startsWith(location.origin + this.config.prefix))\n\t\t\treturn true;\n\t\telse if (request.url.startsWith(location.origin + this.config.files.wasm))\n\t\t\treturn true;\n\t\telse return false;\n\t}\n\n\t/**\n\t * Handles a `FetchEvent` to be routed in Scramjet.\n\t * This is the heart of adding Scramjet support to your web proxy.\n\t *\n\t * @example\n\t * self.addEventListener(\"fetch\", async (ev) => {\n\t * ...\n\t *\n\t * if (scramjet.route(ev)) {\n\t * ev.respondWith(scramjet.fetch(ev));\n\t * }\n\t * });\n\t */\n\tasync fetch({ request, clientId }: FetchEvent) {\n\t\tif (!this.config) await this.loadConfig();\n\n\t\tconst client = await self.clients.get(clientId);\n\n\t\treturn handleFetch.call(this, request, client);\n\t}\n}\n\n/**\n * Scramjet fake Service Worker event message.\n * Contains a `scramjet$type` for identifying the message.\n */\ntype RegisterServiceWorkerMessage = {\n\tscramjet$type: \"registerServiceWorker\";\n\tport: MessagePort;\n\torigin: string;\n};\n\n/**\n * Scramjet cookie jar event message.\n * Contains a `scramjet$type` for identifying the message.\n */\ntype CookieMessage = {\n\tscramjet$type: \"cookie\";\n\tcookie: string;\n\turl: string;\n};\n\n/**\n * Scramjet config event message.\n * Contains a `scramjet$type` for identifying the message.\n */\ntype ConfigMessage = {\n\tscramjet$type: \"loadConfig\";\n\tconfig: ScramjetConfig;\n};\n\n/**\n * Scramjet proxified download event message.\n * Contains a `scramjet$type` for identifying the message.\n */\ntype DownloadMessage = {\n\tscramjet$type: \"download\";\n\tdownload: ScramjetDownload;\n};\n/**\n * Default Scramjet message.\n * Contains a `scramjet$type` for identifying the message.\n */\ntype MessageCommon = {\n\tscramjet$token?: number;\n};\n\n/**\n * Message types sent from the client to the Service Worker.\n * These are routed by their `scramjet$type` to identify the messages apart from each other.\n */\ntype MessageTypeC2W =\n\t| RegisterServiceWorkerMessage\n\t| CookieMessage\n\t| ConfigMessage;\n/**\n * w2c (types): Message types sent from the Service Worker to the client.\n */\ntype MessageTypeW2C = CookieMessage | DownloadMessage;\n\n/** c2w: client to Service Worker */\nexport type MessageC2W = MessageCommon & MessageTypeC2W;\n/** w2c: Service Worker to client */\nexport type MessageW2C = MessageCommon & MessageTypeW2C;\n","const e=20,t=globalThis.fetch,r=globalThis.SharedWorker,a=globalThis.localStorage,s=globalThis.navigator.serviceWorker,o=MessagePort.prototype.postMessage,n={prototype:{send:WebSocket.prototype.send},CLOSED:WebSocket.CLOSED,CLOSING:WebSocket.CLOSING,CONNECTING:WebSocket.CONNECTING,OPEN:WebSocket.OPEN};async function c(){const e=(await self.clients.matchAll({type:\"window\",includeUncontrolled:!0})).map((async e=>{const t=await function(e){let t=new MessageChannel;return new Promise((r=>{e.postMessage({type:\"getPort\",port:t.port2},[t.port2]),t.port1.onmessage=e=>{r(e.data)}}))}(e);return await i(t),t})),t=Promise.race([Promise.any(e),new Promise(((e,t)=>setTimeout(t,1e3,new TypeError(\"timeout\"))))]);try{return await t}catch(e){if(e instanceof AggregateError)throw console.error(\"bare-mux: failed to get a bare-mux SharedWorker MessagePort as all clients returned an invalid MessagePort.\"),new Error(\"All clients returned an invalid MessagePort.\",{cause:e});return console.warn(\"bare-mux: failed to get a bare-mux SharedWorker MessagePort within 1s, retrying\"),await c()}}function i(e){const t=new MessageChannel,r=new Promise(((e,r)=>{t.port1.onmessage=t=>{\"pong\"===t.data.type&&e()},setTimeout(r,1500)}));return o.call(e,{message:{type:\"ping\"},port:t.port2},[t.port2]),r}function l(e,t){const a=new r(e,\"bare-mux-worker\");return t&&s.addEventListener(\"message\",(t=>{if(\"getPort\"===t.data.type&&t.data.port){console.debug(\"bare-mux: recieved request for port from sw\");const a=new r(e,\"bare-mux-worker\");o.call(t.data.port,a.port,[a.port])}})),a.port}let h=null;function d(){if(null===h){const e=new MessageChannel,t=new ReadableStream;let r;try{o.call(e.port1,t,[t]),r=!0}catch(e){r=!1}return h=r,r}return h}class p{channel;port;workerPath;constructor(e){this.channel=new BroadcastChannel(\"bare-mux\"),e instanceof MessagePort||e instanceof Promise?this.port=e:this.createChannel(e,!0)}createChannel(e,t){if(self.clients)this.port=c(),this.channel.onmessage=e=>{\"refreshPort\"===e.data.type&&(this.port=c())};else if(e&&SharedWorker){if(!e.startsWith(\"/\")&&!e.includes(\":\"))throw new Error(\"Invalid URL. Must be absolute or start at the root.\");this.port=l(e,t),console.debug(\"bare-mux: setting localStorage bare-mux-path to\",e),a[\"bare-mux-path\"]=e}else{if(!SharedWorker)throw new Error(\"Unable to get a channel to the SharedWorker.\");{const e=a[\"bare-mux-path\"];if(console.debug(\"bare-mux: got localStorage bare-mux-path:\",e),!e)throw new Error(\"Unable to get bare-mux workerPath from localStorage.\");this.port=l(e,t)}}}async sendMessage(e,t){this.port instanceof Promise&&(this.port=await this.port);try{await i(this.port)}catch{return console.warn(\"bare-mux: Failed to get a ping response from the worker within 1.5s. Assuming port is dead.\"),this.createChannel(),await this.sendMessage(e,t)}const r=new MessageChannel,a=[r.port2,...t||[]],s=new Promise(((e,t)=>{r.port1.onmessage=r=>{const a=r.data;\"error\"===a.type?t(a.error):e(a)}}));return o.call(this.port,{message:e,port:r.port2},a),await s}}class w extends EventTarget{protocols;url;readyState=n.CONNECTING;channel;constructor(e,t=[],r,a){super(),this.protocols=t,this.url=e.toString(),this.protocols=t;const s=e=>{this.protocols=e,this.readyState=n.OPEN;const t=new Event(\"open\");this.dispatchEvent(t)},o=async e=>{const t=new MessageEvent(\"message\",{data:e});this.dispatchEvent(t)},c=(e,t)=>{this.readyState=n.CLOSED;const r=new CloseEvent(\"close\",{code:e,reason:t});this.dispatchEvent(r)},i=()=>{this.readyState=n.CLOSED;const e=new Event(\"error\");this.dispatchEvent(e)};this.channel=new MessageChannel,this.channel.port1.onmessage=e=>{\"open\"===e.data.type?s(e.data.args[0]):\"message\"===e.data.type?o(e.data.args[0]):\"close\"===e.data.type?c(e.data.args[0],e.data.args[1]):\"error\"===e.data.type&&i()},r.sendMessage({type:\"websocket\",websocket:{url:e.toString(),protocols:t,requestHeaders:a,channel:this.channel.port2}},[this.channel.port2])}send(...e){if(this.readyState===n.CONNECTING)throw new DOMException(\"Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.\");let t=e[0];t.buffer&&(t=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)),o.call(this.channel.port1,{type:\"data\",data:t},t instanceof ArrayBuffer?[t]:[])}close(e,t){o.call(this.channel.port1,{type:\"close\",closeCode:e,closeReason:t})}}function u(e,t,r){console.error(`error while processing '${r}': `,t),e.postMessage({type:\"error\",error:t})}function f(e){for(let t=0;t<e.length;t++){const r=e[t];if(!\"!#$%&'*+-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`abcdefghijklmnopqrstuvwxyz|~\".includes(r))return!1}return!0}const g=[\"ws:\",\"wss:\"],y=[101,204,205,304],b=[301,302,303,307,308];class m{worker;constructor(e){this.worker=new p(e)}async getTransport(){return(await this.worker.sendMessage({type:\"get\"})).name}async setTransport(e,t,r){await this.setManualTransport(`\\n\\t\\t\\tconst { default: BareTransport } = await import(\"${e}\");\\n\\t\\t\\treturn [BareTransport, \"${e}\"];\\n\\t\\t`,t,r)}async setManualTransport(e,t,r){if(\"bare-mux-remote\"===e)throw new Error(\"Use setRemoteTransport.\");await this.worker.sendMessage({type:\"set\",client:{function:e,args:t}},r)}async setRemoteTransport(e,t){const r=new MessageChannel;r.port1.onmessage=async t=>{const r=t.data.port,a=t.data.message;if(\"fetch\"===a.type)try{e.ready||await e.init(),await async function(e,t,r){const a=await r.request(new URL(e.fetch.remote),e.fetch.method,e.fetch.body,e.fetch.headers,null);if(!d()&&a.body instanceof ReadableStream){const e=new Response(a.body);a.body=await e.arrayBuffer()}a.body instanceof ReadableStream||a.body instanceof ArrayBuffer?o.call(t,{type:\"fetch\",fetch:a},[a.body]):o.call(t,{type:\"fetch\",fetch:a})}(a,r,e)}catch(e){u(r,e,\"fetch\")}else if(\"websocket\"===a.type)try{e.ready||await e.init(),await async function(e,t,r){const[a,s]=r.connect(new URL(e.websocket.url),e.websocket.protocols,e.websocket.requestHeaders,(t=>{o.call(e.websocket.channel,{type:\"open\",args:[t]})}),(t=>{t instanceof ArrayBuffer?o.call(e.websocket.channel,{type:\"message\",args:[t]},[t]):o.call(e.websocket.channel,{type:\"message\",args:[t]})}),((t,r)=>{o.call(e.websocket.channel,{type:\"close\",args:[t,r]})}),(t=>{o.call(e.websocket.channel,{type:\"error\",args:[t]})}));e.websocket.channel.onmessage=e=>{\"data\"===e.data.type?a(e.data.data):\"close\"===e.data.type&&s(e.data.closeCode,e.data.closeReason)},o.call(t,{type:\"websocket\"})}(a,r,e)}catch(e){u(r,e,\"websocket\")}},await this.worker.sendMessage({type:\"set\",client:{function:\"bare-mux-remote\",args:[r.port2,t]}},[r.port2])}getInnerPort(){return this.worker.port}}class k{worker;constructor(e){this.worker=new p(e)}createWebSocket(e,t=[],r,a){try{e=new URL(e)}catch(t){throw new DOMException(`Faiiled to construct 'WebSocket': The URL '${e}' is invalid.`)}if(!g.includes(e.protocol))throw new DOMException(`Failed to construct 'WebSocket': The URL's scheme must be either 'ws' or 'wss'. '${e.protocol}' is not allowed.`);Array.isArray(t)||(t=[t]),t=t.map(String);for(const e of t)if(!f(e))throw new DOMException(`Failed to construct 'WebSocket': The subprotocol '${e}' is invalid.`);a=a||{};return new w(e,t,this.worker,a)}async fetch(e,r){const a=new Request(e,r),s=r?.headers||a.headers,o=s instanceof Headers?Object.fromEntries(s):s,n=a.body;let c=new URL(a.url);if(c.protocol.startsWith(\"blob:\")){const e=await t(c),r=new Response(e.body,e);return r.rawHeaders=Object.fromEntries(e.headers),r.rawResponse={body:e.body,headers:Object.fromEntries(e.headers),status:e.status,statusText:e.statusText},r.finalURL=c.toString(),r}for(let e=0;;e++){let t=(await this.worker.sendMessage({type:\"fetch\",fetch:{remote:c.toString(),method:a.method,headers:o,body:n||void 0}},n?[n]:[])).fetch,s=new Response(y.includes(t.status)?void 0:t.body,{headers:new Headers(t.headers),status:t.status,statusText:t.statusText});s.rawHeaders=t.headers,s.rawResponse=t,s.finalURL=c.toString();const i=r?.redirect||a.redirect;if(!b.includes(s.status))return s;switch(i){case\"follow\":{const t=s.headers.get(\"location\");if(20>e&&null!==t){c=new URL(t,c);continue}throw new TypeError(\"Failed to fetch\")}case\"error\":throw new TypeError(\"Failed to fetch\");case\"manual\":return s}}}}console.debug(\"bare-mux: running v2.1.9 (build dc9dc6e)\");export{k as BareClient,m as BareMuxConnection,w as BareWebSocket,n as WebSocketFields,p as WorkerConnection,d as browserSupportsTransferringStreams,k as default,e as maxRedirects,f as validProtocol};\n//# sourceMappingURL=index.mjs.map\n","export const elementNames = new Map([\n \"altGlyph\",\n \"altGlyphDef\",\n \"altGlyphItem\",\n \"animateColor\",\n \"animateMotion\",\n \"animateTransform\",\n \"clipPath\",\n \"feBlend\",\n \"feColorMatrix\",\n \"feComponentTransfer\",\n \"feComposite\",\n \"feConvolveMatrix\",\n \"feDiffuseLighting\",\n \"feDisplacementMap\",\n \"feDistantLight\",\n \"feDropShadow\",\n \"feFlood\",\n \"feFuncA\",\n \"feFuncB\",\n \"feFuncG\",\n \"feFuncR\",\n \"feGaussianBlur\",\n \"feImage\",\n \"feMerge\",\n \"feMergeNode\",\n \"feMorphology\",\n \"feOffset\",\n \"fePointLight\",\n \"feSpecularLighting\",\n \"feSpotLight\",\n \"feTile\",\n \"feTurbulence\",\n \"foreignObject\",\n \"glyphRef\",\n \"linearGradient\",\n \"radialGradient\",\n \"textPath\",\n].map((val) => [val.toLowerCase(), val]));\nexport const attributeNames = new Map([\n \"definitionURL\",\n \"attributeName\",\n \"attributeType\",\n \"baseFrequency\",\n \"baseProfile\",\n \"calcMode\",\n \"clipPathUnits\",\n \"diffuseConstant\",\n \"edgeMode\",\n \"filterUnits\",\n \"glyphRef\",\n \"gradientTransform\",\n \"gradientUnits\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keyPoints\",\n \"keySplines\",\n \"keyTimes\",\n \"lengthAdjust\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerUnits\",\n \"markerWidth\",\n \"maskContentUnits\",\n \"maskUnits\",\n \"numOctaves\",\n \"pathLength\",\n \"patternContentUnits\",\n \"patternTransform\",\n \"patternUnits\",\n \"pointsAtX\",\n \"pointsAtY\",\n \"pointsAtZ\",\n \"preserveAlpha\",\n \"preserveAspectRatio\",\n \"primitiveUnits\",\n \"refX\",\n \"refY\",\n \"repeatCount\",\n \"repeatDur\",\n \"requiredExtensions\",\n \"requiredFeatures\",\n \"specularConstant\",\n \"specularExponent\",\n \"spreadMethod\",\n \"startOffset\",\n \"stdDeviation\",\n \"stitchTiles\",\n \"surfaceScale\",\n \"systemLanguage\",\n \"tableValues\",\n \"targetX\",\n \"targetY\",\n \"textLength\",\n \"viewBox\",\n \"viewTarget\",\n \"xChannelSelector\",\n \"yChannelSelector\",\n \"zoomAndPan\",\n].map((val) => [val.toLowerCase(), val]));\n","/*\n * Module dependencies\n */\nimport * as ElementType from \"domelementtype\";\nimport { encodeXML, escapeAttribute, escapeText } from \"entities\";\n/**\n * Mixed-case SVG and MathML tags & attributes\n * recognized by the HTML parser.\n *\n * @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign\n */\nimport { elementNames, attributeNames } from \"./foreignNames.js\";\nconst unencodedElements = new Set([\n \"style\",\n \"script\",\n \"xmp\",\n \"iframe\",\n \"noembed\",\n \"noframes\",\n \"plaintext\",\n \"noscript\",\n]);\nfunction replaceQuotes(value) {\n return value.replace(/\"/g, \""\");\n}\n/**\n * Format attributes\n */\nfunction formatAttributes(attributes, opts) {\n var _a;\n if (!attributes)\n return;\n const encode = ((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) === false\n ? replaceQuotes\n : opts.xmlMode || opts.encodeEntities !== \"utf8\"\n ? encodeXML\n : escapeAttribute;\n return Object.keys(attributes)\n .map((key) => {\n var _a, _b;\n const value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : \"\";\n if (opts.xmlMode === \"foreign\") {\n /* Fix up mixed-case attribute names */\n key = (_b = attributeNames.get(key)) !== null && _b !== void 0 ? _b : key;\n }\n if (!opts.emptyAttrs && !opts.xmlMode && value === \"\") {\n return key;\n }\n return `${key}=\"${encode(value)}\"`;\n })\n .join(\" \");\n}\n/**\n * Self-enclosing tags\n */\nconst singleTag = new Set([\n \"area\",\n \"base\",\n \"basefont\",\n \"br\",\n \"col\",\n \"command\",\n \"embed\",\n \"frame\",\n \"hr\",\n \"img\",\n \"input\",\n \"isindex\",\n \"keygen\",\n \"link\",\n \"meta\",\n \"param\",\n \"source\",\n \"track\",\n \"wbr\",\n]);\n/**\n * Renders a DOM node or an array of DOM nodes to a string.\n *\n * Can be thought of as the equivalent of the `outerHTML` of the passed node(s).\n *\n * @param node Node to be rendered.\n * @param options Changes serialization behavior\n */\nexport function render(node, options = {}) {\n const nodes = \"length\" in node ? node : [node];\n let output = \"\";\n for (let i = 0; i < nodes.length; i++) {\n output += renderNode(nodes[i], options);\n }\n return output;\n}\nexport default render;\nfunction renderNode(node, options) {\n switch (node.type) {\n case ElementType.Root:\n return render(node.children, options);\n // @ts-expect-error We don't use `Doctype` yet\n case ElementType.Doctype:\n case ElementType.Directive:\n return renderDirective(node);\n case ElementType.Comment:\n return renderComment(node);\n case ElementType.CDATA:\n return renderCdata(node);\n case ElementType.Script:\n case ElementType.Style:\n case ElementType.Tag:\n return renderTag(node, options);\n case ElementType.Text:\n return renderText(node, options);\n }\n}\nconst foreignModeIntegrationPoints = new Set([\n \"mi\",\n \"mo\",\n \"mn\",\n \"ms\",\n \"mtext\",\n \"annotation-xml\",\n \"foreignObject\",\n \"desc\",\n \"title\",\n]);\nconst foreignElements = new Set([\"svg\", \"math\"]);\nfunction renderTag(elem, opts) {\n var _a;\n // Handle SVG / MathML in HTML\n if (opts.xmlMode === \"foreign\") {\n /* Fix up mixed-case element names */\n elem.name = (_a = elementNames.get(elem.name)) !== null && _a !== void 0 ? _a : elem.name;\n /* Exit foreign mode at integration points */\n if (elem.parent &&\n foreignModeIntegrationPoints.has(elem.parent.name)) {\n opts = { ...opts, xmlMode: false };\n }\n }\n if (!opts.xmlMode && foreignElements.has(elem.name)) {\n opts = { ...opts, xmlMode: \"foreign\" };\n }\n let tag = `<${elem.name}`;\n const attribs = formatAttributes(elem.attribs, opts);\n if (attribs) {\n tag += ` ${attribs}`;\n }\n if (elem.children.length === 0 &&\n (opts.xmlMode\n ? // In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags\n opts.selfClosingTags !== false\n : // User explicitly asked for self-closing tags, even in HTML mode\n opts.selfClosingTags && singleTag.has(elem.name))) {\n if (!opts.xmlMode)\n tag += \" \";\n tag += \"/>\";\n }\n else {\n tag += \">\";\n if (elem.children.length > 0) {\n tag += render(elem.children, opts);\n }\n if (opts.xmlMode || !singleTag.has(elem.name)) {\n tag += `</${elem.name}>`;\n }\n }\n return tag;\n}\nfunction renderDirective(elem) {\n return `<${elem.data}>`;\n}\nfunction renderText(elem, opts) {\n var _a;\n let data = elem.data || \"\";\n // If entities weren't decoded, no need to encode them back\n if (((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) !== false &&\n !(!opts.xmlMode &&\n elem.parent &&\n unencodedElements.has(elem.parent.name))) {\n data =\n opts.xmlMode || opts.encodeEntities !== \"utf8\"\n ? encodeXML(data)\n : escapeText(data);\n }\n return data;\n}\nfunction renderCdata(elem) {\n return `<![CDATA[${elem.children[0].data}]]>`;\n}\nfunction renderComment(elem) {\n return `<!--${elem.data}-->`;\n}\n","/** Types of elements found in htmlparser2's DOM */\nexport var ElementType;\n(function (ElementType) {\n /** Type for the root element of a document */\n ElementType[\"Root\"] = \"root\";\n /** Type for Text */\n ElementType[\"Text\"] = \"text\";\n /** Type for <? ... ?> */\n ElementType[\"Directive\"] = \"directive\";\n /** Type for <!-- ... --> */\n ElementType[\"Comment\"] = \"comment\";\n /** Type for <script> tags */\n ElementType[\"Script\"] = \"script\";\n /** Type for <style> tags */\n ElementType[\"Style\"] = \"style\";\n /** Type for Any tag */\n ElementType[\"Tag\"] = \"tag\";\n /** Type for <![CDATA[ ... ]]> */\n ElementType[\"CDATA\"] = \"cdata\";\n /** Type for <!doctype ...> */\n ElementType[\"Doctype\"] = \"doctype\";\n})(ElementType || (ElementType = {}));\n/**\n * Tests whether an element is a tag or not.\n *\n * @param elem Element to test\n */\nexport function isTag(elem) {\n return (elem.type === ElementType.Tag ||\n elem.type === ElementType.Script ||\n elem.type === ElementType.Style);\n}\n// Exports for backwards compatibility\n/** Type for the root element of a document */\nexport const Root = ElementType.Root;\n/** Type for Text */\nexport const Text = ElementType.Text;\n/** Type for <? ... ?> */\nexport const Directive = ElementType.Directive;\n/** Type for <!-- ... --> */\nexport const Comment = ElementType.Comment;\n/** Type for <script> tags */\nexport const Script = ElementType.Script;\n/** Type for <style> tags */\nexport const Style = ElementType.Style;\n/** Type for Any tag */\nexport const Tag = ElementType.Tag;\n/** Type for <![CDATA[ ... ]]> */\nexport const CDATA = ElementType.CDATA;\n/** Type for <!doctype ...> */\nexport const Doctype = ElementType.Doctype;\n","import { ElementType } from \"domelementtype\";\nimport { Element, Text, Comment, CDATA, Document, ProcessingInstruction, } from \"./node.js\";\nexport * from \"./node.js\";\n// Default options\nconst defaultOpts = {\n withStartIndices: false,\n withEndIndices: false,\n xmlMode: false,\n};\nexport class DomHandler {\n /**\n * @param callback Called once parsing has completed.\n * @param options Settings for the handler.\n * @param elementCB Callback whenever a tag is closed.\n */\n constructor(callback, options, elementCB) {\n /** The elements of the DOM */\n this.dom = [];\n /** The root element for the DOM */\n this.root = new Document(this.dom);\n /** Indicated whether parsing has been completed. */\n this.done = false;\n /** Stack of open tags. */\n this.tagStack = [this.root];\n /** A data node that is still being written to. */\n this.lastNode = null;\n /** Reference to the parser instance. Used for location information. */\n this.parser = null;\n // Make it possible to skip arguments, for backwards-compatibility\n if (typeof options === \"function\") {\n elementCB = options;\n options = defaultOpts;\n }\n if (typeof callback === \"object\") {\n options = callback;\n callback = undefined;\n }\n this.callback = callback !== null && callback !== void 0 ? callback : null;\n this.options = options !== null && options !== void 0 ? options : defaultOpts;\n this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null;\n }\n onparserinit(parser) {\n this.parser = parser;\n }\n // Resets the handler back to starting state\n onreset() {\n this.dom = [];\n this.root = new Document(this.dom);\n this.done = false;\n this.tagStack = [this.root];\n this.lastNode = null;\n this.parser = null;\n }\n // Signals the handler that parsing is done\n onend() {\n if (this.done)\n return;\n this.done = true;\n this.parser = null;\n this.handleCallback(null);\n }\n onerror(error) {\n this.handleCallback(error);\n }\n onclosetag() {\n this.lastNode = null;\n const elem = this.tagStack.pop();\n if (this.options.withEndIndices) {\n elem.endIndex = this.parser.endIndex;\n }\n if (this.elementCB)\n this.elementCB(elem);\n }\n onopentag(name, attribs) {\n const type = this.options.xmlMode ? ElementType.Tag : undefined;\n const element = new Element(name, attribs, undefined, type);\n this.addNode(element);\n this.tagStack.push(element);\n }\n ontext(data) {\n const { lastNode } = this;\n if (lastNode && lastNode.type === ElementType.Text) {\n lastNode.data += data;\n if (this.options.withEndIndices) {\n lastNode.endIndex = this.parser.endIndex;\n }\n }\n else {\n const node = new Text(data);\n this.addNode(node);\n this.lastNode = node;\n }\n }\n oncomment(data) {\n if (this.lastNode && this.lastNode.type === ElementType.Comment) {\n this.lastNode.data += data;\n return;\n }\n const node = new Comment(data);\n this.addNode(node);\n this.lastNode = node;\n }\n oncommentend() {\n this.lastNode = null;\n }\n oncdatastart() {\n const text = new Text(\"\");\n const node = new CDATA([text]);\n this.addNode(node);\n text.parent = node;\n this.lastNode = text;\n }\n oncdataend() {\n this.lastNode = null;\n }\n onprocessinginstruction(name, data) {\n const node = new ProcessingInstruction(name, data);\n this.addNode(node);\n }\n handleCallback(error) {\n if (typeof this.callback === \"function\") {\n this.callback(error, this.dom);\n }\n else if (error) {\n throw error;\n }\n }\n addNode(node) {\n const parent = this.tagStack[this.tagStack.length - 1];\n const previousSibling = parent.children[parent.children.length - 1];\n if (this.options.withStartIndices) {\n node.startIndex = this.parser.startIndex;\n }\n if (this.options.withEndIndices) {\n node.endIndex = this.parser.endIndex;\n }\n parent.children.push(node);\n if (previousSibling) {\n node.prev = previousSibling;\n previousSibling.next = node;\n }\n node.parent = parent;\n this.lastNode = null;\n }\n}\nexport default DomHandler;\n","import { ElementType, isTag as isTagRaw } from \"domelementtype\";\n/**\n * This object will be used as the prototype for Nodes when creating a\n * DOM-Level-1-compliant structure.\n */\nexport class Node {\n constructor() {\n /** Parent of the node */\n this.parent = null;\n /** Previous sibling */\n this.prev = null;\n /** Next sibling */\n this.next = null;\n /** The start index of the node. Requires `withStartIndices` on the handler to be `true. */\n this.startIndex = null;\n /** The end index of the node. Requires `withEndIndices` on the handler to be `true. */\n this.endIndex = null;\n }\n // Read-write aliases for properties\n /**\n * Same as {@link parent}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get parentNode() {\n return this.parent;\n }\n set parentNode(parent) {\n this.parent = parent;\n }\n /**\n * Same as {@link prev}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get previousSibling() {\n return this.prev;\n }\n set previousSibling(prev) {\n this.prev = prev;\n }\n /**\n * Same as {@link next}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get nextSibling() {\n return this.next;\n }\n set nextSibling(next) {\n this.next = next;\n }\n /**\n * Clone this node, and optionally its children.\n *\n * @param recursive Clone child nodes as well.\n * @returns A clone of the node.\n */\n cloneNode(recursive = false) {\n return cloneNode(this, recursive);\n }\n}\n/**\n * A node that contains some data.\n */\nexport class DataNode extends Node {\n /**\n * @param data The content of the data node\n */\n constructor(data) {\n super();\n this.data = data;\n }\n /**\n * Same as {@link data}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get nodeValue() {\n return this.data;\n }\n set nodeValue(data) {\n this.data = data;\n }\n}\n/**\n * Text within the document.\n */\nexport class Text extends DataNode {\n constructor() {\n super(...arguments);\n this.type = ElementType.Text;\n }\n get nodeType() {\n return 3;\n }\n}\n/**\n * Comments within the document.\n */\nexport class Comment extends DataNode {\n constructor() {\n super(...arguments);\n this.type = ElementType.Comment;\n }\n get nodeType() {\n return 8;\n }\n}\n/**\n * Processing instructions, including doc types.\n */\nexport class ProcessingInstruction extends DataNode {\n constructor(name, data) {\n super(data);\n this.name = name;\n this.type = ElementType.Directive;\n }\n get nodeType() {\n return 1;\n }\n}\n/**\n * A `Node` that can have children.\n */\nexport class NodeWithChildren extends Node {\n /**\n * @param children Children of the node. Only certain node types can have children.\n */\n constructor(children) {\n super();\n this.children = children;\n }\n // Aliases\n /** First child of the node. */\n get firstChild() {\n var _a;\n return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;\n }\n /** Last child of the node. */\n get lastChild() {\n return this.children.length > 0\n ? this.children[this.children.length - 1]\n : null;\n }\n /**\n * Same as {@link children}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get childNodes() {\n return this.children;\n }\n set childNodes(children) {\n this.children = children;\n }\n}\nexport class CDATA extends NodeWithChildren {\n constructor() {\n super(...arguments);\n this.type = ElementType.CDATA;\n }\n get nodeType() {\n return 4;\n }\n}\n/**\n * The root node of the document.\n */\nexport class Document extends NodeWithChildren {\n constructor() {\n super(...arguments);\n this.type = ElementType.Root;\n }\n get nodeType() {\n return 9;\n }\n}\n/**\n * An element within the DOM.\n */\nexport class Element extends NodeWithChildren {\n /**\n * @param name Name of the tag, eg. `div`, `span`.\n * @param attribs Object mapping attribute names to attribute values.\n * @param children Children of the node.\n */\n constructor(name, attribs, children = [], type = name === \"script\"\n ? ElementType.Script\n : name === \"style\"\n ? ElementType.Style\n : ElementType.Tag) {\n super(children);\n this.name = name;\n this.attribs = attribs;\n this.type = type;\n }\n get nodeType() {\n return 1;\n }\n // DOM Level 1 aliases\n /**\n * Same as {@link name}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get tagName() {\n return this.name;\n }\n set tagName(name) {\n this.name = name;\n }\n get attributes() {\n return Object.keys(this.attribs).map((name) => {\n var _a, _b;\n return ({\n name,\n value: this.attribs[name],\n namespace: (_a = this[\"x-attribsNamespace\"]) === null || _a === void 0 ? void 0 : _a[name],\n prefix: (_b = this[\"x-attribsPrefix\"]) === null || _b === void 0 ? void 0 : _b[name],\n });\n });\n }\n}\n/**\n * @param node Node to check.\n * @returns `true` if the node is a `Element`, `false` otherwise.\n */\nexport function isTag(node) {\n return isTagRaw(node);\n}\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `CDATA`, `false` otherwise.\n */\nexport function isCDATA(node) {\n return node.type === ElementType.CDATA;\n}\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `Text`, `false` otherwise.\n */\nexport function isText(node) {\n return node.type === ElementType.Text;\n}\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `Comment`, `false` otherwise.\n */\nexport function isComment(node) {\n return node.type === ElementType.Comment;\n}\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.\n */\nexport function isDirective(node) {\n return node.type === ElementType.Directive;\n}\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.\n */\nexport function isDocument(node) {\n return node.type === ElementType.Root;\n}\n/**\n * @param node Node to check.\n * @returns `true` if the node has children, `false` otherwise.\n */\nexport function hasChildren(node) {\n return Object.prototype.hasOwnProperty.call(node, \"children\");\n}\n/**\n * Clone a node, and optionally its children.\n *\n * @param recursive Clone child nodes as well.\n * @returns A clone of the node.\n */\nexport function cloneNode(node, recursive = false) {\n let result;\n if (isText(node)) {\n result = new Text(node.data);\n }\n else if (isComment(node)) {\n result = new Comment(node.data);\n }\n else if (isTag(node)) {\n const children = recursive ? cloneChildren(node.children) : [];\n const clone = new Element(node.name, { ...node.attribs }, children);\n children.forEach((child) => (child.parent = clone));\n if (node.namespace != null) {\n clone.namespace = node.namespace;\n }\n if (node[\"x-attribsNamespace\"]) {\n clone[\"x-attribsNamespace\"] = { ...node[\"x-attribsNamespace\"] };\n }\n if (node[\"x-attribsPrefix\"]) {\n clone[\"x-attribsPrefix\"] = { ...node[\"x-attribsPrefix\"] };\n }\n result = clone;\n }\n else if (isCDATA(node)) {\n const children = recursive ? cloneChildren(node.children) : [];\n const clone = new CDATA(children);\n children.forEach((child) => (child.parent = clone));\n result = clone;\n }\n else if (isDocument(node)) {\n const children = recursive ? cloneChildren(node.children) : [];\n const clone = new Document(children);\n children.forEach((child) => (child.parent = clone));\n if (node[\"x-mode\"]) {\n clone[\"x-mode\"] = node[\"x-mode\"];\n }\n result = clone;\n }\n else if (isDirective(node)) {\n const instruction = new ProcessingInstruction(node.name, node.data);\n if (node[\"x-name\"] != null) {\n instruction[\"x-name\"] = node[\"x-name\"];\n instruction[\"x-publicId\"] = node[\"x-publicId\"];\n instruction[\"x-systemId\"] = node[\"x-systemId\"];\n }\n result = instruction;\n }\n else {\n throw new Error(`Not implemented yet: ${node.type}`);\n }\n result.startIndex = node.startIndex;\n result.endIndex = node.endIndex;\n if (node.sourceCodeLocation != null) {\n result.sourceCodeLocation = node.sourceCodeLocation;\n }\n return result;\n}\nfunction cloneChildren(childs) {\n const children = childs.map((child) => cloneNode(child, true));\n for (let i = 1; i < children.length; i++) {\n children[i].prev = children[i - 1];\n children[i - 1].next = children[i];\n }\n return children;\n}\n","import { hasChildren } from \"domhandler\";\n/**\n * Given an array of nodes, remove any member that is contained by another\n * member.\n *\n * @category Helpers\n * @param nodes Nodes to filter.\n * @returns Remaining nodes that aren't contained by other nodes.\n */\nexport function removeSubsets(nodes) {\n let idx = nodes.length;\n /*\n * Check if each node (or one of its ancestors) is already contained in the\n * array.\n */\n while (--idx >= 0) {\n const node = nodes[idx];\n /*\n * Remove the node if it is not unique.\n * We are going through the array from the end, so we only\n * have to check nodes that preceed the node under consideration in the array.\n */\n if (idx > 0 && nodes.lastIndexOf(node, idx - 1) >= 0) {\n nodes.splice(idx, 1);\n continue;\n }\n for (let ancestor = node.parent; ancestor; ancestor = ancestor.parent) {\n if (nodes.includes(ancestor)) {\n nodes.splice(idx, 1);\n break;\n }\n }\n }\n return nodes;\n}\n/**\n * @category Helpers\n * @see {@link http://dom.spec.whatwg.org/#dom-node-comparedocumentposition}\n */\nexport var DocumentPosition;\n(function (DocumentPosition) {\n DocumentPosition[DocumentPosition[\"DISCONNECTED\"] = 1] = \"DISCONNECTED\";\n DocumentPosition[DocumentPosition[\"PRECEDING\"] = 2] = \"PRECEDING\";\n DocumentPosition[DocumentPosition[\"FOLLOWING\"] = 4] = \"FOLLOWING\";\n DocumentPosition[DocumentPosition[\"CONTAINS\"] = 8] = \"CONTAINS\";\n DocumentPosition[DocumentPosition[\"CONTAINED_BY\"] = 16] = \"CONTAINED_BY\";\n})(DocumentPosition || (DocumentPosition = {}));\n/**\n * Compare the position of one node against another node in any other document,\n * returning a bitmask with the values from {@link DocumentPosition}.\n *\n * Document order:\n * > There is an ordering, document order, defined on all the nodes in the\n * > document corresponding to the order in which the first character of the\n * > XML representation of each node occurs in the XML representation of the\n * > document after expansion of general entities. Thus, the document element\n * > node will be the first node. Element nodes occur before their children.\n * > Thus, document order orders element nodes in order of the occurrence of\n * > their start-tag in the XML (after expansion of entities). The attribute\n * > nodes of an element occur after the element and before its children. The\n * > relative order of attribute nodes is implementation-dependent.\n *\n * Source:\n * http://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-order\n *\n * @category Helpers\n * @param nodeA The first node to use in the comparison\n * @param nodeB The second node to use in the comparison\n * @returns A bitmask describing the input nodes' relative position.\n *\n * See http://dom.spec.whatwg.org/#dom-node-comparedocumentposition for\n * a description of these values.\n */\nexport function compareDocumentPosition(nodeA, nodeB) {\n const aParents = [];\n const bParents = [];\n if (nodeA === nodeB) {\n return 0;\n }\n let current = hasChildren(nodeA) ? nodeA : nodeA.parent;\n while (current) {\n aParents.unshift(current);\n current = current.parent;\n }\n current = hasChildren(nodeB) ? nodeB : nodeB.parent;\n while (current) {\n bParents.unshift(current);\n current = current.parent;\n }\n const maxIdx = Math.min(aParents.length, bParents.length);\n let idx = 0;\n while (idx < maxIdx && aParents[idx] === bParents[idx]) {\n idx++;\n }\n if (idx === 0) {\n return DocumentPosition.DISCONNECTED;\n }\n const sharedParent = aParents[idx - 1];\n const siblings = sharedParent.children;\n const aSibling = aParents[idx];\n const bSibling = bParents[idx];\n if (siblings.indexOf(aSibling) > siblings.indexOf(bSibling)) {\n if (sharedParent === nodeB) {\n return DocumentPosition.FOLLOWING | DocumentPosition.CONTAINED_BY;\n }\n return DocumentPosition.FOLLOWING;\n }\n if (sharedParent === nodeA) {\n return DocumentPosition.PRECEDING | DocumentPosition.CONTAINS;\n }\n return DocumentPosition.PRECEDING;\n}\n/**\n * Sort an array of nodes based on their relative position in the document,\n * removing any duplicate nodes. If the array contains nodes that do not belong\n * to the same document, sort order is unspecified.\n *\n * @category Helpers\n * @param nodes Array of DOM nodes.\n * @returns Collection of unique nodes, sorted in document order.\n */\nexport function uniqueSort(nodes) {\n nodes = nodes.filter((node, i, arr) => !arr.includes(node, i + 1));\n nodes.sort((a, b) => {\n const relative = compareDocumentPosition(a, b);\n if (relative & DocumentPosition.PRECEDING) {\n return -1;\n }\n else if (relative & DocumentPosition.FOLLOWING) {\n return 1;\n }\n return 0;\n });\n return nodes;\n}\n//# sourceMappingURL=helpers.js.map","// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134\nvar _a;\nconst decodeMap = new Map([\n [0, 65533],\n // C1 Unicode control character reference replacements\n [128, 8364],\n [130, 8218],\n [131, 402],\n [132, 8222],\n [133, 8230],\n [134, 8224],\n [135, 8225],\n [136, 710],\n [137, 8240],\n [138, 352],\n [139, 8249],\n [140, 338],\n [142, 381],\n [145, 8216],\n [146, 8217],\n [147, 8220],\n [148, 8221],\n [149, 8226],\n [150, 8211],\n [151, 8212],\n [152, 732],\n [153, 8482],\n [154, 353],\n [155, 8250],\n [156, 339],\n [158, 382],\n [159, 376],\n]);\n/**\n * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point.\n */\nexport const fromCodePoint = \n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, n/no-unsupported-features/es-builtins\n(_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function (codePoint) {\n let output = \"\";\n if (codePoint > 65535) {\n codePoint -= 65536;\n output += String.fromCharCode(((codePoint >>> 10) & 1023) | 55296);\n codePoint = 56320 | (codePoint & 1023);\n }\n output += String.fromCharCode(codePoint);\n return output;\n};\n/**\n * Replace the given code point with a replacement character if it is a\n * surrogate or is outside the valid range. Otherwise return the code\n * point unchanged.\n */\nexport function replaceCodePoint(codePoint) {\n var _a;\n if ((codePoint >= 55296 && codePoint <= 57343) ||\n codePoint > 1114111) {\n return 65533;\n }\n return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint;\n}\n/**\n * Replace the code point if relevant, then convert it to a string.\n *\n * @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead.\n * @param codePoint The code point to decode.\n * @returns The decoded code point.\n */\nexport function decodeCodePoint(codePoint) {\n return fromCodePoint(replaceCodePoint(codePoint));\n}\n//# sourceMappingURL=decode-codepoint.js.map","import { htmlDecodeTree } from \"./generated/decode-data-html.js\";\nimport { xmlDecodeTree } from \"./generated/decode-data-xml.js\";\nimport { replaceCodePoint, fromCodePoint } from \"./decode-codepoint.js\";\nvar CharCodes;\n(function (CharCodes) {\n CharCodes[CharCodes[\"NUM\"] = 35] = \"NUM\";\n CharCodes[CharCodes[\"SEMI\"] = 59] = \"SEMI\";\n CharCodes[CharCodes[\"EQUALS\"] = 61] = \"EQUALS\";\n CharCodes[CharCodes[\"ZERO\"] = 48] = \"ZERO\";\n CharCodes[CharCodes[\"NINE\"] = 57] = \"NINE\";\n CharCodes[CharCodes[\"LOWER_A\"] = 97] = \"LOWER_A\";\n CharCodes[CharCodes[\"LOWER_F\"] = 102] = \"LOWER_F\";\n CharCodes[CharCodes[\"LOWER_X\"] = 120] = \"LOWER_X\";\n CharCodes[CharCodes[\"LOWER_Z\"] = 122] = \"LOWER_Z\";\n CharCodes[CharCodes[\"UPPER_A\"] = 65] = \"UPPER_A\";\n CharCodes[CharCodes[\"UPPER_F\"] = 70] = \"UPPER_F\";\n CharCodes[CharCodes[\"UPPER_Z\"] = 90] = \"UPPER_Z\";\n})(CharCodes || (CharCodes = {}));\n/** Bit that needs to be set to convert an upper case ASCII character to lower case */\nconst TO_LOWER_BIT = 32;\nexport var BinTrieFlags;\n(function (BinTrieFlags) {\n BinTrieFlags[BinTrieFlags[\"VALUE_LENGTH\"] = 49152] = \"VALUE_LENGTH\";\n BinTrieFlags[BinTrieFlags[\"BRANCH_LENGTH\"] = 16256] = \"BRANCH_LENGTH\";\n BinTrieFlags[BinTrieFlags[\"JUMP_TABLE\"] = 127] = \"JUMP_TABLE\";\n})(BinTrieFlags || (BinTrieFlags = {}));\nfunction isNumber(code) {\n return code >= CharCodes.ZERO && code <= CharCodes.NINE;\n}\nfunction isHexadecimalCharacter(code) {\n return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F) ||\n (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F));\n}\nfunction isAsciiAlphaNumeric(code) {\n return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z) ||\n (code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z) ||\n isNumber(code));\n}\n/**\n * Checks if the given character is a valid end character for an entity in an attribute.\n *\n * Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error.\n * See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state\n */\nfunction isEntityInAttributeInvalidEnd(code) {\n return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code);\n}\nvar EntityDecoderState;\n(function (EntityDecoderState) {\n EntityDecoderState[EntityDecoderState[\"EntityStart\"] = 0] = \"EntityStart\";\n EntityDecoderState[EntityDecoderState[\"NumericStart\"] = 1] = \"NumericStart\";\n EntityDecoderState[EntityDecoderState[\"NumericDecimal\"] = 2] = \"NumericDecimal\";\n EntityDecoderState[EntityDecoderState[\"NumericHex\"] = 3] = \"NumericHex\";\n EntityDecoderState[EntityDecoderState[\"NamedEntity\"] = 4] = \"NamedEntity\";\n})(EntityDecoderState || (EntityDecoderState = {}));\nexport var DecodingMode;\n(function (DecodingMode) {\n /** Entities in text nodes that can end with any character. */\n DecodingMode[DecodingMode[\"Legacy\"] = 0] = \"Legacy\";\n /** Only allow entities terminated with a semicolon. */\n DecodingMode[DecodingMode[\"Strict\"] = 1] = \"Strict\";\n /** Entities in attributes have limitations on ending characters. */\n DecodingMode[DecodingMode[\"Attribute\"] = 2] = \"Attribute\";\n})(DecodingMode || (DecodingMode = {}));\n/**\n * Token decoder with support of writing partial entities.\n */\nexport class EntityDecoder {\n constructor(\n /** The tree used to decode entities. */\n decodeTree, \n /**\n * The function that is called when a codepoint is decoded.\n *\n * For multi-byte named entities, this will be called multiple times,\n * with the second codepoint, and the same `consumed` value.\n *\n * @param codepoint The decoded codepoint.\n * @param consumed The number of bytes consumed by the decoder.\n */\n emitCodePoint, \n /** An object that is used to produce errors. */\n errors) {\n this.decodeTree = decodeTree;\n this.emitCodePoint = emitCodePoint;\n this.errors = errors;\n /** The current state of the decoder. */\n this.state = EntityDecoderState.EntityStart;\n /** Characters that were consumed while parsing an entity. */\n this.consumed = 1;\n /**\n * The result of the entity.\n *\n * Either the result index of a numeric entity, or the codepoint of a\n * numeric entity.\n */\n this.result = 0;\n /** The current index in the decode tree. */\n this.treeIndex = 0;\n /** The number of characters that were consumed in excess. */\n this.excess = 1;\n /** The mode in which the decoder is operating. */\n this.decodeMode = DecodingMode.Strict;\n }\n /** Resets the instance to make it reusable. */\n startEntity(decodeMode) {\n this.decodeMode = decodeMode;\n this.state = EntityDecoderState.EntityStart;\n this.result = 0;\n this.treeIndex = 0;\n this.excess = 1;\n this.consumed = 1;\n }\n /**\n * Write an entity to the decoder. This can be called multiple times with partial entities.\n * If the entity is incomplete, the decoder will return -1.\n *\n * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the\n * entity is incomplete, and resume when the next string is written.\n *\n * @param input The string containing the entity (or a continuation of the entity).\n * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n write(input, offset) {\n switch (this.state) {\n case EntityDecoderState.EntityStart: {\n if (input.charCodeAt(offset) === CharCodes.NUM) {\n this.state = EntityDecoderState.NumericStart;\n this.consumed += 1;\n return this.stateNumericStart(input, offset + 1);\n }\n this.state = EntityDecoderState.NamedEntity;\n return this.stateNamedEntity(input, offset);\n }\n case EntityDecoderState.NumericStart: {\n return this.stateNumericStart(input, offset);\n }\n case EntityDecoderState.NumericDecimal: {\n return this.stateNumericDecimal(input, offset);\n }\n case EntityDecoderState.NumericHex: {\n return this.stateNumericHex(input, offset);\n }\n case EntityDecoderState.NamedEntity: {\n return this.stateNamedEntity(input, offset);\n }\n }\n }\n /**\n * Switches between the numeric decimal and hexadecimal states.\n *\n * Equivalent to the `Numeric character reference state` in the HTML spec.\n *\n * @param input The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n stateNumericStart(input, offset) {\n if (offset >= input.length) {\n return -1;\n }\n if ((input.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) {\n this.state = EntityDecoderState.NumericHex;\n this.consumed += 1;\n return this.stateNumericHex(input, offset + 1);\n }\n this.state = EntityDecoderState.NumericDecimal;\n return this.stateNumericDecimal(input, offset);\n }\n addToNumericResult(input, start, end, base) {\n if (start !== end) {\n const digitCount = end - start;\n this.result =\n this.result * Math.pow(base, digitCount) +\n Number.parseInt(input.substr(start, digitCount), base);\n this.consumed += digitCount;\n }\n }\n /**\n * Parses a hexadecimal numeric entity.\n *\n * Equivalent to the `Hexademical character reference state` in the HTML spec.\n *\n * @param input The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n stateNumericHex(input, offset) {\n const startIndex = offset;\n while (offset < input.length) {\n const char = input.charCodeAt(offset);\n if (isNumber(char) || isHexadecimalCharacter(char)) {\n offset += 1;\n }\n else {\n this.addToNumericResult(input, startIndex, offset, 16);\n return this.emitNumericEntity(char, 3);\n }\n }\n this.addToNumericResult(input, startIndex, offset, 16);\n return -1;\n }\n /**\n * Parses a decimal numeric entity.\n *\n * Equivalent to the `Decimal character reference state` in the HTML spec.\n *\n * @param input The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n stateNumericDecimal(input, offset) {\n const startIndex = offset;\n while (offset < input.length) {\n const char = input.charCodeAt(offset);\n if (isNumber(char)) {\n offset += 1;\n }\n else {\n this.addToNumericResult(input, startIndex, offset, 10);\n return this.emitNumericEntity(char, 2);\n }\n }\n this.addToNumericResult(input, startIndex, offset, 10);\n return -1;\n }\n /**\n * Validate and emit a numeric entity.\n *\n * Implements the logic from the `Hexademical character reference start\n * state` and `Numeric character reference end state` in the HTML spec.\n *\n * @param lastCp The last code point of the entity. Used to see if the\n * entity was terminated with a semicolon.\n * @param expectedLength The minimum number of characters that should be\n * consumed. Used to validate that at least one digit\n * was consumed.\n * @returns The number of characters that were consumed.\n */\n emitNumericEntity(lastCp, expectedLength) {\n var _a;\n // Ensure we consumed at least one digit.\n if (this.consumed <= expectedLength) {\n (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);\n return 0;\n }\n // Figure out if this is a legit end of the entity\n if (lastCp === CharCodes.SEMI) {\n this.consumed += 1;\n }\n else if (this.decodeMode === DecodingMode.Strict) {\n return 0;\n }\n this.emitCodePoint(replaceCodePoint(this.result), this.consumed);\n if (this.errors) {\n if (lastCp !== CharCodes.SEMI) {\n this.errors.missingSemicolonAfterCharacterReference();\n }\n this.errors.validateNumericCharacterReference(this.result);\n }\n return this.consumed;\n }\n /**\n * Parses a named entity.\n *\n * Equivalent to the `Named character reference state` in the HTML spec.\n *\n * @param input The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */\n stateNamedEntity(input, offset) {\n const { decodeTree } = this;\n let current = decodeTree[this.treeIndex];\n // The mask is the number of bytes of the value, including the current byte.\n let valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;\n for (; offset < input.length; offset++, this.excess++) {\n const char = input.charCodeAt(offset);\n this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char);\n if (this.treeIndex < 0) {\n return this.result === 0 ||\n // If we are parsing an attribute\n (this.decodeMode === DecodingMode.Attribute &&\n // We shouldn't have consumed any characters after the entity,\n (valueLength === 0 ||\n // And there should be no invalid characters.\n isEntityInAttributeInvalidEnd(char)))\n ? 0\n : this.emitNotTerminatedNamedEntity();\n }\n current = decodeTree[this.treeIndex];\n valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;\n // If the branch is a value, store it and continue\n if (valueLength !== 0) {\n // If the entity is terminated by a semicolon, we are done.\n if (char === CharCodes.SEMI) {\n return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);\n }\n // If we encounter a non-terminated (legacy) entity while parsing strictly, then ignore it.\n if (this.decodeMode !== DecodingMode.Strict) {\n this.result = this.treeIndex;\n this.consumed += this.excess;\n this.excess = 0;\n }\n }\n }\n return -1;\n }\n /**\n * Emit a named entity that was not terminated with a semicolon.\n *\n * @returns The number of characters consumed.\n */\n emitNotTerminatedNamedEntity() {\n var _a;\n const { result, decodeTree } = this;\n const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;\n this.emitNamedEntityData(result, valueLength, this.consumed);\n (_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference();\n return this.consumed;\n }\n /**\n * Emit a named entity.\n *\n * @param result The index of the entity in the decode tree.\n * @param valueLength The number of bytes in the entity.\n * @param consumed The number of characters consumed.\n *\n * @returns The number of characters consumed.\n */\n emitNamedEntityData(result, valueLength, consumed) {\n const { decodeTree } = this;\n this.emitCodePoint(valueLength === 1\n ? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH\n : decodeTree[result + 1], consumed);\n if (valueLength === 3) {\n // For multi-byte values, we need to emit the second byte.\n this.emitCodePoint(decodeTree[result + 2], consumed);\n }\n return consumed;\n }\n /**\n * Signal to the parser that the end of the input was reached.\n *\n * Remaining data will be emitted and relevant errors will be produced.\n *\n * @returns The number of characters consumed.\n */\n end() {\n var _a;\n switch (this.state) {\n case EntityDecoderState.NamedEntity: {\n // Emit a named entity if we have one.\n return this.result !== 0 &&\n (this.decodeMode !== DecodingMode.Attribute ||\n this.result === this.treeIndex)\n ? this.emitNotTerminatedNamedEntity()\n : 0;\n }\n // Otherwise, emit a numeric entity if we have one.\n case EntityDecoderState.NumericDecimal: {\n return this.emitNumericEntity(0, 2);\n }\n case EntityDecoderState.NumericHex: {\n return this.emitNumericEntity(0, 3);\n }\n case EntityDecoderState.NumericStart: {\n (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);\n return 0;\n }\n case EntityDecoderState.EntityStart: {\n // Return 0 if we have no entity.\n return 0;\n }\n }\n }\n}\n/**\n * Creates a function that decodes entities in a string.\n *\n * @param decodeTree The decode tree.\n * @returns A function that decodes entities in a string.\n */\nfunction getDecoder(decodeTree) {\n let returnValue = \"\";\n const decoder = new EntityDecoder(decodeTree, (data) => (returnValue += fromCodePoint(data)));\n return function decodeWithTrie(input, decodeMode) {\n let lastIndex = 0;\n let offset = 0;\n while ((offset = input.indexOf(\"&\", offset)) >= 0) {\n returnValue += input.slice(lastIndex, offset);\n decoder.startEntity(decodeMode);\n const length = decoder.write(input, \n // Skip the \"&\"\n offset + 1);\n if (length < 0) {\n lastIndex = offset + decoder.end();\n break;\n }\n lastIndex = offset + length;\n // If `length` is 0, skip the current `&` and continue.\n offset = length === 0 ? lastIndex + 1 : lastIndex;\n }\n const result = returnValue + input.slice(lastIndex);\n // Make sure we don't keep a reference to the final string.\n returnValue = \"\";\n return result;\n };\n}\n/**\n * Determines the branch of the current node that is taken given the current\n * character. This function is used to traverse the trie.\n *\n * @param decodeTree The trie.\n * @param current The current node.\n * @param nodeIdx The index right after the current node and its value.\n * @param char The current character.\n * @returns The index of the next node, or -1 if no branch is taken.\n */\nexport function determineBranch(decodeTree, current, nodeIndex, char) {\n const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;\n const jumpOffset = current & BinTrieFlags.JUMP_TABLE;\n // Case 1: Single branch encoded in jump offset\n if (branchCount === 0) {\n return jumpOffset !== 0 && char === jumpOffset ? nodeIndex : -1;\n }\n // Case 2: Multiple branches encoded in jump table\n if (jumpOffset) {\n const value = char - jumpOffset;\n return value < 0 || value >= branchCount\n ? -1\n : decodeTree[nodeIndex + value] - 1;\n }\n // Case 3: Multiple branches encoded in dictionary\n // Binary search for the character.\n let lo = nodeIndex;\n let hi = lo + branchCount - 1;\n while (lo <= hi) {\n const mid = (lo + hi) >>> 1;\n const midValue = decodeTree[mid];\n if (midValue < char) {\n lo = mid + 1;\n }\n else if (midValue > char) {\n hi = mid - 1;\n }\n else {\n return decodeTree[mid + branchCount];\n }\n }\n return -1;\n}\nconst htmlDecoder = /* #__PURE__ */ getDecoder(htmlDecodeTree);\nconst xmlDecoder = /* #__PURE__ */ getDecoder(xmlDecodeTree);\n/**\n * Decodes an HTML string.\n *\n * @param htmlString The string to decode.\n * @param mode The decoding mode.\n * @returns The decoded string.\n */\nexport function decodeHTML(htmlString, mode = DecodingMode.Legacy) {\n return htmlDecoder(htmlString, mode);\n}\n/**\n * Decodes an HTML string in an attribute.\n *\n * @param htmlAttribute The string to decode.\n * @returns The decoded string.\n */\nexport function decodeHTMLAttribute(htmlAttribute) {\n return htmlDecoder(htmlAttribute, DecodingMode.Attribute);\n}\n/**\n * Decodes an HTML string, requiring all entities to be terminated by a semicolon.\n *\n * @param htmlString The string to decode.\n * @returns The decoded string.\n */\nexport function decodeHTMLStrict(htmlString) {\n return htmlDecoder(htmlString, DecodingMode.Strict);\n}\n/**\n * Decodes an XML string, requiring all entities to be terminated by a semicolon.\n *\n * @param xmlString The string to decode.\n * @returns The decoded string.\n */\nexport function decodeXML(xmlString) {\n return xmlDecoder(xmlString, DecodingMode.Strict);\n}\n// Re-export for use by eg. htmlparser2\nexport { htmlDecodeTree } from \"./generated/decode-data-html.js\";\nexport { xmlDecodeTree } from \"./generated/decode-data-xml.js\";\nexport { decodeCodePoint, replaceCodePoint, fromCodePoint, } from \"./decode-codepoint.js\";\n//# sourceMappingURL=decode.js.map","export const xmlReplacer = /[\"$&'<>\\u0080-\\uFFFF]/g;\nconst xmlCodeMap = new Map([\n [34, \""\"],\n [38, \"&\"],\n [39, \"'\"],\n [60, \"<\"],\n [62, \">\"],\n]);\n// For compatibility with node < 4, we wrap `codePointAt`\nexport const getCodePoint = \n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\nString.prototype.codePointAt == null\n ? (c, index) => (c.charCodeAt(index) & 64512) === 55296\n ? (c.charCodeAt(index) - 55296) * 1024 +\n c.charCodeAt(index + 1) -\n 56320 +\n 65536\n : c.charCodeAt(index)\n : // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n (input, index) => input.codePointAt(index);\n/**\n * Encodes all non-ASCII characters, as well as characters not valid in XML\n * documents using XML entities.\n *\n * If a character has no equivalent entity, a\n * numeric hexadecimal reference (eg. `ü`) will be used.\n */\nexport function encodeXML(input) {\n let returnValue = \"\";\n let lastIndex = 0;\n let match;\n while ((match = xmlReplacer.exec(input)) !== null) {\n const { index } = match;\n const char = input.charCodeAt(index);\n const next = xmlCodeMap.get(char);\n if (next === undefined) {\n returnValue += `${input.substring(lastIndex, index)}&#x${getCodePoint(input, index).toString(16)};`;\n // Increase by 1 if we have a surrogate pair\n lastIndex = xmlReplacer.lastIndex += Number((char & 64512) === 55296);\n }\n else {\n returnValue += input.substring(lastIndex, index) + next;\n lastIndex = index + 1;\n }\n }\n return returnValue + input.substr(lastIndex);\n}\n/**\n * Encodes all non-ASCII characters, as well as characters not valid in XML\n * documents using numeric hexadecimal reference (eg. `ü`).\n *\n * Have a look at `escapeUTF8` if you want a more concise output at the expense\n * of reduced transportability.\n *\n * @param data String to escape.\n */\nexport const escape = encodeXML;\n/**\n * Creates a function that escapes all characters matched by the given regular\n * expression using the given map of characters to escape to their entities.\n *\n * @param regex Regular expression to match characters to escape.\n * @param map Map of characters to escape to their entities.\n *\n * @returns Function that escapes all characters matched by the given regular\n * expression using the given map of characters to escape to their entities.\n */\nfunction getEscaper(regex, map) {\n return function escape(data) {\n let match;\n let lastIndex = 0;\n let result = \"\";\n while ((match = regex.exec(data))) {\n if (lastIndex !== match.index) {\n result += data.substring(lastIndex, match.index);\n }\n // We know that this character will be in the map.\n result += map.get(match[0].charCodeAt(0));\n // Every match will be of length 1\n lastIndex = match.index + 1;\n }\n return result + data.substring(lastIndex);\n };\n}\n/**\n * Encodes all characters not valid in XML documents using XML entities.\n *\n * Note that the output will be character-set dependent.\n *\n * @param data String to escape.\n */\nexport const escapeUTF8 = /* #__PURE__ */ getEscaper(/[\"&'<>]/g, xmlCodeMap);\n/**\n * Encodes all characters that have to be escaped in HTML attributes,\n * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.\n *\n * @param data String to escape.\n */\nexport const escapeAttribute = \n/* #__PURE__ */ getEscaper(/[\"&\\u00A0]/g, new Map([\n [34, \""\"],\n [38, \"&\"],\n [160, \" \"],\n]));\n/**\n * Encodes all characters that have to be escaped in HTML text,\n * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.\n *\n * @param data String to escape.\n */\nexport const escapeText = /* #__PURE__ */ getEscaper(/[&<>\\u00A0]/g, new Map([\n [38, \"&\"],\n [60, \"<\"],\n [62, \">\"],\n [160, \" \"],\n]));\n//# sourceMappingURL=escape.js.map","// Generated using scripts/write-decode-map.ts\nexport const htmlDecodeTree = /* #__PURE__ */ new Uint16Array(\n// prettier-ignore\n/* #__PURE__ */ \"\\u1d41<\\xd5\\u0131\\u028a\\u049d\\u057b\\u05d0\\u0675\\u06de\\u07a2\\u07d6\\u080f\\u0a4a\\u0a91\\u0da1\\u0e6d\\u0f09\\u0f26\\u10ca\\u1228\\u12e1\\u1415\\u149d\\u14c3\\u14df\\u1525\\0\\0\\0\\0\\0\\0\\u156b\\u16cd\\u198d\\u1c12\\u1ddd\\u1f7e\\u2060\\u21b0\\u228d\\u23c0\\u23fb\\u2442\\u2824\\u2912\\u2d08\\u2e48\\u2fce\\u3016\\u32ba\\u3639\\u37ac\\u38fe\\u3a28\\u3a71\\u3ae0\\u3b2e\\u0800EMabcfglmnoprstu\\\\bfms\\x7f\\x84\\x8b\\x90\\x95\\x98\\xa6\\xb3\\xb9\\xc8\\xcflig\\u803b\\xc6\\u40c6P\\u803b&\\u4026cute\\u803b\\xc1\\u40c1reve;\\u4102\\u0100iyx}rc\\u803b\\xc2\\u40c2;\\u4410r;\\uc000\\ud835\\udd04rave\\u803b\\xc0\\u40c0pha;\\u4391acr;\\u4100d;\\u6a53\\u0100gp\\x9d\\xa1on;\\u4104f;\\uc000\\ud835\\udd38plyFunction;\\u6061ing\\u803b\\xc5\\u40c5\\u0100cs\\xbe\\xc3r;\\uc000\\ud835\\udc9cign;\\u6254ilde\\u803b\\xc3\\u40c3ml\\u803b\\xc4\\u40c4\\u0400aceforsu\\xe5\\xfb\\xfe\\u0117\\u011c\\u0122\\u0127\\u012a\\u0100cr\\xea\\xf2kslash;\\u6216\\u0176\\xf6\\xf8;\\u6ae7ed;\\u6306y;\\u4411\\u0180crt\\u0105\\u010b\\u0114ause;\\u6235noullis;\\u612ca;\\u4392r;\\uc000\\ud835\\udd05pf;\\uc000\\ud835\\udd39eve;\\u42d8c\\xf2\\u0113mpeq;\\u624e\\u0700HOacdefhilorsu\\u014d\\u0151\\u0156\\u0180\\u019e\\u01a2\\u01b5\\u01b7\\u01ba\\u01dc\\u0215\\u0273\\u0278\\u027ecy;\\u4427PY\\u803b\\xa9\\u40a9\\u0180cpy\\u015d\\u0162\\u017aute;\\u4106\\u0100;i\\u0167\\u0168\\u62d2talDifferentialD;\\u6145leys;\\u612d\\u0200aeio\\u0189\\u018e\\u0194\\u0198ron;\\u410cdil\\u803b\\xc7\\u40c7rc;\\u4108nint;\\u6230ot;\\u410a\\u0100dn\\u01a7\\u01adilla;\\u40b8terDot;\\u40b7\\xf2\\u017fi;\\u43a7rcle\\u0200DMPT\\u01c7\\u01cb\\u01d1\\u01d6ot;\\u6299inus;\\u6296lus;\\u6295imes;\\u6297o\\u0100cs\\u01e2\\u01f8kwiseContourIntegral;\\u6232eCurly\\u0100DQ\\u0203\\u020foubleQuote;\\u601duote;\\u6019\\u0200lnpu\\u021e\\u0228\\u0247\\u0255on\\u0100;e\\u0225\\u0226\\u6237;\\u6a74\\u0180git\\u022f\\u0236\\u023aruent;\\u6261nt;\\u622fourIntegral;\\u622e\\u0100fr\\u024c\\u024e;\\u6102oduct;\\u6210nterClockwiseContourIntegral;\\u6233oss;\\u6a2fcr;\\uc000\\ud835\\udc9ep\\u0100;C\\u0284\\u0285\\u62d3ap;\\u624d\\u0580DJSZacefios\\u02a0\\u02ac\\u02b0\\u02b4\\u02b8\\u02cb\\u02d7\\u02e1\\u02e6\\u0333\\u048d\\u0100;o\\u0179\\u02a5trahd;\\u6911cy;\\u4402cy;\\u4405cy;\\u440f\\u0180grs\\u02bf\\u02c4\\u02c7ger;\\u6021r;\\u61a1hv;\\u6ae4\\u0100ay\\u02d0\\u02d5ron;\\u410e;\\u4414l\\u0100;t\\u02dd\\u02de\\u6207a;\\u4394r;\\uc000\\ud835\\udd07\\u0100af\\u02eb\\u0327\\u0100cm\\u02f0\\u0322ritical\\u0200ADGT\\u0300\\u0306\\u0316\\u031ccute;\\u40b4o\\u0174\\u030b\\u030d;\\u42d9bleAcute;\\u42ddrave;\\u4060ilde;\\u42dcond;\\u62c4ferentialD;\\u6146\\u0470\\u033d\\0\\0\\0\\u0342\\u0354\\0\\u0405f;\\uc000\\ud835\\udd3b\\u0180;DE\\u0348\\u0349\\u034d\\u40a8ot;\\u60dcqual;\\u6250ble\\u0300CDLRUV\\u0363\\u0372\\u0382\\u03cf\\u03e2\\u03f8ontourIntegra\\xec\\u0239o\\u0274\\u0379\\0\\0\\u037b\\xbb\\u0349nArrow;\\u61d3\\u0100eo\\u0387\\u03a4ft\\u0180ART\\u0390\\u0396\\u03a1rrow;\\u61d0ightArrow;\\u61d4e\\xe5\\u02cang\\u0100LR\\u03ab\\u03c4eft\\u0100AR\\u03b3\\u03b9rrow;\\u67f8ightArrow;\\u67faightArrow;\\u67f9ight\\u0100AT\\u03d8\\u03derrow;\\u61d2ee;\\u62a8p\\u0241\\u03e9\\0\\0\\u03efrrow;\\u61d1ownArrow;\\u61d5erticalBar;\\u6225n\\u0300ABLRTa\\u0412\\u042a\\u0430\\u045e\\u047f\\u037crrow\\u0180;BU\\u041d\\u041e\\u0422\\u6193ar;\\u6913pArrow;\\u61f5reve;\\u4311eft\\u02d2\\u043a\\0\\u0446\\0\\u0450ightVector;\\u6950eeVector;\\u695eector\\u0100;B\\u0459\\u045a\\u61bdar;\\u6956ight\\u01d4\\u0467\\0\\u0471eeVector;\\u695fector\\u0100;B\\u047a\\u047b\\u61c1ar;\\u6957ee\\u0100;A\\u0486\\u0487\\u62a4rrow;\\u61a7\\u0100ct\\u0492\\u0497r;\\uc000\\ud835\\udc9frok;\\u4110\\u0800NTacdfglmopqstux\\u04bd\\u04c0\\u04c4\\u04cb\\u04de\\u04e2\\u04e7\\u04ee\\u04f5\\u0521\\u052f\\u0536\\u0552\\u055d\\u0560\\u0565G;\\u414aH\\u803b\\xd0\\u40d0cute\\u803b\\xc9\\u40c9\\u0180aiy\\u04d2\\u04d7\\u04dcron;\\u411arc\\u803b\\xca\\u40ca;\\u442dot;\\u4116r;\\uc000\\ud835\\udd08rave\\u803b\\xc8\\u40c8ement;\\u6208\\u0100ap\\u04fa\\u04fecr;\\u4112ty\\u0253\\u0506\\0\\0\\u0512mallSquare;\\u65fberySmallSquare;\\u65ab\\u0100gp\\u0526\\u052aon;\\u4118f;\\uc000\\ud835\\udd3csilon;\\u4395u\\u0100ai\\u053c\\u0549l\\u0100;T\\u0542\\u0543\\u6a75ilde;\\u6242librium;\\u61cc\\u0100ci\\u0557\\u055ar;\\u6130m;\\u6a73a;\\u4397ml\\u803b\\xcb\\u40cb\\u0100ip\\u056a\\u056fsts;\\u6203onentialE;\\u6147\\u0280cfios\\u0585\\u0588\\u058d\\u05b2\\u05ccy;\\u4424r;\\uc000\\ud835\\udd09lled\\u0253\\u0597\\0\\0\\u05a3mallSquare;\\u65fcerySmallSquare;\\u65aa\\u0370\\u05ba\\0\\u05bf\\0\\0\\u05c4f;\\uc000\\ud835\\udd3dAll;\\u6200riertrf;\\u6131c\\xf2\\u05cb\\u0600JTabcdfgorst\\u05e8\\u05ec\\u05ef\\u05fa\\u0600\\u0612\\u0616\\u061b\\u061d\\u0623\\u066c\\u0672cy;\\u4403\\u803b>\\u403emma\\u0100;d\\u05f7\\u05f8\\u4393;\\u43dcreve;\\u411e\\u0180eiy\\u0607\\u060c\\u0610dil;\\u4122rc;\\u411c;\\u4413ot;\\u4120r;\\uc000\\ud835\\udd0a;\\u62d9pf;\\uc000\\ud835\\udd3eeater\\u0300EFGLST\\u0635\\u0644\\u064e\\u0656\\u065b\\u0666qual\\u0100;L\\u063e\\u063f\\u6265ess;\\u62dbullEqual;\\u6267reater;\\u6aa2ess;\\u6277lantEqual;\\u6a7eilde;\\u6273cr;\\uc000\\ud835\\udca2;\\u626b\\u0400Aacfiosu\\u0685\\u068b\\u0696\\u069b\\u069e\\u06aa\\u06be\\u06caRDcy;\\u442a\\u0100ct\\u0690\\u0694ek;\\u42c7;\\u405eirc;\\u4124r;\\u610clbertSpace;\\u610b\\u01f0\\u06af\\0\\u06b2f;\\u610dizontalLine;\\u6500\\u0100ct\\u06c3\\u06c5\\xf2\\u06a9rok;\\u4126mp\\u0144\\u06d0\\u06d8ownHum\\xf0\\u012fqual;\\u624f\\u0700EJOacdfgmnostu\\u06fa\\u06fe\\u0703\\u0707\\u070e\\u071a\\u071e\\u0721\\u0728\\u0744\\u0778\\u078b\\u078f\\u0795cy;\\u4415lig;\\u4132cy;\\u4401cute\\u803b\\xcd\\u40cd\\u0100iy\\u0713\\u0718rc\\u803b\\xce\\u40ce;\\u4418ot;\\u4130r;\\u6111rave\\u803b\\xcc\\u40cc\\u0180;ap\\u0720\\u072f\\u073f\\u0100cg\\u0734\\u0737r;\\u412ainaryI;\\u6148lie\\xf3\\u03dd\\u01f4\\u0749\\0\\u0762\\u0100;e\\u074d\\u074e\\u622c\\u0100gr\\u0753\\u0758ral;\\u622bsection;\\u62c2isible\\u0100CT\\u076c\\u0772omma;\\u6063imes;\\u6062\\u0180gpt\\u077f\\u0783\\u0788on;\\u412ef;\\uc000\\ud835\\udd40a;\\u4399cr;\\u6110ilde;\\u4128\\u01eb\\u079a\\0\\u079ecy;\\u4406l\\u803b\\xcf\\u40cf\\u0280cfosu\\u07ac\\u07b7\\u07bc\\u07c2\\u07d0\\u0100iy\\u07b1\\u07b5rc;\\u4134;\\u4419r;\\uc000\\ud835\\udd0dpf;\\uc000\\ud835\\udd41\\u01e3\\u07c7\\0\\u07ccr;\\uc000\\ud835\\udca5rcy;\\u4408kcy;\\u4404\\u0380HJacfos\\u07e4\\u07e8\\u07ec\\u07f1\\u07fd\\u0802\\u0808cy;\\u4425cy;\\u440cppa;\\u439a\\u0100ey\\u07f6\\u07fbdil;\\u4136;\\u441ar;\\uc000\\ud835\\udd0epf;\\uc000\\ud835\\udd42cr;\\uc000\\ud835\\udca6\\u0580JTaceflmost\\u0825\\u0829\\u082c\\u0850\\u0863\\u09b3\\u09b8\\u09c7\\u09cd\\u0a37\\u0a47cy;\\u4409\\u803b<\\u403c\\u0280cmnpr\\u0837\\u083c\\u0841\\u0844\\u084dute;\\u4139bda;\\u439bg;\\u67ealacetrf;\\u6112r;\\u619e\\u0180aey\\u0857\\u085c\\u0861ron;\\u413ddil;\\u413b;\\u441b\\u0100fs\\u0868\\u0970t\\u0500ACDFRTUVar\\u087e\\u08a9\\u08b1\\u08e0\\u08e6\\u08fc\\u092f\\u095b\\u0390\\u096a\\u0100nr\\u0883\\u088fgleBracket;\\u67e8row\\u0180;BR\\u0899\\u089a\\u089e\\u6190ar;\\u61e4ightArrow;\\u61c6eiling;\\u6308o\\u01f5\\u08b7\\0\\u08c3bleBracket;\\u67e6n\\u01d4\\u08c8\\0\\u08d2eeVector;\\u6961ector\\u0100;B\\u08db\\u08dc\\u61c3ar;\\u6959loor;\\u630aight\\u0100AV\\u08ef\\u08f5rrow;\\u6194ector;\\u694e\\u0100er\\u0901\\u0917e\\u0180;AV\\u0909\\u090a\\u0910\\u62a3rrow;\\u61a4ector;\\u695aiangle\\u0180;BE\\u0924\\u0925\\u0929\\u62b2ar;\\u69cfqual;\\u62b4p\\u0180DTV\\u0937\\u0942\\u094cownVector;\\u6951eeVector;\\u6960ector\\u0100;B\\u0956\\u0957\\u61bfar;\\u6958ector\\u0100;B\\u0965\\u0966\\u61bcar;\\u6952ight\\xe1\\u039cs\\u0300EFGLST\\u097e\\u098b\\u0995\\u099d\\u09a2\\u09adqualGreater;\\u62daullEqual;\\u6266reater;\\u6276ess;\\u6aa1lantEqual;\\u6a7dilde;\\u6272r;\\uc000\\ud835\\udd0f\\u0100;e\\u09bd\\u09be\\u62d8ftarrow;\\u61daidot;\\u413f\\u0180npw\\u09d4\\u0a16\\u0a1bg\\u0200LRlr\\u09de\\u09f7\\u0a02\\u0a10eft\\u0100AR\\u09e6\\u09ecrrow;\\u67f5ightArrow;\\u67f7ightArrow;\\u67f6eft\\u0100ar\\u03b3\\u0a0aight\\xe1\\u03bfight\\xe1\\u03caf;\\uc000\\ud835\\udd43er\\u0100LR\\u0a22\\u0a2ceftArrow;\\u6199ightArrow;\\u6198\\u0180cht\\u0a3e\\u0a40\\u0a42\\xf2\\u084c;\\u61b0rok;\\u4141;\\u626a\\u0400acefiosu\\u0a5a\\u0a5d\\u0a60\\u0a77\\u0a7c\\u0a85\\u0a8b\\u0a8ep;\\u6905y;\\u441c\\u0100dl\\u0a65\\u0a6fiumSpace;\\u605flintrf;\\u6133r;\\uc000\\ud835\\udd10nusPlus;\\u6213pf;\\uc000\\ud835\\udd44c\\xf2\\u0a76;\\u439c\\u0480Jacefostu\\u0aa3\\u0aa7\\u0aad\\u0ac0\\u0b14\\u0b19\\u0d91\\u0d97\\u0d9ecy;\\u440acute;\\u4143\\u0180aey\\u0ab4\\u0ab9\\u0aberon;\\u4147dil;\\u4145;\\u441d\\u0180gsw\\u0ac7\\u0af0\\u0b0eative\\u0180MTV\\u0ad3\\u0adf\\u0ae8ediumSpace;\\u600bhi\\u0100cn\\u0ae6\\u0ad8\\xeb\\u0ad9eryThi\\xee\\u0ad9ted\\u0100GL\\u0af8\\u0b06reaterGreate\\xf2\\u0673essLes\\xf3\\u0a48Line;\\u400ar;\\uc000\\ud835\\udd11\\u0200Bnpt\\u0b22\\u0b28\\u0b37\\u0b3areak;\\u6060BreakingSpace;\\u40a0f;\\u6115\\u0680;CDEGHLNPRSTV\\u0b55\\u0b56\\u0b6a\\u0b7c\\u0ba1\\u0beb\\u0c04\\u0c5e\\u0c84\\u0ca6\\u0cd8\\u0d61\\u0d85\\u6aec\\u0100ou\\u0b5b\\u0b64ngruent;\\u6262pCap;\\u626doubleVerticalBar;\\u6226\\u0180lqx\\u0b83\\u0b8a\\u0b9bement;\\u6209ual\\u0100;T\\u0b92\\u0b93\\u6260ilde;\\uc000\\u2242\\u0338ists;\\u6204reater\\u0380;EFGLST\\u0bb6\\u0bb7\\u0bbd\\u0bc9\\u0bd3\\u0bd8\\u0be5\\u626fqual;\\u6271ullEqual;\\uc000\\u2267\\u0338reater;\\uc000\\u226b\\u0338ess;\\u6279lantEqual;\\uc000\\u2a7e\\u0338ilde;\\u6275ump\\u0144\\u0bf2\\u0bfdownHump;\\uc000\\u224e\\u0338qual;\\uc000\\u224f\\u0338e\\u0100fs\\u0c0a\\u0c27tTriangle\\u0180;BE\\u0c1a\\u0c1b\\u0c21\\u62eaar;\\uc000\\u29cf\\u0338qual;\\u62ecs\\u0300;EGLST\\u0c35\\u0c36\\u0c3c\\u0c44\\u0c4b\\u0c58\\u626equal;\\u6270reater;\\u6278ess;\\uc000\\u226a\\u0338lantEqual;\\uc000\\u2a7d\\u0338ilde;\\u6274ested\\u0100GL\\u0c68\\u0c79reaterGreater;\\uc000\\u2aa2\\u0338essLess;\\uc000\\u2aa1\\u0338recedes\\u0180;ES\\u0c92\\u0c93\\u0c9b\\u6280qual;\\uc000\\u2aaf\\u0338lantEqual;\\u62e0\\u0100ei\\u0cab\\u0cb9verseElement;\\u620cghtTriangle\\u0180;BE\\u0ccb\\u0ccc\\u0cd2\\u62ebar;\\uc000\\u29d0\\u0338qual;\\u62ed\\u0100qu\\u0cdd\\u0d0cuareSu\\u0100bp\\u0ce8\\u0cf9set\\u0100;E\\u0cf0\\u0cf3\\uc000\\u228f\\u0338qual;\\u62e2erset\\u0100;E\\u0d03\\u0d06\\uc000\\u2290\\u0338qual;\\u62e3\\u0180bcp\\u0d13\\u0d24\\u0d4eset\\u0100;E\\u0d1b\\u0d1e\\uc000\\u2282\\u20d2qual;\\u6288ceeds\\u0200;EST\\u0d32\\u0d33\\u0d3b\\u0d46\\u6281qual;\\uc000\\u2ab0\\u0338lantEqual;\\u62e1ilde;\\uc000\\u227f\\u0338erset\\u0100;E\\u0d58\\u0d5b\\uc000\\u2283\\u20d2qual;\\u6289ilde\\u0200;EFT\\u0d6e\\u0d6f\\u0d75\\u0d7f\\u6241qual;\\u6244ullEqual;\\u6247ilde;\\u6249erticalBar;\\u6224cr;\\uc000\\ud835\\udca9ilde\\u803b\\xd1\\u40d1;\\u439d\\u0700Eacdfgmoprstuv\\u0dbd\\u0dc2\\u0dc9\\u0dd5\\u0ddb\\u0de0\\u0de7\\u0dfc\\u0e02\\u0e20\\u0e22\\u0e32\\u0e3f\\u0e44lig;\\u4152cute\\u803b\\xd3\\u40d3\\u0100iy\\u0dce\\u0dd3rc\\u803b\\xd4\\u40d4;\\u441eblac;\\u4150r;\\uc000\\ud835\\udd12rave\\u803b\\xd2\\u40d2\\u0180aei\\u0dee\\u0df2\\u0df6cr;\\u414cga;\\u43a9cron;\\u439fpf;\\uc000\\ud835\\udd46enCurly\\u0100DQ\\u0e0e\\u0e1aoubleQuote;\\u601cuote;\\u6018;\\u6a54\\u0100cl\\u0e27\\u0e2cr;\\uc000\\ud835\\udcaaash\\u803b\\xd8\\u40d8i\\u016c\\u0e37\\u0e3cde\\u803b\\xd5\\u40d5es;\\u6a37ml\\u803b\\xd6\\u40d6er\\u0100BP\\u0e4b\\u0e60\\u0100ar\\u0e50\\u0e53r;\\u603eac\\u0100ek\\u0e5a\\u0e5c;\\u63deet;\\u63b4arenthesis;\\u63dc\\u0480acfhilors\\u0e7f\\u0e87\\u0e8a\\u0e8f\\u0e92\\u0e94\\u0e9d\\u0eb0\\u0efcrtialD;\\u6202y;\\u441fr;\\uc000\\ud835\\udd13i;\\u43a6;\\u43a0usMinus;\\u40b1\\u0100ip\\u0ea2\\u0eadncareplan\\xe5\\u069df;\\u6119\\u0200;eio\\u0eb9\\u0eba\\u0ee0\\u0ee4\\u6abbcedes\\u0200;EST\\u0ec8\\u0ec9\\u0ecf\\u0eda\\u627aqual;\\u6aaflantEqual;\\u627cilde;\\u627eme;\\u6033\\u0100dp\\u0ee9\\u0eeeuct;\\u620fortion\\u0100;a\\u0225\\u0ef9l;\\u621d\\u0100ci\\u0f01\\u0f06r;\\uc000\\ud835\\udcab;\\u43a8\\u0200Ufos\\u0f11\\u0f16\\u0f1b\\u0f1fOT\\u803b\\\"\\u4022r;\\uc000\\ud835\\udd14pf;\\u611acr;\\uc000\\ud835\\udcac\\u0600BEacefhiorsu\\u0f3e\\u0f43\\u0f47\\u0f60\\u0f73\\u0fa7\\u0faa\\u0fad\\u1096\\u10a9\\u10b4\\u10bearr;\\u6910G\\u803b\\xae\\u40ae\\u0180cnr\\u0f4e\\u0f53\\u0f56ute;\\u4154g;\\u67ebr\\u0100;t\\u0f5c\\u0f5d\\u61a0l;\\u6916\\u0180aey\\u0f67\\u0f6c\\u0f71ron;\\u4158dil;\\u4156;\\u4420\\u0100;v\\u0f78\\u0f79\\u611cerse\\u0100EU\\u0f82\\u0f99\\u0100lq\\u0f87\\u0f8eement;\\u620builibrium;\\u61cbpEquilibrium;\\u696fr\\xbb\\u0f79o;\\u43a1ght\\u0400ACDFTUVa\\u0fc1\\u0feb\\u0ff3\\u1022\\u1028\\u105b\\u1087\\u03d8\\u0100nr\\u0fc6\\u0fd2gleBracket;\\u67e9row\\u0180;BL\\u0fdc\\u0fdd\\u0fe1\\u6192ar;\\u61e5eftArrow;\\u61c4eiling;\\u6309o\\u01f5\\u0ff9\\0\\u1005bleBracket;\\u67e7n\\u01d4\\u100a\\0\\u1014eeVector;\\u695dector\\u0100;B\\u101d\\u101e\\u61c2ar;\\u6955loor;\\u630b\\u0100er\\u102d\\u1043e\\u0180;AV\\u1035\\u1036\\u103c\\u62a2rrow;\\u61a6ector;\\u695biangle\\u0180;BE\\u1050\\u1051\\u1055\\u62b3ar;\\u69d0qual;\\u62b5p\\u0180DTV\\u1063\\u106e\\u1078ownVector;\\u694feeVector;\\u695cector\\u0100;B\\u1082\\u1083\\u61bear;\\u6954ector\\u0100;B\\u1091\\u1092\\u61c0ar;\\u6953\\u0100pu\\u109b\\u109ef;\\u611dndImplies;\\u6970ightarrow;\\u61db\\u0100ch\\u10b9\\u10bcr;\\u611b;\\u61b1leDelayed;\\u69f4\\u0680HOacfhimoqstu\\u10e4\\u10f1\\u10f7\\u10fd\\u1119\\u111e\\u1151\\u1156\\u1161\\u1167\\u11b5\\u11bb\\u11bf\\u0100Cc\\u10e9\\u10eeHcy;\\u4429y;\\u4428FTcy;\\u442ccute;\\u415a\\u0280;aeiy\\u1108\\u1109\\u110e\\u1113\\u1117\\u6abcron;\\u4160dil;\\u415erc;\\u415c;\\u4421r;\\uc000\\ud835\\udd16ort\\u0200DLRU\\u112a\\u1134\\u113e\\u1149ownArrow\\xbb\\u041eeftArrow\\xbb\\u089aightArrow\\xbb\\u0fddpArrow;\\u6191gma;\\u43a3allCircle;\\u6218pf;\\uc000\\ud835\\udd4a\\u0272\\u116d\\0\\0\\u1170t;\\u621aare\\u0200;ISU\\u117b\\u117c\\u1189\\u11af\\u65a1ntersection;\\u6293u\\u0100bp\\u118f\\u119eset\\u0100;E\\u1197\\u1198\\u628fqual;\\u6291erset\\u0100;E\\u11a8\\u11a9\\u6290qual;\\u6292nion;\\u6294cr;\\uc000\\ud835\\udcaear;\\u62c6\\u0200bcmp\\u11c8\\u11db\\u1209\\u120b\\u0100;s\\u11cd\\u11ce\\u62d0et\\u0100;E\\u11cd\\u11d5qual;\\u6286\\u0100ch\\u11e0\\u1205eeds\\u0200;EST\\u11ed\\u11ee\\u11f4\\u11ff\\u627bqual;\\u6ab0lantEqual;\\u627dilde;\\u627fTh\\xe1\\u0f8c;\\u6211\\u0180;es\\u1212\\u1213\\u1223\\u62d1rset\\u0100;E\\u121c\\u121d\\u6283qual;\\u6287et\\xbb\\u1213\\u0580HRSacfhiors\\u123e\\u1244\\u1249\\u1255\\u125e\\u1271\\u1276\\u129f\\u12c2\\u12c8\\u12d1ORN\\u803b\\xde\\u40deADE;\\u6122\\u0100Hc\\u124e\\u1252cy;\\u440by;\\u4426\\u0100bu\\u125a\\u125c;\\u4009;\\u43a4\\u0180aey\\u1265\\u126a\\u126fron;\\u4164dil;\\u4162;\\u4422r;\\uc000\\ud835\\udd17\\u0100ei\\u127b\\u1289\\u01f2\\u1280\\0\\u1287efore;\\u6234a;\\u4398\\u0100cn\\u128e\\u1298kSpace;\\uc000\\u205f\\u200aSpace;\\u6009lde\\u0200;EFT\\u12ab\\u12ac\\u12b2\\u12bc\\u623cqual;\\u6243ullEqual;\\u6245ilde;\\u6248pf;\\uc000\\ud835\\udd4bipleDot;\\u60db\\u0100ct\\u12d6\\u12dbr;\\uc000\\ud835\\udcafrok;\\u4166\\u0ae1\\u12f7\\u130e\\u131a\\u1326\\0\\u132c\\u1331\\0\\0\\0\\0\\0\\u1338\\u133d\\u1377\\u1385\\0\\u13ff\\u1404\\u140a\\u1410\\u0100cr\\u12fb\\u1301ute\\u803b\\xda\\u40dar\\u0100;o\\u1307\\u1308\\u619fcir;\\u6949r\\u01e3\\u1313\\0\\u1316y;\\u440eve;\\u416c\\u0100iy\\u131e\\u1323rc\\u803b\\xdb\\u40db;\\u4423blac;\\u4170r;\\uc000\\ud835\\udd18rave\\u803b\\xd9\\u40d9acr;\\u416a\\u0100di\\u1341\\u1369er\\u0100BP\\u1348\\u135d\\u0100ar\\u134d\\u1350r;\\u405fac\\u0100ek\\u1357\\u1359;\\u63dfet;\\u63b5arenthesis;\\u63ddon\\u0100;P\\u1370\\u1371\\u62c3lus;\\u628e\\u0100gp\\u137b\\u137fon;\\u4172f;\\uc000\\ud835\\udd4c\\u0400ADETadps\\u1395\\u13ae\\u13b8\\u13c4\\u03e8\\u13d2\\u13d7\\u13f3rrow\\u0180;BD\\u1150\\u13a0\\u13a4ar;\\u6912ownArrow;\\u61c5ownArrow;\\u6195quilibrium;\\u696eee\\u0100;A\\u13cb\\u13cc\\u62a5rrow;\\u61a5own\\xe1\\u03f3er\\u0100LR\\u13de\\u13e8eftArrow;\\u6196ightArrow;\\u6197i\\u0100;l\\u13f9\\u13fa\\u43d2on;\\u43a5ing;\\u416ecr;\\uc000\\ud835\\udcb0ilde;\\u4168ml\\u803b\\xdc\\u40dc\\u0480Dbcdefosv\\u1427\\u142c\\u1430\\u1433\\u143e\\u1485\\u148a\\u1490\\u1496ash;\\u62abar;\\u6aeby;\\u4412ash\\u0100;l\\u143b\\u143c\\u62a9;\\u6ae6\\u0100er\\u1443\\u1445;\\u62c1\\u0180bty\\u144c\\u1450\\u147aar;\\u6016\\u0100;i\\u144f\\u1455cal\\u0200BLST\\u1461\\u1465\\u146a\\u1474ar;\\u6223ine;\\u407ceparator;\\u6758ilde;\\u6240ThinSpace;\\u600ar;\\uc000\\ud835\\udd19pf;\\uc000\\ud835\\udd4dcr;\\uc000\\ud835\\udcb1dash;\\u62aa\\u0280cefos\\u14a7\\u14ac\\u14b1\\u14b6\\u14bcirc;\\u4174dge;\\u62c0r;\\uc000\\ud835\\udd1apf;\\uc000\\ud835\\udd4ecr;\\uc000\\ud835\\udcb2\\u0200fios\\u14cb\\u14d0\\u14d2\\u14d8r;\\uc000\\ud835\\udd1b;\\u439epf;\\uc000\\ud835\\udd4fcr;\\uc000\\ud835\\udcb3\\u0480AIUacfosu\\u14f1\\u14f5\\u14f9\\u14fd\\u1504\\u150f\\u1514\\u151a\\u1520cy;\\u442fcy;\\u4407cy;\\u442ecute\\u803b\\xdd\\u40dd\\u0100iy\\u1509\\u150drc;\\u4176;\\u442br;\\uc000\\ud835\\udd1cpf;\\uc000\\ud835\\udd50cr;\\uc000\\ud835\\udcb4ml;\\u4178\\u0400Hacdefos\\u1535\\u1539\\u153f\\u154b\\u154f\\u155d\\u1560\\u1564cy;\\u4416cute;\\u4179\\u0100ay\\u1544\\u1549ron;\\u417d;\\u4417ot;\\u417b\\u01f2\\u1554\\0\\u155boWidt\\xe8\\u0ad9a;\\u4396r;\\u6128pf;\\u6124cr;\\uc000\\ud835\\udcb5\\u0be1\\u1583\\u158a\\u1590\\0\\u15b0\\u15b6\\u15bf\\0\\0\\0\\0\\u15c6\\u15db\\u15eb\\u165f\\u166d\\0\\u1695\\u169b\\u16b2\\u16b9\\0\\u16becute\\u803b\\xe1\\u40e1reve;\\u4103\\u0300;Ediuy\\u159c\\u159d\\u15a1\\u15a3\\u15a8\\u15ad\\u623e;\\uc000\\u223e\\u0333;\\u623frc\\u803b\\xe2\\u40e2te\\u80bb\\xb4\\u0306;\\u4430lig\\u803b\\xe6\\u40e6\\u0100;r\\xb2\\u15ba;\\uc000\\ud835\\udd1erave\\u803b\\xe0\\u40e0\\u0100ep\\u15ca\\u15d6\\u0100fp\\u15cf\\u15d4sym;\\u6135\\xe8\\u15d3ha;\\u43b1\\u0100ap\\u15dfc\\u0100cl\\u15e4\\u15e7r;\\u4101g;\\u6a3f\\u0264\\u15f0\\0\\0\\u160a\\u0280;adsv\\u15fa\\u15fb\\u15ff\\u1601\\u1607\\u6227nd;\\u6a55;\\u6a5clope;\\u6a58;\\u6a5a\\u0380;elmrsz\\u1618\\u1619\\u161b\\u161e\\u163f\\u164f\\u1659\\u6220;\\u69a4e\\xbb\\u1619sd\\u0100;a\\u1625\\u1626\\u6221\\u0461\\u1630\\u1632\\u1634\\u1636\\u1638\\u163a\\u163c\\u163e;\\u69a8;\\u69a9;\\u69aa;\\u69ab;\\u69ac;\\u69ad;\\u69ae;\\u69aft\\u0100;v\\u1645\\u1646\\u621fb\\u0100;d\\u164c\\u164d\\u62be;\\u699d\\u0100pt\\u1654\\u1657h;\\u6222\\xbb\\xb9arr;\\u637c\\u0100gp\\u1663\\u1667on;\\u4105f;\\uc000\\ud835\\udd52\\u0380;Eaeiop\\u12c1\\u167b\\u167d\\u1682\\u1684\\u1687\\u168a;\\u6a70cir;\\u6a6f;\\u624ad;\\u624bs;\\u4027rox\\u0100;e\\u12c1\\u1692\\xf1\\u1683ing\\u803b\\xe5\\u40e5\\u0180cty\\u16a1\\u16a6\\u16a8r;\\uc000\\ud835\\udcb6;\\u402amp\\u0100;e\\u12c1\\u16af\\xf1\\u0288ilde\\u803b\\xe3\\u40e3ml\\u803b\\xe4\\u40e4\\u0100ci\\u16c2\\u16c8onin\\xf4\\u0272nt;\\u6a11\\u0800Nabcdefiklnoprsu\\u16ed\\u16f1\\u1730\\u173c\\u1743\\u1748\\u1778\\u177d\\u17e0\\u17e6\\u1839\\u1850\\u170d\\u193d\\u1948\\u1970ot;\\u6aed\\u0100cr\\u16f6\\u171ek\\u0200ceps\\u1700\\u1705\\u170d\\u1713ong;\\u624cpsilon;\\u43f6rime;\\u6035im\\u0100;e\\u171a\\u171b\\u623dq;\\u62cd\\u0176\\u1722\\u1726ee;\\u62bded\\u0100;g\\u172c\\u172d\\u6305e\\xbb\\u172drk\\u0100;t\\u135c\\u1737brk;\\u63b6\\u0100oy\\u1701\\u1741;\\u4431quo;\\u601e\\u0280cmprt\\u1753\\u175b\\u1761\\u1764\\u1768aus\\u0100;e\\u010a\\u0109ptyv;\\u69b0s\\xe9\\u170cno\\xf5\\u0113\\u0180ahw\\u176f\\u1771\\u1773;\\u43b2;\\u6136een;\\u626cr;\\uc000\\ud835\\udd1fg\\u0380costuvw\\u178d\\u179d\\u17b3\\u17c1\\u17d5\\u17db\\u17de\\u0180aiu\\u1794\\u1796\\u179a\\xf0\\u0760rc;\\u65efp\\xbb\\u1371\\u0180dpt\\u17a4\\u17a8\\u17adot;\\u6a00lus;\\u6a01imes;\\u6a02\\u0271\\u17b9\\0\\0\\u17becup;\\u6a06ar;\\u6605riangle\\u0100du\\u17cd\\u17d2own;\\u65bdp;\\u65b3plus;\\u6a04e\\xe5\\u1444\\xe5\\u14adarow;\\u690d\\u0180ako\\u17ed\\u1826\\u1835\\u0100cn\\u17f2\\u1823k\\u0180lst\\u17fa\\u05ab\\u1802ozenge;\\u69ebriangle\\u0200;dlr\\u1812\\u1813\\u1818\\u181d\\u65b4own;\\u65beeft;\\u65c2ight;\\u65b8k;\\u6423\\u01b1\\u182b\\0\\u1833\\u01b2\\u182f\\0\\u1831;\\u6592;\\u65914;\\u6593ck;\\u6588\\u0100eo\\u183e\\u184d\\u0100;q\\u1843\\u1846\\uc000=\\u20e5uiv;\\uc000\\u2261\\u20e5t;\\u6310\\u0200ptwx\\u1859\\u185e\\u1867\\u186cf;\\uc000\\ud835\\udd53\\u0100;t\\u13cb\\u1863om\\xbb\\u13cctie;\\u62c8\\u0600DHUVbdhmptuv\\u1885\\u1896\\u18aa\\u18bb\\u18d7\\u18db\\u18ec\\u18ff\\u1905\\u190a\\u1910\\u1921\\u0200LRlr\\u188e\\u1890\\u1892\\u1894;\\u6557;\\u6554;\\u6556;\\u6553\\u0280;DUdu\\u18a1\\u18a2\\u18a4\\u18a6\\u18a8\\u6550;\\u6566;\\u6569;\\u6564;\\u6567\\u0200LRlr\\u18b3\\u18b5\\u18b7\\u18b9;\\u655d;\\u655a;\\u655c;\\u6559\\u0380;HLRhlr\\u18ca\\u18cb\\u18cd\\u18cf\\u18d1\\u18d3\\u18d5\\u6551;\\u656c;\\u6563;\\u6560;\\u656b;\\u6562;\\u655fox;\\u69c9\\u0200LRlr\\u18e4\\u18e6\\u18e8\\u18ea;\\u6555;\\u6552;\\u6510;\\u650c\\u0280;DUdu\\u06bd\\u18f7\\u18f9\\u18fb\\u18fd;\\u6565;\\u6568;\\u652c;\\u6534inus;\\u629flus;\\u629eimes;\\u62a0\\u0200LRlr\\u1919\\u191b\\u191d\\u191f;\\u655b;\\u6558;\\u6518;\\u6514\\u0380;HLRhlr\\u1930\\u1931\\u1933\\u1935\\u1937\\u1939\\u193b\\u6502;\\u656a;\\u6561;\\u655e;\\u653c;\\u6524;\\u651c\\u0100ev\\u0123\\u1942bar\\u803b\\xa6\\u40a6\\u0200ceio\\u1951\\u1956\\u195a\\u1960r;\\uc000\\ud835\\udcb7mi;\\u604fm\\u0100;e\\u171a\\u171cl\\u0180;bh\\u1968\\u1969\\u196b\\u405c;\\u69c5sub;\\u67c8\\u016c\\u1974\\u197el\\u0100;e\\u1979\\u197a\\u6022t\\xbb\\u197ap\\u0180;Ee\\u012f\\u1985\\u1987;\\u6aae\\u0100;q\\u06dc\\u06db\\u0ce1\\u19a7\\0\\u19e8\\u1a11\\u1a15\\u1a32\\0\\u1a37\\u1a50\\0\\0\\u1ab4\\0\\0\\u1ac1\\0\\0\\u1b21\\u1b2e\\u1b4d\\u1b52\\0\\u1bfd\\0\\u1c0c\\u0180cpr\\u19ad\\u19b2\\u19ddute;\\u4107\\u0300;abcds\\u19bf\\u19c0\\u19c4\\u19ca\\u19d5\\u19d9\\u6229nd;\\u6a44rcup;\\u6a49\\u0100au\\u19cf\\u19d2p;\\u6a4bp;\\u6a47ot;\\u6a40;\\uc000\\u2229\\ufe00\\u0100eo\\u19e2\\u19e5t;\\u6041\\xee\\u0693\\u0200aeiu\\u19f0\\u19fb\\u1a01\\u1a05\\u01f0\\u19f5\\0\\u19f8s;\\u6a4don;\\u410ddil\\u803b\\xe7\\u40e7rc;\\u4109ps\\u0100;s\\u1a0c\\u1a0d\\u6a4cm;\\u6a50ot;\\u410b\\u0180dmn\\u1a1b\\u1a20\\u1a26il\\u80bb\\xb8\\u01adptyv;\\u69b2t\\u8100\\xa2;e\\u1a2d\\u1a2e\\u40a2r\\xe4\\u01b2r;\\uc000\\ud835\\udd20\\u0180cei\\u1a3d\\u1a40\\u1a4dy;\\u4447ck\\u0100;m\\u1a47\\u1a48\\u6713ark\\xbb\\u1a48;\\u43c7r\\u0380;Ecefms\\u1a5f\\u1a60\\u1a62\\u1a6b\\u1aa4\\u1aaa\\u1aae\\u65cb;\\u69c3\\u0180;el\\u1a69\\u1a6a\\u1a6d\\u42c6q;\\u6257e\\u0261\\u1a74\\0\\0\\u1a88rrow\\u0100lr\\u1a7c\\u1a81eft;\\u61baight;\\u61bb\\u0280RSacd\\u1a92\\u1a94\\u1a96\\u1a9a\\u1a9f\\xbb\\u0f47;\\u64c8st;\\u629birc;\\u629aash;\\u629dnint;\\u6a10id;\\u6aefcir;\\u69c2ubs\\u0100;u\\u1abb\\u1abc\\u6663it\\xbb\\u1abc\\u02ec\\u1ac7\\u1ad4\\u1afa\\0\\u1b0aon\\u0100;e\\u1acd\\u1ace\\u403a\\u0100;q\\xc7\\xc6\\u026d\\u1ad9\\0\\0\\u1ae2a\\u0100;t\\u1ade\\u1adf\\u402c;\\u4040\\u0180;fl\\u1ae8\\u1ae9\\u1aeb\\u6201\\xee\\u1160e\\u0100mx\\u1af1\\u1af6ent\\xbb\\u1ae9e\\xf3\\u024d\\u01e7\\u1afe\\0\\u1b07\\u0100;d\\u12bb\\u1b02ot;\\u6a6dn\\xf4\\u0246\\u0180fry\\u1b10\\u1b14\\u1b17;\\uc000\\ud835\\udd54o\\xe4\\u0254\\u8100\\xa9;s\\u0155\\u1b1dr;\\u6117\\u0100ao\\u1b25\\u1b29rr;\\u61b5ss;\\u6717\\u0100cu\\u1b32\\u1b37r;\\uc000\\ud835\\udcb8\\u0100bp\\u1b3c\\u1b44\\u0100;e\\u1b41\\u1b42\\u6acf;\\u6ad1\\u0100;e\\u1b49\\u1b4a\\u6ad0;\\u6ad2dot;\\u62ef\\u0380delprvw\\u1b60\\u1b6c\\u1b77\\u1b82\\u1bac\\u1bd4\\u1bf9arr\\u0100lr\\u1b68\\u1b6a;\\u6938;\\u6935\\u0270\\u1b72\\0\\0\\u1b75r;\\u62dec;\\u62dfarr\\u0100;p\\u1b7f\\u1b80\\u61b6;\\u693d\\u0300;bcdos\\u1b8f\\u1b90\\u1b96\\u1ba1\\u1ba5\\u1ba8\\u622arcap;\\u6a48\\u0100au\\u1b9b\\u1b9ep;\\u6a46p;\\u6a4aot;\\u628dr;\\u6a45;\\uc000\\u222a\\ufe00\\u0200alrv\\u1bb5\\u1bbf\\u1bde\\u1be3rr\\u0100;m\\u1bbc\\u1bbd\\u61b7;\\u693cy\\u0180evw\\u1bc7\\u1bd4\\u1bd8q\\u0270\\u1bce\\0\\0\\u1bd2re\\xe3\\u1b73u\\xe3\\u1b75ee;\\u62ceedge;\\u62cfen\\u803b\\xa4\\u40a4earrow\\u0100lr\\u1bee\\u1bf3eft\\xbb\\u1b80ight\\xbb\\u1bbde\\xe4\\u1bdd\\u0100ci\\u1c01\\u1c07onin\\xf4\\u01f7nt;\\u6231lcty;\\u632d\\u0980AHabcdefhijlorstuwz\\u1c38\\u1c3b\\u1c3f\\u1c5d\\u1c69\\u1c75\\u1c8a\\u1c9e\\u1cac\\u1cb7\\u1cfb\\u1cff\\u1d0d\\u1d7b\\u1d91\\u1dab\\u1dbb\\u1dc6\\u1dcdr\\xf2\\u0381ar;\\u6965\\u0200glrs\\u1c48\\u1c4d\\u1c52\\u1c54ger;\\u6020eth;\\u6138\\xf2\\u1133h\\u0100;v\\u1c5a\\u1c5b\\u6010\\xbb\\u090a\\u016b\\u1c61\\u1c67arow;\\u690fa\\xe3\\u0315\\u0100ay\\u1c6e\\u1c73ron;\\u410f;\\u4434\\u0180;ao\\u0332\\u1c7c\\u1c84\\u0100gr\\u02bf\\u1c81r;\\u61catseq;\\u6a77\\u0180glm\\u1c91\\u1c94\\u1c98\\u803b\\xb0\\u40b0ta;\\u43b4ptyv;\\u69b1\\u0100ir\\u1ca3\\u1ca8sht;\\u697f;\\uc000\\ud835\\udd21ar\\u0100lr\\u1cb3\\u1cb5\\xbb\\u08dc\\xbb\\u101e\\u0280aegsv\\u1cc2\\u0378\\u1cd6\\u1cdc\\u1ce0m\\u0180;os\\u0326\\u1cca\\u1cd4nd\\u0100;s\\u0326\\u1cd1uit;\\u6666amma;\\u43ddin;\\u62f2\\u0180;io\\u1ce7\\u1ce8\\u1cf8\\u40f7de\\u8100\\xf7;o\\u1ce7\\u1cf0ntimes;\\u62c7n\\xf8\\u1cf7cy;\\u4452c\\u026f\\u1d06\\0\\0\\u1d0arn;\\u631eop;\\u630d\\u0280lptuw\\u1d18\\u1d1d\\u1d22\\u1d49\\u1d55lar;\\u4024f;\\uc000\\ud835\\udd55\\u0280;emps\\u030b\\u1d2d\\u1d37\\u1d3d\\u1d42q\\u0100;d\\u0352\\u1d33ot;\\u6251inus;\\u6238lus;\\u6214quare;\\u62a1blebarwedg\\xe5\\xfan\\u0180adh\\u112e\\u1d5d\\u1d67ownarrow\\xf3\\u1c83arpoon\\u0100lr\\u1d72\\u1d76ef\\xf4\\u1cb4igh\\xf4\\u1cb6\\u0162\\u1d7f\\u1d85karo\\xf7\\u0f42\\u026f\\u1d8a\\0\\0\\u1d8ern;\\u631fop;\\u630c\\u0180cot\\u1d98\\u1da3\\u1da6\\u0100ry\\u1d9d\\u1da1;\\uc000\\ud835\\udcb9;\\u4455l;\\u69f6rok;\\u4111\\u0100dr\\u1db0\\u1db4ot;\\u62f1i\\u0100;f\\u1dba\\u1816\\u65bf\\u0100ah\\u1dc0\\u1dc3r\\xf2\\u0429a\\xf2\\u0fa6angle;\\u69a6\\u0100ci\\u1dd2\\u1dd5y;\\u445fgrarr;\\u67ff\\u0900Dacdefglmnopqrstux\\u1e01\\u1e09\\u1e19\\u1e38\\u0578\\u1e3c\\u1e49\\u1e61\\u1e7e\\u1ea5\\u1eaf\\u1ebd\\u1ee1\\u1f2a\\u1f37\\u1f44\\u1f4e\\u1f5a\\u0100Do\\u1e06\\u1d34o\\xf4\\u1c89\\u0100cs\\u1e0e\\u1e14ute\\u803b\\xe9\\u40e9ter;\\u6a6e\\u0200aioy\\u1e22\\u1e27\\u1e31\\u1e36ron;\\u411br\\u0100;c\\u1e2d\\u1e2e\\u6256\\u803b\\xea\\u40ealon;\\u6255;\\u444dot;\\u4117\\u0100Dr\\u1e41\\u1e45ot;\\u6252;\\uc000\\ud835\\udd22\\u0180;rs\\u1e50\\u1e51\\u1e57\\u6a9aave\\u803b\\xe8\\u40e8\\u0100;d\\u1e5c\\u1e5d\\u6a96ot;\\u6a98\\u0200;ils\\u1e6a\\u1e6b\\u1e72\\u1e74\\u6a99nters;\\u63e7;\\u6113\\u0100;d\\u1e79\\u1e7a\\u6a95ot;\\u6a97\\u0180aps\\u1e85\\u1e89\\u1e97cr;\\u4113ty\\u0180;sv\\u1e92\\u1e93\\u1e95\\u6205et\\xbb\\u1e93p\\u01001;\\u1e9d\\u1ea4\\u0133\\u1ea1\\u1ea3;\\u6004;\\u6005\\u6003\\u0100gs\\u1eaa\\u1eac;\\u414bp;\\u6002\\u0100gp\\u1eb4\\u1eb8on;\\u4119f;\\uc000\\ud835\\udd56\\u0180als\\u1ec4\\u1ece\\u1ed2r\\u0100;s\\u1eca\\u1ecb\\u62d5l;\\u69e3us;\\u6a71i\\u0180;lv\\u1eda\\u1edb\\u1edf\\u43b5on\\xbb\\u1edb;\\u43f5\\u0200csuv\\u1eea\\u1ef3\\u1f0b\\u1f23\\u0100io\\u1eef\\u1e31rc\\xbb\\u1e2e\\u0269\\u1ef9\\0\\0\\u1efb\\xed\\u0548ant\\u0100gl\\u1f02\\u1f06tr\\xbb\\u1e5dess\\xbb\\u1e7a\\u0180aei\\u1f12\\u1f16\\u1f1als;\\u403dst;\\u625fv\\u0100;D\\u0235\\u1f20D;\\u6a78parsl;\\u69e5\\u0100Da\\u1f2f\\u1f33ot;\\u6253rr;\\u6971\\u0180cdi\\u1f3e\\u1f41\\u1ef8r;\\u612fo\\xf4\\u0352\\u0100ah\\u1f49\\u1f4b;\\u43b7\\u803b\\xf0\\u40f0\\u0100mr\\u1f53\\u1f57l\\u803b\\xeb\\u40ebo;\\u60ac\\u0180cip\\u1f61\\u1f64\\u1f67l;\\u4021s\\xf4\\u056e\\u0100eo\\u1f6c\\u1f74ctatio\\xee\\u0559nential\\xe5\\u0579\\u09e1\\u1f92\\0\\u1f9e\\0\\u1fa1\\u1fa7\\0\\0\\u1fc6\\u1fcc\\0\\u1fd3\\0\\u1fe6\\u1fea\\u2000\\0\\u2008\\u205allingdotse\\xf1\\u1e44y;\\u4444male;\\u6640\\u0180ilr\\u1fad\\u1fb3\\u1fc1lig;\\u8000\\ufb03\\u0269\\u1fb9\\0\\0\\u1fbdg;\\u8000\\ufb00ig;\\u8000\\ufb04;\\uc000\\ud835\\udd23lig;\\u8000\\ufb01lig;\\uc000fj\\u0180alt\\u1fd9\\u1fdc\\u1fe1t;\\u666dig;\\u8000\\ufb02ns;\\u65b1of;\\u4192\\u01f0\\u1fee\\0\\u1ff3f;\\uc000\\ud835\\udd57\\u0100ak\\u05bf\\u1ff7\\u0100;v\\u1ffc\\u1ffd\\u62d4;\\u6ad9artint;\\u6a0d\\u0100ao\\u200c\\u2055\\u0100cs\\u2011\\u2052\\u03b1\\u201a\\u2030\\u2038\\u2045\\u2048\\0\\u2050\\u03b2\\u2022\\u2025\\u2027\\u202a\\u202c\\0\\u202e\\u803b\\xbd\\u40bd;\\u6153\\u803b\\xbc\\u40bc;\\u6155;\\u6159;\\u615b\\u01b3\\u2034\\0\\u2036;\\u6154;\\u6156\\u02b4\\u203e\\u2041\\0\\0\\u2043\\u803b\\xbe\\u40be;\\u6157;\\u615c5;\\u6158\\u01b6\\u204c\\0\\u204e;\\u615a;\\u615d8;\\u615el;\\u6044wn;\\u6322cr;\\uc000\\ud835\\udcbb\\u0880Eabcdefgijlnorstv\\u2082\\u2089\\u209f\\u20a5\\u20b0\\u20b4\\u20f0\\u20f5\\u20fa\\u20ff\\u2103\\u2112\\u2138\\u0317\\u213e\\u2152\\u219e\\u0100;l\\u064d\\u2087;\\u6a8c\\u0180cmp\\u2090\\u2095\\u209dute;\\u41f5ma\\u0100;d\\u209c\\u1cda\\u43b3;\\u6a86reve;\\u411f\\u0100iy\\u20aa\\u20aerc;\\u411d;\\u4433ot;\\u4121\\u0200;lqs\\u063e\\u0642\\u20bd\\u20c9\\u0180;qs\\u063e\\u064c\\u20c4lan\\xf4\\u0665\\u0200;cdl\\u0665\\u20d2\\u20d5\\u20e5c;\\u6aa9ot\\u0100;o\\u20dc\\u20dd\\u6a80\\u0100;l\\u20e2\\u20e3\\u6a82;\\u6a84\\u0100;e\\u20ea\\u20ed\\uc000\\u22db\\ufe00s;\\u6a94r;\\uc000\\ud835\\udd24\\u0100;g\\u0673\\u061bmel;\\u6137cy;\\u4453\\u0200;Eaj\\u065a\\u210c\\u210e\\u2110;\\u6a92;\\u6aa5;\\u6aa4\\u0200Eaes\\u211b\\u211d\\u2129\\u2134;\\u6269p\\u0100;p\\u2123\\u2124\\u6a8arox\\xbb\\u2124\\u0100;q\\u212e\\u212f\\u6a88\\u0100;q\\u212e\\u211bim;\\u62e7pf;\\uc000\\ud835\\udd58\\u0100ci\\u2143\\u2146r;\\u610am\\u0180;el\\u066b\\u214e\\u2150;\\u6a8e;\\u6a90\\u8300>;cdlqr\\u05ee\\u2160\\u216a\\u216e\\u2173\\u2179\\u0100ci\\u2165\\u2167;\\u6aa7r;\\u6a7aot;\\u62d7Par;\\u6995uest;\\u6a7c\\u0280adels\\u2184\\u216a\\u2190\\u0656\\u219b\\u01f0\\u2189\\0\\u218epro\\xf8\\u209er;\\u6978q\\u0100lq\\u063f\\u2196les\\xf3\\u2088i\\xed\\u066b\\u0100en\\u21a3\\u21adrtneqq;\\uc000\\u2269\\ufe00\\xc5\\u21aa\\u0500Aabcefkosy\\u21c4\\u21c7\\u21f1\\u21f5\\u21fa\\u2218\\u221d\\u222f\\u2268\\u227dr\\xf2\\u03a0\\u0200ilmr\\u21d0\\u21d4\\u21d7\\u21dbrs\\xf0\\u1484f\\xbb\\u2024il\\xf4\\u06a9\\u0100dr\\u21e0\\u21e4cy;\\u444a\\u0180;cw\\u08f4\\u21eb\\u21efir;\\u6948;\\u61adar;\\u610firc;\\u4125\\u0180alr\\u2201\\u220e\\u2213rts\\u0100;u\\u2209\\u220a\\u6665it\\xbb\\u220alip;\\u6026con;\\u62b9r;\\uc000\\ud835\\udd25s\\u0100ew\\u2223\\u2229arow;\\u6925arow;\\u6926\\u0280amopr\\u223a\\u223e\\u2243\\u225e\\u2263rr;\\u61fftht;\\u623bk\\u0100lr\\u2249\\u2253eftarrow;\\u61a9ightarrow;\\u61aaf;\\uc000\\ud835\\udd59bar;\\u6015\\u0180clt\\u226f\\u2274\\u2278r;\\uc000\\ud835\\udcbdas\\xe8\\u21f4rok;\\u4127\\u0100bp\\u2282\\u2287ull;\\u6043hen\\xbb\\u1c5b\\u0ae1\\u22a3\\0\\u22aa\\0\\u22b8\\u22c5\\u22ce\\0\\u22d5\\u22f3\\0\\0\\u22f8\\u2322\\u2367\\u2362\\u237f\\0\\u2386\\u23aa\\u23b4cute\\u803b\\xed\\u40ed\\u0180;iy\\u0771\\u22b0\\u22b5rc\\u803b\\xee\\u40ee;\\u4438\\u0100cx\\u22bc\\u22bfy;\\u4435cl\\u803b\\xa1\\u40a1\\u0100fr\\u039f\\u22c9;\\uc000\\ud835\\udd26rave\\u803b\\xec\\u40ec\\u0200;ino\\u073e\\u22dd\\u22e9\\u22ee\\u0100in\\u22e2\\u22e6nt;\\u6a0ct;\\u622dfin;\\u69dcta;\\u6129lig;\\u4133\\u0180aop\\u22fe\\u231a\\u231d\\u0180cgt\\u2305\\u2308\\u2317r;\\u412b\\u0180elp\\u071f\\u230f\\u2313in\\xe5\\u078ear\\xf4\\u0720h;\\u4131f;\\u62b7ed;\\u41b5\\u0280;cfot\\u04f4\\u232c\\u2331\\u233d\\u2341are;\\u6105in\\u0100;t\\u2338\\u2339\\u621eie;\\u69dddo\\xf4\\u2319\\u0280;celp\\u0757\\u234c\\u2350\\u235b\\u2361al;\\u62ba\\u0100gr\\u2355\\u2359er\\xf3\\u1563\\xe3\\u234darhk;\\u6a17rod;\\u6a3c\\u0200cgpt\\u236f\\u2372\\u2376\\u237by;\\u4451on;\\u412ff;\\uc000\\ud835\\udd5aa;\\u43b9uest\\u803b\\xbf\\u40bf\\u0100ci\\u238a\\u238fr;\\uc000\\ud835\\udcben\\u0280;Edsv\\u04f4\\u239b\\u239d\\u23a1\\u04f3;\\u62f9ot;\\u62f5\\u0100;v\\u23a6\\u23a7\\u62f4;\\u62f3\\u0100;i\\u0777\\u23aelde;\\u4129\\u01eb\\u23b8\\0\\u23bccy;\\u4456l\\u803b\\xef\\u40ef\\u0300cfmosu\\u23cc\\u23d7\\u23dc\\u23e1\\u23e7\\u23f5\\u0100iy\\u23d1\\u23d5rc;\\u4135;\\u4439r;\\uc000\\ud835\\udd27ath;\\u4237pf;\\uc000\\ud835\\udd5b\\u01e3\\u23ec\\0\\u23f1r;\\uc000\\ud835\\udcbfrcy;\\u4458kcy;\\u4454\\u0400acfghjos\\u240b\\u2416\\u2422\\u2427\\u242d\\u2431\\u2435\\u243bppa\\u0100;v\\u2413\\u2414\\u43ba;\\u43f0\\u0100ey\\u241b\\u2420dil;\\u4137;\\u443ar;\\uc000\\ud835\\udd28reen;\\u4138cy;\\u4445cy;\\u445cpf;\\uc000\\ud835\\udd5ccr;\\uc000\\ud835\\udcc0\\u0b80ABEHabcdefghjlmnoprstuv\\u2470\\u2481\\u2486\\u248d\\u2491\\u250e\\u253d\\u255a\\u2580\\u264e\\u265e\\u2665\\u2679\\u267d\\u269a\\u26b2\\u26d8\\u275d\\u2768\\u278b\\u27c0\\u2801\\u2812\\u0180art\\u2477\\u247a\\u247cr\\xf2\\u09c6\\xf2\\u0395ail;\\u691barr;\\u690e\\u0100;g\\u0994\\u248b;\\u6a8bar;\\u6962\\u0963\\u24a5\\0\\u24aa\\0\\u24b1\\0\\0\\0\\0\\0\\u24b5\\u24ba\\0\\u24c6\\u24c8\\u24cd\\0\\u24f9ute;\\u413amptyv;\\u69b4ra\\xee\\u084cbda;\\u43bbg\\u0180;dl\\u088e\\u24c1\\u24c3;\\u6991\\xe5\\u088e;\\u6a85uo\\u803b\\xab\\u40abr\\u0400;bfhlpst\\u0899\\u24de\\u24e6\\u24e9\\u24eb\\u24ee\\u24f1\\u24f5\\u0100;f\\u089d\\u24e3s;\\u691fs;\\u691d\\xeb\\u2252p;\\u61abl;\\u6939im;\\u6973l;\\u61a2\\u0180;ae\\u24ff\\u2500\\u2504\\u6aabil;\\u6919\\u0100;s\\u2509\\u250a\\u6aad;\\uc000\\u2aad\\ufe00\\u0180abr\\u2515\\u2519\\u251drr;\\u690crk;\\u6772\\u0100ak\\u2522\\u252cc\\u0100ek\\u2528\\u252a;\\u407b;\\u405b\\u0100es\\u2531\\u2533;\\u698bl\\u0100du\\u2539\\u253b;\\u698f;\\u698d\\u0200aeuy\\u2546\\u254b\\u2556\\u2558ron;\\u413e\\u0100di\\u2550\\u2554il;\\u413c\\xec\\u08b0\\xe2\\u2529;\\u443b\\u0200cqrs\\u2563\\u2566\\u256d\\u257da;\\u6936uo\\u0100;r\\u0e19\\u1746\\u0100du\\u2572\\u2577har;\\u6967shar;\\u694bh;\\u61b2\\u0280;fgqs\\u258b\\u258c\\u0989\\u25f3\\u25ff\\u6264t\\u0280ahlrt\\u2598\\u25a4\\u25b7\\u25c2\\u25e8rrow\\u0100;t\\u0899\\u25a1a\\xe9\\u24f6arpoon\\u0100du\\u25af\\u25b4own\\xbb\\u045ap\\xbb\\u0966eftarrows;\\u61c7ight\\u0180ahs\\u25cd\\u25d6\\u25derrow\\u0100;s\\u08f4\\u08a7arpoon\\xf3\\u0f98quigarro\\xf7\\u21f0hreetimes;\\u62cb\\u0180;qs\\u258b\\u0993\\u25falan\\xf4\\u09ac\\u0280;cdgs\\u09ac\\u260a\\u260d\\u261d\\u2628c;\\u6aa8ot\\u0100;o\\u2614\\u2615\\u6a7f\\u0100;r\\u261a\\u261b\\u6a81;\\u6a83\\u0100;e\\u2622\\u2625\\uc000\\u22da\\ufe00s;\\u6a93\\u0280adegs\\u2633\\u2639\\u263d\\u2649\\u264bppro\\xf8\\u24c6ot;\\u62d6q\\u0100gq\\u2643\\u2645\\xf4\\u0989gt\\xf2\\u248c\\xf4\\u099bi\\xed\\u09b2\\u0180ilr\\u2655\\u08e1\\u265asht;\\u697c;\\uc000\\ud835\\udd29\\u0100;E\\u099c\\u2663;\\u6a91\\u0161\\u2669\\u2676r\\u0100du\\u25b2\\u266e\\u0100;l\\u0965\\u2673;\\u696alk;\\u6584cy;\\u4459\\u0280;acht\\u0a48\\u2688\\u268b\\u2691\\u2696r\\xf2\\u25c1orne\\xf2\\u1d08ard;\\u696bri;\\u65fa\\u0100io\\u269f\\u26a4dot;\\u4140ust\\u0100;a\\u26ac\\u26ad\\u63b0che\\xbb\\u26ad\\u0200Eaes\\u26bb\\u26bd\\u26c9\\u26d4;\\u6268p\\u0100;p\\u26c3\\u26c4\\u6a89rox\\xbb\\u26c4\\u0100;q\\u26ce\\u26cf\\u6a87\\u0100;q\\u26ce\\u26bbim;\\u62e6\\u0400abnoptwz\\u26e9\\u26f4\\u26f7\\u271a\\u272f\\u2741\\u2747\\u2750\\u0100nr\\u26ee\\u26f1g;\\u67ecr;\\u61fdr\\xeb\\u08c1g\\u0180lmr\\u26ff\\u270d\\u2714eft\\u0100ar\\u09e6\\u2707ight\\xe1\\u09f2apsto;\\u67fcight\\xe1\\u09fdparrow\\u0100lr\\u2725\\u2729ef\\xf4\\u24edight;\\u61ac\\u0180afl\\u2736\\u2739\\u273dr;\\u6985;\\uc000\\ud835\\udd5dus;\\u6a2dimes;\\u6a34\\u0161\\u274b\\u274fst;\\u6217\\xe1\\u134e\\u0180;ef\\u2757\\u2758\\u1800\\u65cange\\xbb\\u2758ar\\u0100;l\\u2764\\u2765\\u4028t;\\u6993\\u0280achmt\\u2773\\u2776\\u277c\\u2785\\u2787r\\xf2\\u08a8orne\\xf2\\u1d8car\\u0100;d\\u0f98\\u2783;\\u696d;\\u600eri;\\u62bf\\u0300achiqt\\u2798\\u279d\\u0a40\\u27a2\\u27ae\\u27bbquo;\\u6039r;\\uc000\\ud835\\udcc1m\\u0180;eg\\u09b2\\u27aa\\u27ac;\\u6a8d;\\u6a8f\\u0100bu\\u252a\\u27b3o\\u0100;r\\u0e1f\\u27b9;\\u601arok;\\u4142\\u8400<;cdhilqr\\u082b\\u27d2\\u2639\\u27dc\\u27e0\\u27e5\\u27ea\\u27f0\\u0100ci\\u27d7\\u27d9;\\u6aa6r;\\u6a79re\\xe5\\u25f2mes;\\u62c9arr;\\u6976uest;\\u6a7b\\u0100Pi\\u27f5\\u27f9ar;\\u6996\\u0180;ef\\u2800\\u092d\\u181b\\u65c3r\\u0100du\\u2807\\u280dshar;\\u694ahar;\\u6966\\u0100en\\u2817\\u2821rtneqq;\\uc000\\u2268\\ufe00\\xc5\\u281e\\u0700Dacdefhilnopsu\\u2840\\u2845\\u2882\\u288e\\u2893\\u28a0\\u28a5\\u28a8\\u28da\\u28e2\\u28e4\\u0a83\\u28f3\\u2902Dot;\\u623a\\u0200clpr\\u284e\\u2852\\u2863\\u287dr\\u803b\\xaf\\u40af\\u0100et\\u2857\\u2859;\\u6642\\u0100;e\\u285e\\u285f\\u6720se\\xbb\\u285f\\u0100;s\\u103b\\u2868to\\u0200;dlu\\u103b\\u2873\\u2877\\u287bow\\xee\\u048cef\\xf4\\u090f\\xf0\\u13d1ker;\\u65ae\\u0100oy\\u2887\\u288cmma;\\u6a29;\\u443cash;\\u6014asuredangle\\xbb\\u1626r;\\uc000\\ud835\\udd2ao;\\u6127\\u0180cdn\\u28af\\u28b4\\u28c9ro\\u803b\\xb5\\u40b5\\u0200;acd\\u1464\\u28bd\\u28c0\\u28c4s\\xf4\\u16a7ir;\\u6af0ot\\u80bb\\xb7\\u01b5us\\u0180;bd\\u28d2\\u1903\\u28d3\\u6212\\u0100;u\\u1d3c\\u28d8;\\u6a2a\\u0163\\u28de\\u28e1p;\\u6adb\\xf2\\u2212\\xf0\\u0a81\\u0100dp\\u28e9\\u28eeels;\\u62a7f;\\uc000\\ud835\\udd5e\\u0100ct\\u28f8\\u28fdr;\\uc000\\ud835\\udcc2pos\\xbb\\u159d\\u0180;lm\\u2909\\u290a\\u290d\\u43bctimap;\\u62b8\\u0c00GLRVabcdefghijlmoprstuvw\\u2942\\u2953\\u297e\\u2989\\u2998\\u29da\\u29e9\\u2a15\\u2a1a\\u2a58\\u2a5d\\u2a83\\u2a95\\u2aa4\\u2aa8\\u2b04\\u2b07\\u2b44\\u2b7f\\u2bae\\u2c34\\u2c67\\u2c7c\\u2ce9\\u0100gt\\u2947\\u294b;\\uc000\\u22d9\\u0338\\u0100;v\\u2950\\u0bcf\\uc000\\u226b\\u20d2\\u0180elt\\u295a\\u2972\\u2976ft\\u0100ar\\u2961\\u2967rrow;\\u61cdightarrow;\\u61ce;\\uc000\\u22d8\\u0338\\u0100;v\\u297b\\u0c47\\uc000\\u226a\\u20d2ightarrow;\\u61cf\\u0100Dd\\u298e\\u2993ash;\\u62afash;\\u62ae\\u0280bcnpt\\u29a3\\u29a7\\u29ac\\u29b1\\u29ccla\\xbb\\u02deute;\\u4144g;\\uc000\\u2220\\u20d2\\u0280;Eiop\\u0d84\\u29bc\\u29c0\\u29c5\\u29c8;\\uc000\\u2a70\\u0338d;\\uc000\\u224b\\u0338s;\\u4149ro\\xf8\\u0d84ur\\u0100;a\\u29d3\\u29d4\\u666el\\u0100;s\\u29d3\\u0b38\\u01f3\\u29df\\0\\u29e3p\\u80bb\\xa0\\u0b37mp\\u0100;e\\u0bf9\\u0c00\\u0280aeouy\\u29f4\\u29fe\\u2a03\\u2a10\\u2a13\\u01f0\\u29f9\\0\\u29fb;\\u6a43on;\\u4148dil;\\u4146ng\\u0100;d\\u0d7e\\u2a0aot;\\uc000\\u2a6d\\u0338p;\\u6a42;\\u443dash;\\u6013\\u0380;Aadqsx\\u0b92\\u2a29\\u2a2d\\u2a3b\\u2a41\\u2a45\\u2a50rr;\\u61d7r\\u0100hr\\u2a33\\u2a36k;\\u6924\\u0100;o\\u13f2\\u13f0ot;\\uc000\\u2250\\u0338ui\\xf6\\u0b63\\u0100ei\\u2a4a\\u2a4ear;\\u6928\\xed\\u0b98ist\\u0100;s\\u0ba0\\u0b9fr;\\uc000\\ud835\\udd2b\\u0200Eest\\u0bc5\\u2a66\\u2a79\\u2a7c\\u0180;qs\\u0bbc\\u2a6d\\u0be1\\u0180;qs\\u0bbc\\u0bc5\\u2a74lan\\xf4\\u0be2i\\xed\\u0bea\\u0100;r\\u0bb6\\u2a81\\xbb\\u0bb7\\u0180Aap\\u2a8a\\u2a8d\\u2a91r\\xf2\\u2971rr;\\u61aear;\\u6af2\\u0180;sv\\u0f8d\\u2a9c\\u0f8c\\u0100;d\\u2aa1\\u2aa2\\u62fc;\\u62facy;\\u445a\\u0380AEadest\\u2ab7\\u2aba\\u2abe\\u2ac2\\u2ac5\\u2af6\\u2af9r\\xf2\\u2966;\\uc000\\u2266\\u0338rr;\\u619ar;\\u6025\\u0200;fqs\\u0c3b\\u2ace\\u2ae3\\u2aeft\\u0100ar\\u2ad4\\u2ad9rro\\xf7\\u2ac1ightarro\\xf7\\u2a90\\u0180;qs\\u0c3b\\u2aba\\u2aealan\\xf4\\u0c55\\u0100;s\\u0c55\\u2af4\\xbb\\u0c36i\\xed\\u0c5d\\u0100;r\\u0c35\\u2afei\\u0100;e\\u0c1a\\u0c25i\\xe4\\u0d90\\u0100pt\\u2b0c\\u2b11f;\\uc000\\ud835\\udd5f\\u8180\\xac;in\\u2b19\\u2b1a\\u2b36\\u40acn\\u0200;Edv\\u0b89\\u2b24\\u2b28\\u2b2e;\\uc000\\u22f9\\u0338ot;\\uc000\\u22f5\\u0338\\u01e1\\u0b89\\u2b33\\u2b35;\\u62f7;\\u62f6i\\u0100;v\\u0cb8\\u2b3c\\u01e1\\u0cb8\\u2b41\\u2b43;\\u62fe;\\u62fd\\u0180aor\\u2b4b\\u2b63\\u2b69r\\u0200;ast\\u0b7b\\u2b55\\u2b5a\\u2b5flle\\xec\\u0b7bl;\\uc000\\u2afd\\u20e5;\\uc000\\u2202\\u0338lint;\\u6a14\\u0180;ce\\u0c92\\u2b70\\u2b73u\\xe5\\u0ca5\\u0100;c\\u0c98\\u2b78\\u0100;e\\u0c92\\u2b7d\\xf1\\u0c98\\u0200Aait\\u2b88\\u2b8b\\u2b9d\\u2ba7r\\xf2\\u2988rr\\u0180;cw\\u2b94\\u2b95\\u2b99\\u619b;\\uc000\\u2933\\u0338;\\uc000\\u219d\\u0338ghtarrow\\xbb\\u2b95ri\\u0100;e\\u0ccb\\u0cd6\\u0380chimpqu\\u2bbd\\u2bcd\\u2bd9\\u2b04\\u0b78\\u2be4\\u2bef\\u0200;cer\\u0d32\\u2bc6\\u0d37\\u2bc9u\\xe5\\u0d45;\\uc000\\ud835\\udcc3ort\\u026d\\u2b05\\0\\0\\u2bd6ar\\xe1\\u2b56m\\u0100;e\\u0d6e\\u2bdf\\u0100;q\\u0d74\\u0d73su\\u0100bp\\u2beb\\u2bed\\xe5\\u0cf8\\xe5\\u0d0b\\u0180bcp\\u2bf6\\u2c11\\u2c19\\u0200;Ees\\u2bff\\u2c00\\u0d22\\u2c04\\u6284;\\uc000\\u2ac5\\u0338et\\u0100;e\\u0d1b\\u2c0bq\\u0100;q\\u0d23\\u2c00c\\u0100;e\\u0d32\\u2c17\\xf1\\u0d38\\u0200;Ees\\u2c22\\u2c23\\u0d5f\\u2c27\\u6285;\\uc000\\u2ac6\\u0338et\\u0100;e\\u0d58\\u2c2eq\\u0100;q\\u0d60\\u2c23\\u0200gilr\\u2c3d\\u2c3f\\u2c45\\u2c47\\xec\\u0bd7lde\\u803b\\xf1\\u40f1\\xe7\\u0c43iangle\\u0100lr\\u2c52\\u2c5ceft\\u0100;e\\u0c1a\\u2c5a\\xf1\\u0c26ight\\u0100;e\\u0ccb\\u2c65\\xf1\\u0cd7\\u0100;m\\u2c6c\\u2c6d\\u43bd\\u0180;es\\u2c74\\u2c75\\u2c79\\u4023ro;\\u6116p;\\u6007\\u0480DHadgilrs\\u2c8f\\u2c94\\u2c99\\u2c9e\\u2ca3\\u2cb0\\u2cb6\\u2cd3\\u2ce3ash;\\u62adarr;\\u6904p;\\uc000\\u224d\\u20d2ash;\\u62ac\\u0100et\\u2ca8\\u2cac;\\uc000\\u2265\\u20d2;\\uc000>\\u20d2nfin;\\u69de\\u0180Aet\\u2cbd\\u2cc1\\u2cc5rr;\\u6902;\\uc000\\u2264\\u20d2\\u0100;r\\u2cca\\u2ccd\\uc000<\\u20d2ie;\\uc000\\u22b4\\u20d2\\u0100At\\u2cd8\\u2cdcrr;\\u6903rie;\\uc000\\u22b5\\u20d2im;\\uc000\\u223c\\u20d2\\u0180Aan\\u2cf0\\u2cf4\\u2d02rr;\\u61d6r\\u0100hr\\u2cfa\\u2cfdk;\\u6923\\u0100;o\\u13e7\\u13e5ear;\\u6927\\u1253\\u1a95\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\u2d2d\\0\\u2d38\\u2d48\\u2d60\\u2d65\\u2d72\\u2d84\\u1b07\\0\\0\\u2d8d\\u2dab\\0\\u2dc8\\u2dce\\0\\u2ddc\\u2e19\\u2e2b\\u2e3e\\u2e43\\u0100cs\\u2d31\\u1a97ute\\u803b\\xf3\\u40f3\\u0100iy\\u2d3c\\u2d45r\\u0100;c\\u1a9e\\u2d42\\u803b\\xf4\\u40f4;\\u443e\\u0280abios\\u1aa0\\u2d52\\u2d57\\u01c8\\u2d5alac;\\u4151v;\\u6a38old;\\u69bclig;\\u4153\\u0100cr\\u2d69\\u2d6dir;\\u69bf;\\uc000\\ud835\\udd2c\\u036f\\u2d79\\0\\0\\u2d7c\\0\\u2d82n;\\u42dbave\\u803b\\xf2\\u40f2;\\u69c1\\u0100bm\\u2d88\\u0df4ar;\\u69b5\\u0200acit\\u2d95\\u2d98\\u2da5\\u2da8r\\xf2\\u1a80\\u0100ir\\u2d9d\\u2da0r;\\u69beoss;\\u69bbn\\xe5\\u0e52;\\u69c0\\u0180aei\\u2db1\\u2db5\\u2db9cr;\\u414dga;\\u43c9\\u0180cdn\\u2dc0\\u2dc5\\u01cdron;\\u43bf;\\u69b6pf;\\uc000\\ud835\\udd60\\u0180ael\\u2dd4\\u2dd7\\u01d2r;\\u69b7rp;\\u69b9\\u0380;adiosv\\u2dea\\u2deb\\u2dee\\u2e08\\u2e0d\\u2e10\\u2e16\\u6228r\\xf2\\u1a86\\u0200;efm\\u2df7\\u2df8\\u2e02\\u2e05\\u6a5dr\\u0100;o\\u2dfe\\u2dff\\u6134f\\xbb\\u2dff\\u803b\\xaa\\u40aa\\u803b\\xba\\u40bagof;\\u62b6r;\\u6a56lope;\\u6a57;\\u6a5b\\u0180clo\\u2e1f\\u2e21\\u2e27\\xf2\\u2e01ash\\u803b\\xf8\\u40f8l;\\u6298i\\u016c\\u2e2f\\u2e34de\\u803b\\xf5\\u40f5es\\u0100;a\\u01db\\u2e3as;\\u6a36ml\\u803b\\xf6\\u40f6bar;\\u633d\\u0ae1\\u2e5e\\0\\u2e7d\\0\\u2e80\\u2e9d\\0\\u2ea2\\u2eb9\\0\\0\\u2ecb\\u0e9c\\0\\u2f13\\0\\0\\u2f2b\\u2fbc\\0\\u2fc8r\\u0200;ast\\u0403\\u2e67\\u2e72\\u0e85\\u8100\\xb6;l\\u2e6d\\u2e6e\\u40b6le\\xec\\u0403\\u0269\\u2e78\\0\\0\\u2e7bm;\\u6af3;\\u6afdy;\\u443fr\\u0280cimpt\\u2e8b\\u2e8f\\u2e93\\u1865\\u2e97nt;\\u4025od;\\u402eil;\\u6030enk;\\u6031r;\\uc000\\ud835\\udd2d\\u0180imo\\u2ea8\\u2eb0\\u2eb4\\u0100;v\\u2ead\\u2eae\\u43c6;\\u43d5ma\\xf4\\u0a76ne;\\u660e\\u0180;tv\\u2ebf\\u2ec0\\u2ec8\\u43c0chfork\\xbb\\u1ffd;\\u43d6\\u0100au\\u2ecf\\u2edfn\\u0100ck\\u2ed5\\u2eddk\\u0100;h\\u21f4\\u2edb;\\u610e\\xf6\\u21f4s\\u0480;abcdemst\\u2ef3\\u2ef4\\u1908\\u2ef9\\u2efd\\u2f04\\u2f06\\u2f0a\\u2f0e\\u402bcir;\\u6a23ir;\\u6a22\\u0100ou\\u1d40\\u2f02;\\u6a25;\\u6a72n\\u80bb\\xb1\\u0e9dim;\\u6a26wo;\\u6a27\\u0180ipu\\u2f19\\u2f20\\u2f25ntint;\\u6a15f;\\uc000\\ud835\\udd61nd\\u803b\\xa3\\u40a3\\u0500;Eaceinosu\\u0ec8\\u2f3f\\u2f41\\u2f44\\u2f47\\u2f81\\u2f89\\u2f92\\u2f7e\\u2fb6;\\u6ab3p;\\u6ab7u\\xe5\\u0ed9\\u0100;c\\u0ece\\u2f4c\\u0300;acens\\u0ec8\\u2f59\\u2f5f\\u2f66\\u2f68\\u2f7eppro\\xf8\\u2f43urlye\\xf1\\u0ed9\\xf1\\u0ece\\u0180aes\\u2f6f\\u2f76\\u2f7approx;\\u6ab9qq;\\u6ab5im;\\u62e8i\\xed\\u0edfme\\u0100;s\\u2f88\\u0eae\\u6032\\u0180Eas\\u2f78\\u2f90\\u2f7a\\xf0\\u2f75\\u0180dfp\\u0eec\\u2f99\\u2faf\\u0180als\\u2fa0\\u2fa5\\u2faalar;\\u632eine;\\u6312urf;\\u6313\\u0100;t\\u0efb\\u2fb4\\xef\\u0efbrel;\\u62b0\\u0100ci\\u2fc0\\u2fc5r;\\uc000\\ud835\\udcc5;\\u43c8ncsp;\\u6008\\u0300fiopsu\\u2fda\\u22e2\\u2fdf\\u2fe5\\u2feb\\u2ff1r;\\uc000\\ud835\\udd2epf;\\uc000\\ud835\\udd62rime;\\u6057cr;\\uc000\\ud835\\udcc6\\u0180aeo\\u2ff8\\u3009\\u3013t\\u0100ei\\u2ffe\\u3005rnion\\xf3\\u06b0nt;\\u6a16st\\u0100;e\\u3010\\u3011\\u403f\\xf1\\u1f19\\xf4\\u0f14\\u0a80ABHabcdefhilmnoprstux\\u3040\\u3051\\u3055\\u3059\\u30e0\\u310e\\u312b\\u3147\\u3162\\u3172\\u318e\\u3206\\u3215\\u3224\\u3229\\u3258\\u326e\\u3272\\u3290\\u32b0\\u32b7\\u0180art\\u3047\\u304a\\u304cr\\xf2\\u10b3\\xf2\\u03ddail;\\u691car\\xf2\\u1c65ar;\\u6964\\u0380cdenqrt\\u3068\\u3075\\u3078\\u307f\\u308f\\u3094\\u30cc\\u0100eu\\u306d\\u3071;\\uc000\\u223d\\u0331te;\\u4155i\\xe3\\u116emptyv;\\u69b3g\\u0200;del\\u0fd1\\u3089\\u308b\\u308d;\\u6992;\\u69a5\\xe5\\u0fd1uo\\u803b\\xbb\\u40bbr\\u0580;abcfhlpstw\\u0fdc\\u30ac\\u30af\\u30b7\\u30b9\\u30bc\\u30be\\u30c0\\u30c3\\u30c7\\u30cap;\\u6975\\u0100;f\\u0fe0\\u30b4s;\\u6920;\\u6933s;\\u691e\\xeb\\u225d\\xf0\\u272el;\\u6945im;\\u6974l;\\u61a3;\\u619d\\u0100ai\\u30d1\\u30d5il;\\u691ao\\u0100;n\\u30db\\u30dc\\u6236al\\xf3\\u0f1e\\u0180abr\\u30e7\\u30ea\\u30eer\\xf2\\u17e5rk;\\u6773\\u0100ak\\u30f3\\u30fdc\\u0100ek\\u30f9\\u30fb;\\u407d;\\u405d\\u0100es\\u3102\\u3104;\\u698cl\\u0100du\\u310a\\u310c;\\u698e;\\u6990\\u0200aeuy\\u3117\\u311c\\u3127\\u3129ron;\\u4159\\u0100di\\u3121\\u3125il;\\u4157\\xec\\u0ff2\\xe2\\u30fa;\\u4440\\u0200clqs\\u3134\\u3137\\u313d\\u3144a;\\u6937dhar;\\u6969uo\\u0100;r\\u020e\\u020dh;\\u61b3\\u0180acg\\u314e\\u315f\\u0f44l\\u0200;ips\\u0f78\\u3158\\u315b\\u109cn\\xe5\\u10bbar\\xf4\\u0fa9t;\\u65ad\\u0180ilr\\u3169\\u1023\\u316esht;\\u697d;\\uc000\\ud835\\udd2f\\u0100ao\\u3177\\u3186r\\u0100du\\u317d\\u317f\\xbb\\u047b\\u0100;l\\u1091\\u3184;\\u696c\\u0100;v\\u318b\\u318c\\u43c1;\\u43f1\\u0180gns\\u3195\\u31f9\\u31fcht\\u0300ahlrst\\u31a4\\u31b0\\u31c2\\u31d8\\u31e4\\u31eerrow\\u0100;t\\u0fdc\\u31ada\\xe9\\u30c8arpoon\\u0100du\\u31bb\\u31bfow\\xee\\u317ep\\xbb\\u1092eft\\u0100ah\\u31ca\\u31d0rrow\\xf3\\u0feaarpoon\\xf3\\u0551ightarrows;\\u61c9quigarro\\xf7\\u30cbhreetimes;\\u62ccg;\\u42daingdotse\\xf1\\u1f32\\u0180ahm\\u320d\\u3210\\u3213r\\xf2\\u0feaa\\xf2\\u0551;\\u600foust\\u0100;a\\u321e\\u321f\\u63b1che\\xbb\\u321fmid;\\u6aee\\u0200abpt\\u3232\\u323d\\u3240\\u3252\\u0100nr\\u3237\\u323ag;\\u67edr;\\u61fer\\xeb\\u1003\\u0180afl\\u3247\\u324a\\u324er;\\u6986;\\uc000\\ud835\\udd63us;\\u6a2eimes;\\u6a35\\u0100ap\\u325d\\u3267r\\u0100;g\\u3263\\u3264\\u4029t;\\u6994olint;\\u6a12ar\\xf2\\u31e3\\u0200achq\\u327b\\u3280\\u10bc\\u3285quo;\\u603ar;\\uc000\\ud835\\udcc7\\u0100bu\\u30fb\\u328ao\\u0100;r\\u0214\\u0213\\u0180hir\\u3297\\u329b\\u32a0re\\xe5\\u31f8mes;\\u62cai\\u0200;efl\\u32aa\\u1059\\u1821\\u32ab\\u65b9tri;\\u69celuhar;\\u6968;\\u611e\\u0d61\\u32d5\\u32db\\u32df\\u332c\\u3338\\u3371\\0\\u337a\\u33a4\\0\\0\\u33ec\\u33f0\\0\\u3428\\u3448\\u345a\\u34ad\\u34b1\\u34ca\\u34f1\\0\\u3616\\0\\0\\u3633cute;\\u415bqu\\xef\\u27ba\\u0500;Eaceinpsy\\u11ed\\u32f3\\u32f5\\u32ff\\u3302\\u330b\\u330f\\u331f\\u3326\\u3329;\\u6ab4\\u01f0\\u32fa\\0\\u32fc;\\u6ab8on;\\u4161u\\xe5\\u11fe\\u0100;d\\u11f3\\u3307il;\\u415frc;\\u415d\\u0180Eas\\u3316\\u3318\\u331b;\\u6ab6p;\\u6abaim;\\u62e9olint;\\u6a13i\\xed\\u1204;\\u4441ot\\u0180;be\\u3334\\u1d47\\u3335\\u62c5;\\u6a66\\u0380Aacmstx\\u3346\\u334a\\u3357\\u335b\\u335e\\u3363\\u336drr;\\u61d8r\\u0100hr\\u3350\\u3352\\xeb\\u2228\\u0100;o\\u0a36\\u0a34t\\u803b\\xa7\\u40a7i;\\u403bwar;\\u6929m\\u0100in\\u3369\\xf0nu\\xf3\\xf1t;\\u6736r\\u0100;o\\u3376\\u2055\\uc000\\ud835\\udd30\\u0200acoy\\u3382\\u3386\\u3391\\u33a0rp;\\u666f\\u0100hy\\u338b\\u338fcy;\\u4449;\\u4448rt\\u026d\\u3399\\0\\0\\u339ci\\xe4\\u1464ara\\xec\\u2e6f\\u803b\\xad\\u40ad\\u0100gm\\u33a8\\u33b4ma\\u0180;fv\\u33b1\\u33b2\\u33b2\\u43c3;\\u43c2\\u0400;deglnpr\\u12ab\\u33c5\\u33c9\\u33ce\\u33d6\\u33de\\u33e1\\u33e6ot;\\u6a6a\\u0100;q\\u12b1\\u12b0\\u0100;E\\u33d3\\u33d4\\u6a9e;\\u6aa0\\u0100;E\\u33db\\u33dc\\u6a9d;\\u6a9fe;\\u6246lus;\\u6a24arr;\\u6972ar\\xf2\\u113d\\u0200aeit\\u33f8\\u3408\\u340f\\u3417\\u0100ls\\u33fd\\u3404lsetm\\xe9\\u336ahp;\\u6a33parsl;\\u69e4\\u0100dl\\u1463\\u3414e;\\u6323\\u0100;e\\u341c\\u341d\\u6aaa\\u0100;s\\u3422\\u3423\\u6aac;\\uc000\\u2aac\\ufe00\\u0180flp\\u342e\\u3433\\u3442tcy;\\u444c\\u0100;b\\u3438\\u3439\\u402f\\u0100;a\\u343e\\u343f\\u69c4r;\\u633ff;\\uc000\\ud835\\udd64a\\u0100dr\\u344d\\u0402es\\u0100;u\\u3454\\u3455\\u6660it\\xbb\\u3455\\u0180csu\\u3460\\u3479\\u349f\\u0100au\\u3465\\u346fp\\u0100;s\\u1188\\u346b;\\uc000\\u2293\\ufe00p\\u0100;s\\u11b4\\u3475;\\uc000\\u2294\\ufe00u\\u0100bp\\u347f\\u348f\\u0180;es\\u1197\\u119c\\u3486et\\u0100;e\\u1197\\u348d\\xf1\\u119d\\u0180;es\\u11a8\\u11ad\\u3496et\\u0100;e\\u11a8\\u349d\\xf1\\u11ae\\u0180;af\\u117b\\u34a6\\u05b0r\\u0165\\u34ab\\u05b1\\xbb\\u117car\\xf2\\u1148\\u0200cemt\\u34b9\\u34be\\u34c2\\u34c5r;\\uc000\\ud835\\udcc8tm\\xee\\xf1i\\xec\\u3415ar\\xe6\\u11be\\u0100ar\\u34ce\\u34d5r\\u0100;f\\u34d4\\u17bf\\u6606\\u0100an\\u34da\\u34edight\\u0100ep\\u34e3\\u34eapsilo\\xee\\u1ee0h\\xe9\\u2eafs\\xbb\\u2852\\u0280bcmnp\\u34fb\\u355e\\u1209\\u358b\\u358e\\u0480;Edemnprs\\u350e\\u350f\\u3511\\u3515\\u351e\\u3523\\u352c\\u3531\\u3536\\u6282;\\u6ac5ot;\\u6abd\\u0100;d\\u11da\\u351aot;\\u6ac3ult;\\u6ac1\\u0100Ee\\u3528\\u352a;\\u6acb;\\u628alus;\\u6abfarr;\\u6979\\u0180eiu\\u353d\\u3552\\u3555t\\u0180;en\\u350e\\u3545\\u354bq\\u0100;q\\u11da\\u350feq\\u0100;q\\u352b\\u3528m;\\u6ac7\\u0100bp\\u355a\\u355c;\\u6ad5;\\u6ad3c\\u0300;acens\\u11ed\\u356c\\u3572\\u3579\\u357b\\u3326ppro\\xf8\\u32faurlye\\xf1\\u11fe\\xf1\\u11f3\\u0180aes\\u3582\\u3588\\u331bppro\\xf8\\u331aq\\xf1\\u3317g;\\u666a\\u0680123;Edehlmnps\\u35a9\\u35ac\\u35af\\u121c\\u35b2\\u35b4\\u35c0\\u35c9\\u35d5\\u35da\\u35df\\u35e8\\u35ed\\u803b\\xb9\\u40b9\\u803b\\xb2\\u40b2\\u803b\\xb3\\u40b3;\\u6ac6\\u0100os\\u35b9\\u35bct;\\u6abeub;\\u6ad8\\u0100;d\\u1222\\u35c5ot;\\u6ac4s\\u0100ou\\u35cf\\u35d2l;\\u67c9b;\\u6ad7arr;\\u697bult;\\u6ac2\\u0100Ee\\u35e4\\u35e6;\\u6acc;\\u628blus;\\u6ac0\\u0180eiu\\u35f4\\u3609\\u360ct\\u0180;en\\u121c\\u35fc\\u3602q\\u0100;q\\u1222\\u35b2eq\\u0100;q\\u35e7\\u35e4m;\\u6ac8\\u0100bp\\u3611\\u3613;\\u6ad4;\\u6ad6\\u0180Aan\\u361c\\u3620\\u362drr;\\u61d9r\\u0100hr\\u3626\\u3628\\xeb\\u222e\\u0100;o\\u0a2b\\u0a29war;\\u692alig\\u803b\\xdf\\u40df\\u0be1\\u3651\\u365d\\u3660\\u12ce\\u3673\\u3679\\0\\u367e\\u36c2\\0\\0\\0\\0\\0\\u36db\\u3703\\0\\u3709\\u376c\\0\\0\\0\\u3787\\u0272\\u3656\\0\\0\\u365bget;\\u6316;\\u43c4r\\xeb\\u0e5f\\u0180aey\\u3666\\u366b\\u3670ron;\\u4165dil;\\u4163;\\u4442lrec;\\u6315r;\\uc000\\ud835\\udd31\\u0200eiko\\u3686\\u369d\\u36b5\\u36bc\\u01f2\\u368b\\0\\u3691e\\u01004f\\u1284\\u1281a\\u0180;sv\\u3698\\u3699\\u369b\\u43b8ym;\\u43d1\\u0100cn\\u36a2\\u36b2k\\u0100as\\u36a8\\u36aeppro\\xf8\\u12c1im\\xbb\\u12acs\\xf0\\u129e\\u0100as\\u36ba\\u36ae\\xf0\\u12c1rn\\u803b\\xfe\\u40fe\\u01ec\\u031f\\u36c6\\u22e7es\\u8180\\xd7;bd\\u36cf\\u36d0\\u36d8\\u40d7\\u0100;a\\u190f\\u36d5r;\\u6a31;\\u6a30\\u0180eps\\u36e1\\u36e3\\u3700\\xe1\\u2a4d\\u0200;bcf\\u0486\\u36ec\\u36f0\\u36f4ot;\\u6336ir;\\u6af1\\u0100;o\\u36f9\\u36fc\\uc000\\ud835\\udd65rk;\\u6ada\\xe1\\u3362rime;\\u6034\\u0180aip\\u370f\\u3712\\u3764d\\xe5\\u1248\\u0380adempst\\u3721\\u374d\\u3740\\u3751\\u3757\\u375c\\u375fngle\\u0280;dlqr\\u3730\\u3731\\u3736\\u3740\\u3742\\u65b5own\\xbb\\u1dbbeft\\u0100;e\\u2800\\u373e\\xf1\\u092e;\\u625cight\\u0100;e\\u32aa\\u374b\\xf1\\u105aot;\\u65ecinus;\\u6a3alus;\\u6a39b;\\u69cdime;\\u6a3bezium;\\u63e2\\u0180cht\\u3772\\u377d\\u3781\\u0100ry\\u3777\\u377b;\\uc000\\ud835\\udcc9;\\u4446cy;\\u445brok;\\u4167\\u0100io\\u378b\\u378ex\\xf4\\u1777head\\u0100lr\\u3797\\u37a0eftarro\\xf7\\u084fightarrow\\xbb\\u0f5d\\u0900AHabcdfghlmoprstuw\\u37d0\\u37d3\\u37d7\\u37e4\\u37f0\\u37fc\\u380e\\u381c\\u3823\\u3834\\u3851\\u385d\\u386b\\u38a9\\u38cc\\u38d2\\u38ea\\u38f6r\\xf2\\u03edar;\\u6963\\u0100cr\\u37dc\\u37e2ute\\u803b\\xfa\\u40fa\\xf2\\u1150r\\u01e3\\u37ea\\0\\u37edy;\\u445eve;\\u416d\\u0100iy\\u37f5\\u37farc\\u803b\\xfb\\u40fb;\\u4443\\u0180abh\\u3803\\u3806\\u380br\\xf2\\u13adlac;\\u4171a\\xf2\\u13c3\\u0100ir\\u3813\\u3818sht;\\u697e;\\uc000\\ud835\\udd32rave\\u803b\\xf9\\u40f9\\u0161\\u3827\\u3831r\\u0100lr\\u382c\\u382e\\xbb\\u0957\\xbb\\u1083lk;\\u6580\\u0100ct\\u3839\\u384d\\u026f\\u383f\\0\\0\\u384arn\\u0100;e\\u3845\\u3846\\u631cr\\xbb\\u3846op;\\u630fri;\\u65f8\\u0100al\\u3856\\u385acr;\\u416b\\u80bb\\xa8\\u0349\\u0100gp\\u3862\\u3866on;\\u4173f;\\uc000\\ud835\\udd66\\u0300adhlsu\\u114b\\u3878\\u387d\\u1372\\u3891\\u38a0own\\xe1\\u13b3arpoon\\u0100lr\\u3888\\u388cef\\xf4\\u382digh\\xf4\\u382fi\\u0180;hl\\u3899\\u389a\\u389c\\u43c5\\xbb\\u13faon\\xbb\\u389aparrows;\\u61c8\\u0180cit\\u38b0\\u38c4\\u38c8\\u026f\\u38b6\\0\\0\\u38c1rn\\u0100;e\\u38bc\\u38bd\\u631dr\\xbb\\u38bdop;\\u630eng;\\u416fri;\\u65f9cr;\\uc000\\ud835\\udcca\\u0180dir\\u38d9\\u38dd\\u38e2ot;\\u62f0lde;\\u4169i\\u0100;f\\u3730\\u38e8\\xbb\\u1813\\u0100am\\u38ef\\u38f2r\\xf2\\u38a8l\\u803b\\xfc\\u40fcangle;\\u69a7\\u0780ABDacdeflnoprsz\\u391c\\u391f\\u3929\\u392d\\u39b5\\u39b8\\u39bd\\u39df\\u39e4\\u39e8\\u39f3\\u39f9\\u39fd\\u3a01\\u3a20r\\xf2\\u03f7ar\\u0100;v\\u3926\\u3927\\u6ae8;\\u6ae9as\\xe8\\u03e1\\u0100nr\\u3932\\u3937grt;\\u699c\\u0380eknprst\\u34e3\\u3946\\u394b\\u3952\\u395d\\u3964\\u3996app\\xe1\\u2415othin\\xe7\\u1e96\\u0180hir\\u34eb\\u2ec8\\u3959op\\xf4\\u2fb5\\u0100;h\\u13b7\\u3962\\xef\\u318d\\u0100iu\\u3969\\u396dgm\\xe1\\u33b3\\u0100bp\\u3972\\u3984setneq\\u0100;q\\u397d\\u3980\\uc000\\u228a\\ufe00;\\uc000\\u2acb\\ufe00setneq\\u0100;q\\u398f\\u3992\\uc000\\u228b\\ufe00;\\uc000\\u2acc\\ufe00\\u0100hr\\u399b\\u399fet\\xe1\\u369ciangle\\u0100lr\\u39aa\\u39afeft\\xbb\\u0925ight\\xbb\\u1051y;\\u4432ash\\xbb\\u1036\\u0180elr\\u39c4\\u39d2\\u39d7\\u0180;be\\u2dea\\u39cb\\u39cfar;\\u62bbq;\\u625alip;\\u62ee\\u0100bt\\u39dc\\u1468a\\xf2\\u1469r;\\uc000\\ud835\\udd33tr\\xe9\\u39aesu\\u0100bp\\u39ef\\u39f1\\xbb\\u0d1c\\xbb\\u0d59pf;\\uc000\\ud835\\udd67ro\\xf0\\u0efbtr\\xe9\\u39b4\\u0100cu\\u3a06\\u3a0br;\\uc000\\ud835\\udccb\\u0100bp\\u3a10\\u3a18n\\u0100Ee\\u3980\\u3a16\\xbb\\u397en\\u0100Ee\\u3992\\u3a1e\\xbb\\u3990igzag;\\u699a\\u0380cefoprs\\u3a36\\u3a3b\\u3a56\\u3a5b\\u3a54\\u3a61\\u3a6airc;\\u4175\\u0100di\\u3a40\\u3a51\\u0100bg\\u3a45\\u3a49ar;\\u6a5fe\\u0100;q\\u15fa\\u3a4f;\\u6259erp;\\u6118r;\\uc000\\ud835\\udd34pf;\\uc000\\ud835\\udd68\\u0100;e\\u1479\\u3a66at\\xe8\\u1479cr;\\uc000\\ud835\\udccc\\u0ae3\\u178e\\u3a87\\0\\u3a8b\\0\\u3a90\\u3a9b\\0\\0\\u3a9d\\u3aa8\\u3aab\\u3aaf\\0\\0\\u3ac3\\u3ace\\0\\u3ad8\\u17dc\\u17dftr\\xe9\\u17d1r;\\uc000\\ud835\\udd35\\u0100Aa\\u3a94\\u3a97r\\xf2\\u03c3r\\xf2\\u09f6;\\u43be\\u0100Aa\\u3aa1\\u3aa4r\\xf2\\u03b8r\\xf2\\u09eba\\xf0\\u2713is;\\u62fb\\u0180dpt\\u17a4\\u3ab5\\u3abe\\u0100fl\\u3aba\\u17a9;\\uc000\\ud835\\udd69im\\xe5\\u17b2\\u0100Aa\\u3ac7\\u3acar\\xf2\\u03cer\\xf2\\u0a01\\u0100cq\\u3ad2\\u17b8r;\\uc000\\ud835\\udccd\\u0100pt\\u17d6\\u3adcr\\xe9\\u17d4\\u0400acefiosu\\u3af0\\u3afd\\u3b08\\u3b0c\\u3b11\\u3b15\\u3b1b\\u3b21c\\u0100uy\\u3af6\\u3afbte\\u803b\\xfd\\u40fd;\\u444f\\u0100iy\\u3b02\\u3b06rc;\\u4177;\\u444bn\\u803b\\xa5\\u40a5r;\\uc000\\ud835\\udd36cy;\\u4457pf;\\uc000\\ud835\\udd6acr;\\uc000\\ud835\\udcce\\u0100cm\\u3b26\\u3b29y;\\u444el\\u803b\\xff\\u40ff\\u0500acdefhiosw\\u3b42\\u3b48\\u3b54\\u3b58\\u3b64\\u3b69\\u3b6d\\u3b74\\u3b7a\\u3b80cute;\\u417a\\u0100ay\\u3b4d\\u3b52ron;\\u417e;\\u4437ot;\\u417c\\u0100et\\u3b5d\\u3b61tr\\xe6\\u155fa;\\u43b6r;\\uc000\\ud835\\udd37cy;\\u4436grarr;\\u61ddpf;\\uc000\\ud835\\udd6bcr;\\uc000\\ud835\\udccf\\u0100jn\\u3b85\\u3b87;\\u600dj;\\u600c\"\n .split(\"\")\n .map((c) => c.charCodeAt(0)));\n//# sourceMappingURL=decode-data-html.js.map","// Generated using scripts/write-decode-map.ts\nexport const xmlDecodeTree = /* #__PURE__ */ new Uint16Array(\n// prettier-ignore\n/* #__PURE__ */ \"\\u0200aglq\\t\\x15\\x18\\x1b\\u026d\\x0f\\0\\0\\x12p;\\u4026os;\\u4027t;\\u403et;\\u403cuot;\\u4022\"\n .split(\"\")\n .map((c) => c.charCodeAt(0)));\n//# sourceMappingURL=decode-data-xml.js.map","import { decodeXML, decodeHTML, DecodingMode } from \"./decode.js\";\nimport { encodeHTML, encodeNonAsciiHTML } from \"./encode.js\";\nimport { encodeXML, escapeUTF8, escapeAttribute, escapeText, } from \"./escape.js\";\n/** The level of entities to support. */\nexport var EntityLevel;\n(function (EntityLevel) {\n /** Support only XML entities. */\n EntityLevel[EntityLevel[\"XML\"] = 0] = \"XML\";\n /** Support HTML entities, which are a superset of XML entities. */\n EntityLevel[EntityLevel[\"HTML\"] = 1] = \"HTML\";\n})(EntityLevel || (EntityLevel = {}));\nexport var EncodingMode;\n(function (EncodingMode) {\n /**\n * The output is UTF-8 encoded. Only characters that need escaping within\n * XML will be escaped.\n */\n EncodingMode[EncodingMode[\"UTF8\"] = 0] = \"UTF8\";\n /**\n * The output consists only of ASCII characters. Characters that need\n * escaping within HTML, and characters that aren't ASCII characters will\n * be escaped.\n */\n EncodingMode[EncodingMode[\"ASCII\"] = 1] = \"ASCII\";\n /**\n * Encode all characters that have an equivalent entity, as well as all\n * characters that are not ASCII characters.\n */\n EncodingMode[EncodingMode[\"Extensive\"] = 2] = \"Extensive\";\n /**\n * Encode all characters that have to be escaped in HTML attributes,\n * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.\n */\n EncodingMode[EncodingMode[\"Attribute\"] = 3] = \"Attribute\";\n /**\n * Encode all characters that have to be escaped in HTML text,\n * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.\n */\n EncodingMode[EncodingMode[\"Text\"] = 4] = \"Text\";\n})(EncodingMode || (EncodingMode = {}));\n/**\n * Decodes a string with entities.\n *\n * @param input String to decode.\n * @param options Decoding options.\n */\nexport function decode(input, options = EntityLevel.XML) {\n const level = typeof options === \"number\" ? options : options.level;\n if (level === EntityLevel.HTML) {\n const mode = typeof options === \"object\" ? options.mode : undefined;\n return decodeHTML(input, mode);\n }\n return decodeXML(input);\n}\n/**\n * Decodes a string with entities. Does not allow missing trailing semicolons for entities.\n *\n * @param input String to decode.\n * @param options Decoding options.\n * @deprecated Use `decode` with the `mode` set to `Strict`.\n */\nexport function decodeStrict(input, options = EntityLevel.XML) {\n var _a;\n const normalizedOptions = typeof options === \"number\" ? { level: options } : options;\n (_a = normalizedOptions.mode) !== null && _a !== void 0 ? _a : (normalizedOptions.mode = DecodingMode.Strict);\n return decode(input, normalizedOptions);\n}\n/**\n * Encodes a string with entities.\n *\n * @param input String to encode.\n * @param options Encoding options.\n */\nexport function encode(input, options = EntityLevel.XML) {\n const { mode = EncodingMode.Extensive, level = EntityLevel.XML } = typeof options === \"number\" ? { level: options } : options;\n switch (mode) {\n case EncodingMode.UTF8: {\n return escapeUTF8(input);\n }\n case EncodingMode.Attribute: {\n return escapeAttribute(input);\n }\n case EncodingMode.Text: {\n return escapeText(input);\n }\n case EncodingMode.ASCII: {\n return level === EntityLevel.HTML\n ? encodeNonAsciiHTML(input)\n : encodeXML(input);\n }\n // eslint-disable-next-line unicorn/no-useless-switch-case\n case EncodingMode.Extensive:\n default: {\n return level === EntityLevel.HTML\n ? encodeHTML(input)\n : encodeXML(input);\n }\n }\n}\nexport { encodeXML, escape, escapeUTF8, escapeAttribute, escapeText, } from \"./escape.js\";\nexport { encodeHTML, encodeNonAsciiHTML, \n// Legacy aliases (deprecated)\nencodeHTML as encodeHTML4, encodeHTML as encodeHTML5, } from \"./encode.js\";\nexport { EntityDecoder, DecodingMode, decodeXML, decodeHTML, decodeHTMLStrict, decodeHTMLAttribute, \n// Legacy aliases (deprecated)\ndecodeHTML as decodeHTML4, decodeHTML as decodeHTML5, decodeHTMLStrict as decodeHTML4Strict, decodeHTMLStrict as decodeHTML5Strict, decodeXML as decodeXMLStrict, } from \"./decode.js\";\n//# sourceMappingURL=index.js.map","import Tokenizer, { QuoteType } from \"./Tokenizer.js\";\nimport { fromCodePoint } from \"entities/decode\";\nconst formTags = new Set([\n \"input\",\n \"option\",\n \"optgroup\",\n \"select\",\n \"button\",\n \"datalist\",\n \"textarea\",\n]);\nconst pTag = new Set([\"p\"]);\nconst tableSectionTags = new Set([\"thead\", \"tbody\"]);\nconst ddtTags = new Set([\"dd\", \"dt\"]);\nconst rtpTags = new Set([\"rt\", \"rp\"]);\nconst openImpliesClose = new Map([\n [\"tr\", new Set([\"tr\", \"th\", \"td\"])],\n [\"th\", new Set([\"th\"])],\n [\"td\", new Set([\"thead\", \"th\", \"td\"])],\n [\"body\", new Set([\"head\", \"link\", \"script\"])],\n [\"li\", new Set([\"li\"])],\n [\"p\", pTag],\n [\"h1\", pTag],\n [\"h2\", pTag],\n [\"h3\", pTag],\n [\"h4\", pTag],\n [\"h5\", pTag],\n [\"h6\", pTag],\n [\"select\", formTags],\n [\"input\", formTags],\n [\"output\", formTags],\n [\"button\", formTags],\n [\"datalist\", formTags],\n [\"textarea\", formTags],\n [\"option\", new Set([\"option\"])],\n [\"optgroup\", new Set([\"optgroup\", \"option\"])],\n [\"dd\", ddtTags],\n [\"dt\", ddtTags],\n [\"address\", pTag],\n [\"article\", pTag],\n [\"aside\", pTag],\n [\"blockquote\", pTag],\n [\"details\", pTag],\n [\"div\", pTag],\n [\"dl\", pTag],\n [\"fieldset\", pTag],\n [\"figcaption\", pTag],\n [\"figure\", pTag],\n [\"footer\", pTag],\n [\"form\", pTag],\n [\"header\", pTag],\n [\"hr\", pTag],\n [\"main\", pTag],\n [\"nav\", pTag],\n [\"ol\", pTag],\n [\"pre\", pTag],\n [\"section\", pTag],\n [\"table\", pTag],\n [\"ul\", pTag],\n [\"rt\", rtpTags],\n [\"rp\", rtpTags],\n [\"tbody\", tableSectionTags],\n [\"tfoot\", tableSectionTags],\n]);\nconst voidElements = new Set([\n \"area\",\n \"base\",\n \"basefont\",\n \"br\",\n \"col\",\n \"command\",\n \"embed\",\n \"frame\",\n \"hr\",\n \"img\",\n \"input\",\n \"isindex\",\n \"keygen\",\n \"link\",\n \"meta\",\n \"param\",\n \"source\",\n \"track\",\n \"wbr\",\n]);\nconst foreignContextElements = new Set([\"math\", \"svg\"]);\nconst htmlIntegrationElements = new Set([\n \"mi\",\n \"mo\",\n \"mn\",\n \"ms\",\n \"mtext\",\n \"annotation-xml\",\n \"foreignobject\",\n \"desc\",\n \"title\",\n]);\nconst reNameEnd = /\\s|\\//;\nexport class Parser {\n constructor(cbs, options = {}) {\n var _a, _b, _c, _d, _e, _f;\n this.options = options;\n /** The start index of the last event. */\n this.startIndex = 0;\n /** The end index of the last event. */\n this.endIndex = 0;\n /**\n * Store the start index of the current open tag,\n * so we can update the start index for attributes.\n */\n this.openTagStart = 0;\n this.tagname = \"\";\n this.attribname = \"\";\n this.attribvalue = \"\";\n this.attribs = null;\n this.stack = [];\n this.buffers = [];\n this.bufferOffset = 0;\n /** The index of the last written buffer. Used when resuming after a `pause()`. */\n this.writeIndex = 0;\n /** Indicates whether the parser has finished running / `.end` has been called. */\n this.ended = false;\n this.cbs = cbs !== null && cbs !== void 0 ? cbs : {};\n this.htmlMode = !this.options.xmlMode;\n this.lowerCaseTagNames = (_a = options.lowerCaseTags) !== null && _a !== void 0 ? _a : this.htmlMode;\n this.lowerCaseAttributeNames =\n (_b = options.lowerCaseAttributeNames) !== null && _b !== void 0 ? _b : this.htmlMode;\n this.recognizeSelfClosing =\n (_c = options.recognizeSelfClosing) !== null && _c !== void 0 ? _c : !this.htmlMode;\n this.tokenizer = new ((_d = options.Tokenizer) !== null && _d !== void 0 ? _d : Tokenizer)(this.options, this);\n this.foreignContext = [!this.htmlMode];\n (_f = (_e = this.cbs).onparserinit) === null || _f === void 0 ? void 0 : _f.call(_e, this);\n }\n // Tokenizer event handlers\n /** @internal */\n ontext(start, endIndex) {\n var _a, _b;\n const data = this.getSlice(start, endIndex);\n this.endIndex = endIndex - 1;\n (_b = (_a = this.cbs).ontext) === null || _b === void 0 ? void 0 : _b.call(_a, data);\n this.startIndex = endIndex;\n }\n /** @internal */\n ontextentity(cp, endIndex) {\n var _a, _b;\n this.endIndex = endIndex - 1;\n (_b = (_a = this.cbs).ontext) === null || _b === void 0 ? void 0 : _b.call(_a, fromCodePoint(cp));\n this.startIndex = endIndex;\n }\n /**\n * Checks if the current tag is a void element. Override this if you want\n * to specify your own additional void elements.\n */\n isVoidElement(name) {\n return this.htmlMode && voidElements.has(name);\n }\n /** @internal */\n onopentagname(start, endIndex) {\n this.endIndex = endIndex;\n let name = this.getSlice(start, endIndex);\n if (this.lowerCaseTagNames) {\n name = name.toLowerCase();\n }\n this.emitOpenTag(name);\n }\n emitOpenTag(name) {\n var _a, _b, _c, _d;\n this.openTagStart = this.startIndex;\n this.tagname = name;\n const impliesClose = this.htmlMode && openImpliesClose.get(name);\n if (impliesClose) {\n while (this.stack.length > 0 && impliesClose.has(this.stack[0])) {\n const element = this.stack.shift();\n (_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, element, true);\n }\n }\n if (!this.isVoidElement(name)) {\n this.stack.unshift(name);\n if (this.htmlMode) {\n if (foreignContextElements.has(name)) {\n this.foreignContext.unshift(true);\n }\n else if (htmlIntegrationElements.has(name)) {\n this.foreignContext.unshift(false);\n }\n }\n }\n (_d = (_c = this.cbs).onopentagname) === null || _d === void 0 ? void 0 : _d.call(_c, name);\n if (this.cbs.onopentag)\n this.attribs = {};\n }\n endOpenTag(isImplied) {\n var _a, _b;\n this.startIndex = this.openTagStart;\n if (this.attribs) {\n (_b = (_a = this.cbs).onopentag) === null || _b === void 0 ? void 0 : _b.call(_a, this.tagname, this.attribs, isImplied);\n this.attribs = null;\n }\n if (this.cbs.onclosetag && this.isVoidElement(this.tagname)) {\n this.cbs.onclosetag(this.tagname, true);\n }\n this.tagname = \"\";\n }\n /** @internal */\n onopentagend(endIndex) {\n this.endIndex = endIndex;\n this.endOpenTag(false);\n // Set `startIndex` for next node\n this.startIndex = endIndex + 1;\n }\n /** @internal */\n onclosetag(start, endIndex) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n this.endIndex = endIndex;\n let name = this.getSlice(start, endIndex);\n if (this.lowerCaseTagNames) {\n name = name.toLowerCase();\n }\n if (this.htmlMode &&\n (foreignContextElements.has(name) ||\n htmlIntegrationElements.has(name))) {\n this.foreignContext.shift();\n }\n if (!this.isVoidElement(name)) {\n const pos = this.stack.indexOf(name);\n if (pos !== -1) {\n for (let index = 0; index <= pos; index++) {\n const element = this.stack.shift();\n // We know the stack has sufficient elements.\n (_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, element, index !== pos);\n }\n }\n else if (this.htmlMode && name === \"p\") {\n // Implicit open before close\n this.emitOpenTag(\"p\");\n this.closeCurrentTag(true);\n }\n }\n else if (this.htmlMode && name === \"br\") {\n // We can't use `emitOpenTag` for implicit open, as `br` would be implicitly closed.\n (_d = (_c = this.cbs).onopentagname) === null || _d === void 0 ? void 0 : _d.call(_c, \"br\");\n (_f = (_e = this.cbs).onopentag) === null || _f === void 0 ? void 0 : _f.call(_e, \"br\", {}, true);\n (_h = (_g = this.cbs).onclosetag) === null || _h === void 0 ? void 0 : _h.call(_g, \"br\", false);\n }\n // Set `startIndex` for next node\n this.startIndex = endIndex + 1;\n }\n /** @internal */\n onselfclosingtag(endIndex) {\n this.endIndex = endIndex;\n if (this.recognizeSelfClosing || this.foreignContext[0]) {\n this.closeCurrentTag(false);\n // Set `startIndex` for next node\n this.startIndex = endIndex + 1;\n }\n else {\n // Ignore the fact that the tag is self-closing.\n this.onopentagend(endIndex);\n }\n }\n closeCurrentTag(isOpenImplied) {\n var _a, _b;\n const name = this.tagname;\n this.endOpenTag(isOpenImplied);\n // Self-closing tags will be on the top of the stack\n if (this.stack[0] === name) {\n // If the opening tag isn't implied, the closing tag has to be implied.\n (_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, name, !isOpenImplied);\n this.stack.shift();\n }\n }\n /** @internal */\n onattribname(start, endIndex) {\n this.startIndex = start;\n const name = this.getSlice(start, endIndex);\n this.attribname = this.lowerCaseAttributeNames\n ? name.toLowerCase()\n : name;\n }\n /** @internal */\n onattribdata(start, endIndex) {\n this.attribvalue += this.getSlice(start, endIndex);\n }\n /** @internal */\n onattribentity(cp) {\n this.attribvalue += fromCodePoint(cp);\n }\n /** @internal */\n onattribend(quote, endIndex) {\n var _a, _b;\n this.endIndex = endIndex;\n (_b = (_a = this.cbs).onattribute) === null || _b === void 0 ? void 0 : _b.call(_a, this.attribname, this.attribvalue, quote === QuoteType.Double\n ? '\"'\n : quote === QuoteType.Single\n ? \"'\"\n : quote === QuoteType.NoValue\n ? undefined\n : null);\n if (this.attribs &&\n !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname)) {\n this.attribs[this.attribname] = this.attribvalue;\n }\n this.attribvalue = \"\";\n }\n getInstructionName(value) {\n const index = value.search(reNameEnd);\n let name = index < 0 ? value : value.substr(0, index);\n if (this.lowerCaseTagNames) {\n name = name.toLowerCase();\n }\n return name;\n }\n /** @internal */\n ondeclaration(start, endIndex) {\n this.endIndex = endIndex;\n const value = this.getSlice(start, endIndex);\n if (this.cbs.onprocessinginstruction) {\n const name = this.getInstructionName(value);\n this.cbs.onprocessinginstruction(`!${name}`, `!${value}`);\n }\n // Set `startIndex` for next node\n this.startIndex = endIndex + 1;\n }\n /** @internal */\n onprocessinginstruction(start, endIndex) {\n this.endIndex = endIndex;\n const value = this.getSlice(start, endIndex);\n if (this.cbs.onprocessinginstruction) {\n const name = this.getInstructionName(value);\n this.cbs.onprocessinginstruction(`?${name}`, `?${value}`);\n }\n // Set `startIndex` for next node\n this.startIndex = endIndex + 1;\n }\n /** @internal */\n oncomment(start, endIndex, offset) {\n var _a, _b, _c, _d;\n this.endIndex = endIndex;\n (_b = (_a = this.cbs).oncomment) === null || _b === void 0 ? void 0 : _b.call(_a, this.getSlice(start, endIndex - offset));\n (_d = (_c = this.cbs).oncommentend) === null || _d === void 0 ? void 0 : _d.call(_c);\n // Set `startIndex` for next node\n this.startIndex = endIndex + 1;\n }\n /** @internal */\n oncdata(start, endIndex, offset) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n this.endIndex = endIndex;\n const value = this.getSlice(start, endIndex - offset);\n if (!this.htmlMode || this.options.recognizeCDATA) {\n (_b = (_a = this.cbs).oncdatastart) === null || _b === void 0 ? void 0 : _b.call(_a);\n (_d = (_c = this.cbs).ontext) === null || _d === void 0 ? void 0 : _d.call(_c, value);\n (_f = (_e = this.cbs).oncdataend) === null || _f === void 0 ? void 0 : _f.call(_e);\n }\n else {\n (_h = (_g = this.cbs).oncomment) === null || _h === void 0 ? void 0 : _h.call(_g, `[CDATA[${value}]]`);\n (_k = (_j = this.cbs).oncommentend) === null || _k === void 0 ? void 0 : _k.call(_j);\n }\n // Set `startIndex` for next node\n this.startIndex = endIndex + 1;\n }\n /** @internal */\n onend() {\n var _a, _b;\n if (this.cbs.onclosetag) {\n // Set the end index for all remaining tags\n this.endIndex = this.startIndex;\n for (let index = 0; index < this.stack.length; index++) {\n this.cbs.onclosetag(this.stack[index], true);\n }\n }\n (_b = (_a = this.cbs).onend) === null || _b === void 0 ? void 0 : _b.call(_a);\n }\n /**\n * Resets the parser to a blank state, ready to parse a new HTML document\n */\n reset() {\n var _a, _b, _c, _d;\n (_b = (_a = this.cbs).onreset) === null || _b === void 0 ? void 0 : _b.call(_a);\n this.tokenizer.reset();\n this.tagname = \"\";\n this.attribname = \"\";\n this.attribs = null;\n this.stack.length = 0;\n this.startIndex = 0;\n this.endIndex = 0;\n (_d = (_c = this.cbs).onparserinit) === null || _d === void 0 ? void 0 : _d.call(_c, this);\n this.buffers.length = 0;\n this.foreignContext.length = 0;\n this.foreignContext.unshift(!this.htmlMode);\n this.bufferOffset = 0;\n this.writeIndex = 0;\n this.ended = false;\n }\n /**\n * Resets the parser, then parses a complete document and\n * pushes it to the handler.\n *\n * @param data Document to parse.\n */\n parseComplete(data) {\n this.reset();\n this.end(data);\n }\n getSlice(start, end) {\n while (start - this.bufferOffset >= this.buffers[0].length) {\n this.shiftBuffer();\n }\n let slice = this.buffers[0].slice(start - this.bufferOffset, end - this.bufferOffset);\n while (end - this.bufferOffset > this.buffers[0].length) {\n this.shiftBuffer();\n slice += this.buffers[0].slice(0, end - this.bufferOffset);\n }\n return slice;\n }\n shiftBuffer() {\n this.bufferOffset += this.buffers[0].length;\n this.writeIndex--;\n this.buffers.shift();\n }\n /**\n * Parses a chunk of data and calls the corresponding callbacks.\n *\n * @param chunk Chunk to parse.\n */\n write(chunk) {\n var _a, _b;\n if (this.ended) {\n (_b = (_a = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a, new Error(\".write() after done!\"));\n return;\n }\n this.buffers.push(chunk);\n if (this.tokenizer.running) {\n this.tokenizer.write(chunk);\n this.writeIndex++;\n }\n }\n /**\n * Parses the end of the buffer and clears the stack, calls onend.\n *\n * @param chunk Optional final chunk to parse.\n */\n end(chunk) {\n var _a, _b;\n if (this.ended) {\n (_b = (_a = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a, new Error(\".end() after done!\"));\n return;\n }\n if (chunk)\n this.write(chunk);\n this.ended = true;\n this.tokenizer.end();\n }\n /**\n * Pauses parsing. The parser won't emit events until `resume` is called.\n */\n pause() {\n this.tokenizer.pause();\n }\n /**\n * Resumes parsing after `pause` was called.\n */\n resume() {\n this.tokenizer.resume();\n while (this.tokenizer.running &&\n this.writeIndex < this.buffers.length) {\n this.tokenizer.write(this.buffers[this.writeIndex++]);\n }\n if (this.ended)\n this.tokenizer.end();\n }\n /**\n * Alias of `write`, for backwards compatibility.\n *\n * @param chunk Chunk to parse.\n * @deprecated\n */\n parseChunk(chunk) {\n this.write(chunk);\n }\n /**\n * Alias of `end`, for backwards compatibility.\n *\n * @param chunk Optional final chunk to parse.\n * @deprecated\n */\n done(chunk) {\n this.end(chunk);\n }\n}\n//# sourceMappingURL=Parser.js.map","import { EntityDecoder, DecodingMode, htmlDecodeTree, xmlDecodeTree, } from \"entities/decode\";\nvar CharCodes;\n(function (CharCodes) {\n CharCodes[CharCodes[\"Tab\"] = 9] = \"Tab\";\n CharCodes[CharCodes[\"NewLine\"] = 10] = \"NewLine\";\n CharCodes[CharCodes[\"FormFeed\"] = 12] = \"FormFeed\";\n CharCodes[CharCodes[\"CarriageReturn\"] = 13] = \"CarriageReturn\";\n CharCodes[CharCodes[\"Space\"] = 32] = \"Space\";\n CharCodes[CharCodes[\"ExclamationMark\"] = 33] = \"ExclamationMark\";\n CharCodes[CharCodes[\"Number\"] = 35] = \"Number\";\n CharCodes[CharCodes[\"Amp\"] = 38] = \"Amp\";\n CharCodes[CharCodes[\"SingleQuote\"] = 39] = \"SingleQuote\";\n CharCodes[CharCodes[\"DoubleQuote\"] = 34] = \"DoubleQuote\";\n CharCodes[CharCodes[\"Dash\"] = 45] = \"Dash\";\n CharCodes[CharCodes[\"Slash\"] = 47] = \"Slash\";\n CharCodes[CharCodes[\"Zero\"] = 48] = \"Zero\";\n CharCodes[CharCodes[\"Nine\"] = 57] = \"Nine\";\n CharCodes[CharCodes[\"Semi\"] = 59] = \"Semi\";\n CharCodes[CharCodes[\"Lt\"] = 60] = \"Lt\";\n CharCodes[CharCodes[\"Eq\"] = 61] = \"Eq\";\n CharCodes[CharCodes[\"Gt\"] = 62] = \"Gt\";\n CharCodes[CharCodes[\"Questionmark\"] = 63] = \"Questionmark\";\n CharCodes[CharCodes[\"UpperA\"] = 65] = \"UpperA\";\n CharCodes[CharCodes[\"LowerA\"] = 97] = \"LowerA\";\n CharCodes[CharCodes[\"UpperF\"] = 70] = \"UpperF\";\n CharCodes[CharCodes[\"LowerF\"] = 102] = \"LowerF\";\n CharCodes[CharCodes[\"UpperZ\"] = 90] = \"UpperZ\";\n CharCodes[CharCodes[\"LowerZ\"] = 122] = \"LowerZ\";\n CharCodes[CharCodes[\"LowerX\"] = 120] = \"LowerX\";\n CharCodes[CharCodes[\"OpeningSquareBracket\"] = 91] = \"OpeningSquareBracket\";\n})(CharCodes || (CharCodes = {}));\n/** All the states the tokenizer can be in. */\nvar State;\n(function (State) {\n State[State[\"Text\"] = 1] = \"Text\";\n State[State[\"BeforeTagName\"] = 2] = \"BeforeTagName\";\n State[State[\"InTagName\"] = 3] = \"InTagName\";\n State[State[\"InSelfClosingTag\"] = 4] = \"InSelfClosingTag\";\n State[State[\"BeforeClosingTagName\"] = 5] = \"BeforeClosingTagName\";\n State[State[\"InClosingTagName\"] = 6] = \"InClosingTagName\";\n State[State[\"AfterClosingTagName\"] = 7] = \"AfterClosingTagName\";\n // Attributes\n State[State[\"BeforeAttributeName\"] = 8] = \"BeforeAttributeName\";\n State[State[\"InAttributeName\"] = 9] = \"InAttributeName\";\n State[State[\"AfterAttributeName\"] = 10] = \"AfterAttributeName\";\n State[State[\"BeforeAttributeValue\"] = 11] = \"BeforeAttributeValue\";\n State[State[\"InAttributeValueDq\"] = 12] = \"InAttributeValueDq\";\n State[State[\"InAttributeValueSq\"] = 13] = \"InAttributeValueSq\";\n State[State[\"InAttributeValueNq\"] = 14] = \"InAttributeValueNq\";\n // Declarations\n State[State[\"BeforeDeclaration\"] = 15] = \"BeforeDeclaration\";\n State[State[\"InDeclaration\"] = 16] = \"InDeclaration\";\n // Processing instructions\n State[State[\"InProcessingInstruction\"] = 17] = \"InProcessingInstruction\";\n // Comments & CDATA\n State[State[\"BeforeComment\"] = 18] = \"BeforeComment\";\n State[State[\"CDATASequence\"] = 19] = \"CDATASequence\";\n State[State[\"InSpecialComment\"] = 20] = \"InSpecialComment\";\n State[State[\"InCommentLike\"] = 21] = \"InCommentLike\";\n // Special tags\n State[State[\"BeforeSpecialS\"] = 22] = \"BeforeSpecialS\";\n State[State[\"BeforeSpecialT\"] = 23] = \"BeforeSpecialT\";\n State[State[\"SpecialStartSequence\"] = 24] = \"SpecialStartSequence\";\n State[State[\"InSpecialTag\"] = 25] = \"InSpecialTag\";\n State[State[\"InEntity\"] = 26] = \"InEntity\";\n})(State || (State = {}));\nfunction isWhitespace(c) {\n return (c === CharCodes.Space ||\n c === CharCodes.NewLine ||\n c === CharCodes.Tab ||\n c === CharCodes.FormFeed ||\n c === CharCodes.CarriageReturn);\n}\nfunction isEndOfTagSection(c) {\n return c === CharCodes.Slash || c === CharCodes.Gt || isWhitespace(c);\n}\nfunction isASCIIAlpha(c) {\n return ((c >= CharCodes.LowerA && c <= CharCodes.LowerZ) ||\n (c >= CharCodes.UpperA && c <= CharCodes.UpperZ));\n}\nexport var QuoteType;\n(function (QuoteType) {\n QuoteType[QuoteType[\"NoValue\"] = 0] = \"NoValue\";\n QuoteType[QuoteType[\"Unquoted\"] = 1] = \"Unquoted\";\n QuoteType[QuoteType[\"Single\"] = 2] = \"Single\";\n QuoteType[QuoteType[\"Double\"] = 3] = \"Double\";\n})(QuoteType || (QuoteType = {}));\n/**\n * Sequences used to match longer strings.\n *\n * We don't have `Script`, `Style`, or `Title` here. Instead, we re-use the *End\n * sequences with an increased offset.\n */\nconst Sequences = {\n Cdata: new Uint8Array([0x43, 0x44, 0x41, 0x54, 0x41, 0x5b]), // CDATA[\n CdataEnd: new Uint8Array([0x5d, 0x5d, 0x3e]), // ]]>\n CommentEnd: new Uint8Array([0x2d, 0x2d, 0x3e]), // `-->`\n ScriptEnd: new Uint8Array([0x3c, 0x2f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74]), // `</script`\n StyleEnd: new Uint8Array([0x3c, 0x2f, 0x73, 0x74, 0x79, 0x6c, 0x65]), // `</style`\n TitleEnd: new Uint8Array([0x3c, 0x2f, 0x74, 0x69, 0x74, 0x6c, 0x65]), // `</title`\n TextareaEnd: new Uint8Array([\n 0x3c, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x61, 0x72, 0x65, 0x61,\n ]), // `</textarea`\n XmpEnd: new Uint8Array([0x3c, 0x2f, 0x78, 0x6d, 0x70]), // `</xmp`\n};\nexport default class Tokenizer {\n constructor({ xmlMode = false, decodeEntities = true, }, cbs) {\n this.cbs = cbs;\n /** The current state the tokenizer is in. */\n this.state = State.Text;\n /** The read buffer. */\n this.buffer = \"\";\n /** The beginning of the section that is currently being read. */\n this.sectionStart = 0;\n /** The index within the buffer that we are currently looking at. */\n this.index = 0;\n /** The start of the last entity. */\n this.entityStart = 0;\n /** Some behavior, eg. when decoding entities, is done while we are in another state. This keeps track of the other state type. */\n this.baseState = State.Text;\n /** For special parsing behavior inside of script and style tags. */\n this.isSpecial = false;\n /** Indicates whether the tokenizer has been paused. */\n this.running = true;\n /** The offset of the current buffer. */\n this.offset = 0;\n this.currentSequence = undefined;\n this.sequenceIndex = 0;\n this.xmlMode = xmlMode;\n this.decodeEntities = decodeEntities;\n this.entityDecoder = new EntityDecoder(xmlMode ? xmlDecodeTree : htmlDecodeTree, (cp, consumed) => this.emitCodePoint(cp, consumed));\n }\n reset() {\n this.state = State.Text;\n this.buffer = \"\";\n this.sectionStart = 0;\n this.index = 0;\n this.baseState = State.Text;\n this.currentSequence = undefined;\n this.running = true;\n this.offset = 0;\n }\n write(chunk) {\n this.offset += this.buffer.length;\n this.buffer = chunk;\n this.parse();\n }\n end() {\n if (this.running)\n this.finish();\n }\n pause() {\n this.running = false;\n }\n resume() {\n this.running = true;\n if (this.index < this.buffer.length + this.offset) {\n this.parse();\n }\n }\n stateText(c) {\n if (c === CharCodes.Lt ||\n (!this.decodeEntities && this.fastForwardTo(CharCodes.Lt))) {\n if (this.index > this.sectionStart) {\n this.cbs.ontext(this.sectionStart, this.index);\n }\n this.state = State.BeforeTagName;\n this.sectionStart = this.index;\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.startEntity();\n }\n }\n stateSpecialStartSequence(c) {\n const isEnd = this.sequenceIndex === this.currentSequence.length;\n const isMatch = isEnd\n ? // If we are at the end of the sequence, make sure the tag name has ended\n isEndOfTagSection(c)\n : // Otherwise, do a case-insensitive comparison\n (c | 0x20) === this.currentSequence[this.sequenceIndex];\n if (!isMatch) {\n this.isSpecial = false;\n }\n else if (!isEnd) {\n this.sequenceIndex++;\n return;\n }\n this.sequenceIndex = 0;\n this.state = State.InTagName;\n this.stateInTagName(c);\n }\n /** Look for an end tag. For <title> tags, also decode entities. */\n stateInSpecialTag(c) {\n if (this.sequenceIndex === this.currentSequence.length) {\n if (c === CharCodes.Gt || isWhitespace(c)) {\n const endOfText = this.index - this.currentSequence.length;\n if (this.sectionStart < endOfText) {\n // Spoof the index so that reported locations match up.\n const actualIndex = this.index;\n this.index = endOfText;\n this.cbs.ontext(this.sectionStart, endOfText);\n this.index = actualIndex;\n }\n this.isSpecial = false;\n this.sectionStart = endOfText + 2; // Skip over the `</`\n this.stateInClosingTagName(c);\n return; // We are done; skip the rest of the function.\n }\n this.sequenceIndex = 0;\n }\n if ((c | 0x20) === this.currentSequence[this.sequenceIndex]) {\n this.sequenceIndex += 1;\n }\n else if (this.sequenceIndex === 0) {\n if (this.currentSequence === Sequences.TitleEnd) {\n // We have to parse entities in <title> tags.\n if (this.decodeEntities && c === CharCodes.Amp) {\n this.startEntity();\n }\n }\n else if (this.fastForwardTo(CharCodes.Lt)) {\n // Outside of <title> tags, we can fast-forward.\n this.sequenceIndex = 1;\n }\n }\n else {\n // If we see a `<`, set the sequence index to 1; useful for eg. `<</script>`.\n this.sequenceIndex = Number(c === CharCodes.Lt);\n }\n }\n stateCDATASequence(c) {\n if (c === Sequences.Cdata[this.sequenceIndex]) {\n if (++this.sequenceIndex === Sequences.Cdata.length) {\n this.state = State.InCommentLike;\n this.currentSequence = Sequences.CdataEnd;\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n }\n }\n else {\n this.sequenceIndex = 0;\n this.state = State.InDeclaration;\n this.stateInDeclaration(c); // Reconsume the character\n }\n }\n /**\n * When we wait for one specific character, we can speed things up\n * by skipping through the buffer until we find it.\n *\n * @returns Whether the character was found.\n */\n fastForwardTo(c) {\n while (++this.index < this.buffer.length + this.offset) {\n if (this.buffer.charCodeAt(this.index - this.offset) === c) {\n return true;\n }\n }\n /*\n * We increment the index at the end of the `parse` loop,\n * so set it to `buffer.length - 1` here.\n *\n * TODO: Refactor `parse` to increment index before calling states.\n */\n this.index = this.buffer.length + this.offset - 1;\n return false;\n }\n /**\n * Comments and CDATA end with `-->` and `]]>`.\n *\n * Their common qualities are:\n * - Their end sequences have a distinct character they start with.\n * - That character is then repeated, so we have to check multiple repeats.\n * - All characters but the start character of the sequence can be skipped.\n */\n stateInCommentLike(c) {\n if (c === this.currentSequence[this.sequenceIndex]) {\n if (++this.sequenceIndex === this.currentSequence.length) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, this.index, 2);\n }\n else {\n this.cbs.oncomment(this.sectionStart, this.index, 2);\n }\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n this.state = State.Text;\n }\n }\n else if (this.sequenceIndex === 0) {\n // Fast-forward to the first character of the sequence\n if (this.fastForwardTo(this.currentSequence[0])) {\n this.sequenceIndex = 1;\n }\n }\n else if (c !== this.currentSequence[this.sequenceIndex - 1]) {\n // Allow long sequences, eg. --->, ]]]>\n this.sequenceIndex = 0;\n }\n }\n /**\n * HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name.\n *\n * XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar).\n * We allow anything that wouldn't end the tag.\n */\n isTagStartChar(c) {\n return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c);\n }\n startSpecial(sequence, offset) {\n this.isSpecial = true;\n this.currentSequence = sequence;\n this.sequenceIndex = offset;\n this.state = State.SpecialStartSequence;\n }\n stateBeforeTagName(c) {\n if (c === CharCodes.ExclamationMark) {\n this.state = State.BeforeDeclaration;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.Questionmark) {\n this.state = State.InProcessingInstruction;\n this.sectionStart = this.index + 1;\n }\n else if (this.isTagStartChar(c)) {\n const lower = c | 0x20;\n this.sectionStart = this.index;\n if (this.xmlMode) {\n this.state = State.InTagName;\n }\n else if (lower === Sequences.ScriptEnd[2]) {\n this.state = State.BeforeSpecialS;\n }\n else if (lower === Sequences.TitleEnd[2] ||\n lower === Sequences.XmpEnd[2]) {\n this.state = State.BeforeSpecialT;\n }\n else {\n this.state = State.InTagName;\n }\n }\n else if (c === CharCodes.Slash) {\n this.state = State.BeforeClosingTagName;\n }\n else {\n this.state = State.Text;\n this.stateText(c);\n }\n }\n stateInTagName(c) {\n if (isEndOfTagSection(c)) {\n this.cbs.onopentagname(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n }\n stateBeforeClosingTagName(c) {\n if (isWhitespace(c)) {\n // Ignore\n }\n else if (c === CharCodes.Gt) {\n this.state = State.Text;\n }\n else {\n this.state = this.isTagStartChar(c)\n ? State.InClosingTagName\n : State.InSpecialComment;\n this.sectionStart = this.index;\n }\n }\n stateInClosingTagName(c) {\n if (c === CharCodes.Gt || isWhitespace(c)) {\n this.cbs.onclosetag(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.AfterClosingTagName;\n this.stateAfterClosingTagName(c);\n }\n }\n stateAfterClosingTagName(c) {\n // Skip everything until \">\"\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeAttributeName(c) {\n if (c === CharCodes.Gt) {\n this.cbs.onopentagend(this.index);\n if (this.isSpecial) {\n this.state = State.InSpecialTag;\n this.sequenceIndex = 0;\n }\n else {\n this.state = State.Text;\n }\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.Slash) {\n this.state = State.InSelfClosingTag;\n }\n else if (!isWhitespace(c)) {\n this.state = State.InAttributeName;\n this.sectionStart = this.index;\n }\n }\n stateInSelfClosingTag(c) {\n if (c === CharCodes.Gt) {\n this.cbs.onselfclosingtag(this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n this.isSpecial = false; // Reset special state, in case of self-closing special tags\n }\n else if (!isWhitespace(c)) {\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n }\n stateInAttributeName(c) {\n if (c === CharCodes.Eq || isEndOfTagSection(c)) {\n this.cbs.onattribname(this.sectionStart, this.index);\n this.sectionStart = this.index;\n this.state = State.AfterAttributeName;\n this.stateAfterAttributeName(c);\n }\n }\n stateAfterAttributeName(c) {\n if (c === CharCodes.Eq) {\n this.state = State.BeforeAttributeValue;\n }\n else if (c === CharCodes.Slash || c === CharCodes.Gt) {\n this.cbs.onattribend(QuoteType.NoValue, this.sectionStart);\n this.sectionStart = -1;\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n else if (!isWhitespace(c)) {\n this.cbs.onattribend(QuoteType.NoValue, this.sectionStart);\n this.state = State.InAttributeName;\n this.sectionStart = this.index;\n }\n }\n stateBeforeAttributeValue(c) {\n if (c === CharCodes.DoubleQuote) {\n this.state = State.InAttributeValueDq;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.SingleQuote) {\n this.state = State.InAttributeValueSq;\n this.sectionStart = this.index + 1;\n }\n else if (!isWhitespace(c)) {\n this.sectionStart = this.index;\n this.state = State.InAttributeValueNq;\n this.stateInAttributeValueNoQuotes(c); // Reconsume token\n }\n }\n handleInAttributeValue(c, quote) {\n if (c === quote ||\n (!this.decodeEntities && this.fastForwardTo(quote))) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(quote === CharCodes.DoubleQuote\n ? QuoteType.Double\n : QuoteType.Single, this.index + 1);\n this.state = State.BeforeAttributeName;\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.startEntity();\n }\n }\n stateInAttributeValueDoubleQuotes(c) {\n this.handleInAttributeValue(c, CharCodes.DoubleQuote);\n }\n stateInAttributeValueSingleQuotes(c) {\n this.handleInAttributeValue(c, CharCodes.SingleQuote);\n }\n stateInAttributeValueNoQuotes(c) {\n if (isWhitespace(c) || c === CharCodes.Gt) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(QuoteType.Unquoted, this.index);\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.startEntity();\n }\n }\n stateBeforeDeclaration(c) {\n if (c === CharCodes.OpeningSquareBracket) {\n this.state = State.CDATASequence;\n this.sequenceIndex = 0;\n }\n else {\n this.state =\n c === CharCodes.Dash\n ? State.BeforeComment\n : State.InDeclaration;\n }\n }\n stateInDeclaration(c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.ondeclaration(this.sectionStart, this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateInProcessingInstruction(c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.onprocessinginstruction(this.sectionStart, this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeComment(c) {\n if (c === CharCodes.Dash) {\n this.state = State.InCommentLike;\n this.currentSequence = Sequences.CommentEnd;\n // Allow short comments (eg. <!-->)\n this.sequenceIndex = 2;\n this.sectionStart = this.index + 1;\n }\n else {\n this.state = State.InDeclaration;\n }\n }\n stateInSpecialComment(c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.oncomment(this.sectionStart, this.index, 0);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n }\n stateBeforeSpecialS(c) {\n const lower = c | 0x20;\n if (lower === Sequences.ScriptEnd[3]) {\n this.startSpecial(Sequences.ScriptEnd, 4);\n }\n else if (lower === Sequences.StyleEnd[3]) {\n this.startSpecial(Sequences.StyleEnd, 4);\n }\n else {\n this.state = State.InTagName;\n this.stateInTagName(c); // Consume the token again\n }\n }\n stateBeforeSpecialT(c) {\n const lower = c | 0x20;\n switch (lower) {\n case Sequences.TitleEnd[3]: {\n this.startSpecial(Sequences.TitleEnd, 4);\n break;\n }\n case Sequences.TextareaEnd[3]: {\n this.startSpecial(Sequences.TextareaEnd, 4);\n break;\n }\n case Sequences.XmpEnd[3]: {\n this.startSpecial(Sequences.XmpEnd, 4);\n break;\n }\n default: {\n this.state = State.InTagName;\n this.stateInTagName(c); // Consume the token again\n }\n }\n }\n startEntity() {\n this.baseState = this.state;\n this.state = State.InEntity;\n this.entityStart = this.index;\n this.entityDecoder.startEntity(this.xmlMode\n ? DecodingMode.Strict\n : this.baseState === State.Text ||\n this.baseState === State.InSpecialTag\n ? DecodingMode.Legacy\n : DecodingMode.Attribute);\n }\n stateInEntity() {\n const length = this.entityDecoder.write(this.buffer, this.index - this.offset);\n // If `length` is positive, we are done with the entity.\n if (length >= 0) {\n this.state = this.baseState;\n if (length === 0) {\n this.index = this.entityStart;\n }\n }\n else {\n // Mark buffer as consumed.\n this.index = this.offset + this.buffer.length - 1;\n }\n }\n /**\n * Remove data that has already been consumed from the buffer.\n */\n cleanup() {\n // If we are inside of text or attributes, emit what we already have.\n if (this.running && this.sectionStart !== this.index) {\n if (this.state === State.Text ||\n (this.state === State.InSpecialTag && this.sequenceIndex === 0)) {\n this.cbs.ontext(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n else if (this.state === State.InAttributeValueDq ||\n this.state === State.InAttributeValueSq ||\n this.state === State.InAttributeValueNq) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n }\n }\n shouldContinue() {\n return this.index < this.buffer.length + this.offset && this.running;\n }\n /**\n * Iterates through the buffer, calling the function corresponding to the current state.\n *\n * States that are more likely to be hit are higher up, as a performance improvement.\n */\n parse() {\n while (this.shouldContinue()) {\n const c = this.buffer.charCodeAt(this.index - this.offset);\n switch (this.state) {\n case State.Text: {\n this.stateText(c);\n break;\n }\n case State.SpecialStartSequence: {\n this.stateSpecialStartSequence(c);\n break;\n }\n case State.InSpecialTag: {\n this.stateInSpecialTag(c);\n break;\n }\n case State.CDATASequence: {\n this.stateCDATASequence(c);\n break;\n }\n case State.InAttributeValueDq: {\n this.stateInAttributeValueDoubleQuotes(c);\n break;\n }\n case State.InAttributeName: {\n this.stateInAttributeName(c);\n break;\n }\n case State.InCommentLike: {\n this.stateInCommentLike(c);\n break;\n }\n case State.InSpecialComment: {\n this.stateInSpecialComment(c);\n break;\n }\n case State.BeforeAttributeName: {\n this.stateBeforeAttributeName(c);\n break;\n }\n case State.InTagName: {\n this.stateInTagName(c);\n break;\n }\n case State.InClosingTagName: {\n this.stateInClosingTagName(c);\n break;\n }\n case State.BeforeTagName: {\n this.stateBeforeTagName(c);\n break;\n }\n case State.AfterAttributeName: {\n this.stateAfterAttributeName(c);\n break;\n }\n case State.InAttributeValueSq: {\n this.stateInAttributeValueSingleQuotes(c);\n break;\n }\n case State.BeforeAttributeValue: {\n this.stateBeforeAttributeValue(c);\n break;\n }\n case State.BeforeClosingTagName: {\n this.stateBeforeClosingTagName(c);\n break;\n }\n case State.AfterClosingTagName: {\n this.stateAfterClosingTagName(c);\n break;\n }\n case State.BeforeSpecialS: {\n this.stateBeforeSpecialS(c);\n break;\n }\n case State.BeforeSpecialT: {\n this.stateBeforeSpecialT(c);\n break;\n }\n case State.InAttributeValueNq: {\n this.stateInAttributeValueNoQuotes(c);\n break;\n }\n case State.InSelfClosingTag: {\n this.stateInSelfClosingTag(c);\n break;\n }\n case State.InDeclaration: {\n this.stateInDeclaration(c);\n break;\n }\n case State.BeforeDeclaration: {\n this.stateBeforeDeclaration(c);\n break;\n }\n case State.BeforeComment: {\n this.stateBeforeComment(c);\n break;\n }\n case State.InProcessingInstruction: {\n this.stateInProcessingInstruction(c);\n break;\n }\n case State.InEntity: {\n this.stateInEntity();\n break;\n }\n }\n this.index++;\n }\n this.cleanup();\n }\n finish() {\n if (this.state === State.InEntity) {\n this.entityDecoder.end();\n this.state = this.baseState;\n }\n this.handleTrailingData();\n this.cbs.onend();\n }\n /** Handle any trailing data. */\n handleTrailingData() {\n const endIndex = this.buffer.length + this.offset;\n // If there is no remaining data, we are done.\n if (this.sectionStart >= endIndex) {\n return;\n }\n if (this.state === State.InCommentLike) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, endIndex, 0);\n }\n else {\n this.cbs.oncomment(this.sectionStart, endIndex, 0);\n }\n }\n else if (this.state === State.InTagName ||\n this.state === State.BeforeAttributeName ||\n this.state === State.BeforeAttributeValue ||\n this.state === State.AfterAttributeName ||\n this.state === State.InAttributeName ||\n this.state === State.InAttributeValueSq ||\n this.state === State.InAttributeValueDq ||\n this.state === State.InAttributeValueNq ||\n this.state === State.InClosingTagName) {\n /*\n * If we are currently in an opening or closing tag, us not calling the\n * respective callback signals that the tag should be ignored.\n */\n }\n else {\n this.cbs.ontext(this.sectionStart, endIndex);\n }\n }\n emitCodePoint(cp, consumed) {\n if (this.baseState !== State.Text &&\n this.baseState !== State.InSpecialTag) {\n if (this.sectionStart < this.entityStart) {\n this.cbs.onattribdata(this.sectionStart, this.entityStart);\n }\n this.sectionStart = this.entityStart + consumed;\n this.index = this.sectionStart - 1;\n this.cbs.onattribentity(cp);\n }\n else {\n if (this.sectionStart < this.entityStart) {\n this.cbs.ontext(this.sectionStart, this.entityStart);\n }\n this.sectionStart = this.entityStart + consumed;\n this.index = this.sectionStart - 1;\n this.cbs.ontextentity(cp, this.sectionStart);\n }\n }\n}\n//# sourceMappingURL=Tokenizer.js.map","const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c);\n\nlet idbProxyableTypes;\nlet cursorAdvanceMethods;\n// This is a function to prevent it throwing up in node environments.\nfunction getIdbProxyableTypes() {\n return (idbProxyableTypes ||\n (idbProxyableTypes = [\n IDBDatabase,\n IDBObjectStore,\n IDBIndex,\n IDBCursor,\n IDBTransaction,\n ]));\n}\n// This is a function to prevent it throwing up in node environments.\nfunction getCursorAdvanceMethods() {\n return (cursorAdvanceMethods ||\n (cursorAdvanceMethods = [\n IDBCursor.prototype.advance,\n IDBCursor.prototype.continue,\n IDBCursor.prototype.continuePrimaryKey,\n ]));\n}\nconst transactionDoneMap = new WeakMap();\nconst transformCache = new WeakMap();\nconst reverseTransformCache = new WeakMap();\nfunction promisifyRequest(request) {\n const promise = new Promise((resolve, reject) => {\n const unlisten = () => {\n request.removeEventListener('success', success);\n request.removeEventListener('error', error);\n };\n const success = () => {\n resolve(wrap(request.result));\n unlisten();\n };\n const error = () => {\n reject(request.error);\n unlisten();\n };\n request.addEventListener('success', success);\n request.addEventListener('error', error);\n });\n // This mapping exists in reverseTransformCache but doesn't exist in transformCache. This\n // is because we create many promises from a single IDBRequest.\n reverseTransformCache.set(promise, request);\n return promise;\n}\nfunction cacheDonePromiseForTransaction(tx) {\n // Early bail if we've already created a done promise for this transaction.\n if (transactionDoneMap.has(tx))\n return;\n const done = new Promise((resolve, reject) => {\n const unlisten = () => {\n tx.removeEventListener('complete', complete);\n tx.removeEventListener('error', error);\n tx.removeEventListener('abort', error);\n };\n const complete = () => {\n resolve();\n unlisten();\n };\n const error = () => {\n reject(tx.error || new DOMException('AbortError', 'AbortError'));\n unlisten();\n };\n tx.addEventListener('complete', complete);\n tx.addEventListener('error', error);\n tx.addEventListener('abort', error);\n });\n // Cache it for later retrieval.\n transactionDoneMap.set(tx, done);\n}\nlet idbProxyTraps = {\n get(target, prop, receiver) {\n if (target instanceof IDBTransaction) {\n // Special handling for transaction.done.\n if (prop === 'done')\n return transactionDoneMap.get(target);\n // Make tx.store return the only store in the transaction, or undefined if there are many.\n if (prop === 'store') {\n return receiver.objectStoreNames[1]\n ? undefined\n : receiver.objectStore(receiver.objectStoreNames[0]);\n }\n }\n // Else transform whatever we get back.\n return wrap(target[prop]);\n },\n set(target, prop, value) {\n target[prop] = value;\n return true;\n },\n has(target, prop) {\n if (target instanceof IDBTransaction &&\n (prop === 'done' || prop === 'store')) {\n return true;\n }\n return prop in target;\n },\n};\nfunction replaceTraps(callback) {\n idbProxyTraps = callback(idbProxyTraps);\n}\nfunction wrapFunction(func) {\n // Due to expected object equality (which is enforced by the caching in `wrap`), we\n // only create one new func per func.\n // Cursor methods are special, as the behaviour is a little more different to standard IDB. In\n // IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the\n // cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense\n // with real promises, so each advance methods returns a new promise for the cursor object, or\n // undefined if the end of the cursor has been reached.\n if (getCursorAdvanceMethods().includes(func)) {\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n func.apply(unwrap(this), args);\n return wrap(this.request);\n };\n }\n return function (...args) {\n // Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use\n // the original object.\n return wrap(func.apply(unwrap(this), args));\n };\n}\nfunction transformCachableValue(value) {\n if (typeof value === 'function')\n return wrapFunction(value);\n // This doesn't return, it just creates a 'done' promise for the transaction,\n // which is later returned for transaction.done (see idbObjectHandler).\n if (value instanceof IDBTransaction)\n cacheDonePromiseForTransaction(value);\n if (instanceOfAny(value, getIdbProxyableTypes()))\n return new Proxy(value, idbProxyTraps);\n // Return the same value back if we're not going to transform it.\n return value;\n}\nfunction wrap(value) {\n // We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because\n // IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.\n if (value instanceof IDBRequest)\n return promisifyRequest(value);\n // If we've already transformed this value before, reuse the transformed value.\n // This is faster, but it also provides object equality.\n if (transformCache.has(value))\n return transformCache.get(value);\n const newValue = transformCachableValue(value);\n // Not all types are transformed.\n // These may be primitive types, so they can't be WeakMap keys.\n if (newValue !== value) {\n transformCache.set(value, newValue);\n reverseTransformCache.set(newValue, value);\n }\n return newValue;\n}\nconst unwrap = (value) => reverseTransformCache.get(value);\n\n/**\n * Open a database.\n *\n * @param name Name of the database.\n * @param version Schema version.\n * @param callbacks Additional callbacks.\n */\nfunction openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {\n const request = indexedDB.open(name, version);\n const openPromise = wrap(request);\n if (upgrade) {\n request.addEventListener('upgradeneeded', (event) => {\n upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);\n });\n }\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event.newVersion, event));\n }\n openPromise\n .then((db) => {\n if (terminated)\n db.addEventListener('close', () => terminated());\n if (blocking) {\n db.addEventListener('versionchange', (event) => blocking(event.oldVersion, event.newVersion, event));\n }\n })\n .catch(() => { });\n return openPromise;\n}\n/**\n * Delete a database.\n *\n * @param name Name of the database.\n */\nfunction deleteDB(name, { blocked } = {}) {\n const request = indexedDB.deleteDatabase(name);\n if (blocked) {\n request.addEventListener('blocked', (event) => blocked(\n // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405\n event.oldVersion, event));\n }\n return wrap(request).then(() => undefined);\n}\n\nconst readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];\nconst writeMethods = ['put', 'add', 'delete', 'clear'];\nconst cachedMethods = new Map();\nfunction getMethod(target, prop) {\n if (!(target instanceof IDBDatabase &&\n !(prop in target) &&\n typeof prop === 'string')) {\n return;\n }\n if (cachedMethods.get(prop))\n return cachedMethods.get(prop);\n const targetFuncName = prop.replace(/FromIndex$/, '');\n const useIndex = prop !== targetFuncName;\n const isWrite = writeMethods.includes(targetFuncName);\n if (\n // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.\n !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) ||\n !(isWrite || readMethods.includes(targetFuncName))) {\n return;\n }\n const method = async function (storeName, ...args) {\n // isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(\n const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');\n let target = tx.store;\n if (useIndex)\n target = target.index(args.shift());\n // Must reject if op rejects.\n // If it's a write operation, must reject if tx.done rejects.\n // Must reject with op rejection first.\n // Must resolve with op value.\n // Must handle both promises (no unhandled rejections)\n return (await Promise.all([\n target[targetFuncName](...args),\n isWrite && tx.done,\n ]))[0];\n };\n cachedMethods.set(prop, method);\n return method;\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),\n has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop),\n}));\n\nconst advanceMethodProps = ['continue', 'continuePrimaryKey', 'advance'];\nconst methodMap = {};\nconst advanceResults = new WeakMap();\nconst ittrProxiedCursorToOriginalProxy = new WeakMap();\nconst cursorIteratorTraps = {\n get(target, prop) {\n if (!advanceMethodProps.includes(prop))\n return target[prop];\n let cachedFunc = methodMap[prop];\n if (!cachedFunc) {\n cachedFunc = methodMap[prop] = function (...args) {\n advanceResults.set(this, ittrProxiedCursorToOriginalProxy.get(this)[prop](...args));\n };\n }\n return cachedFunc;\n },\n};\nasync function* iterate(...args) {\n // tslint:disable-next-line:no-this-assignment\n let cursor = this;\n if (!(cursor instanceof IDBCursor)) {\n cursor = await cursor.openCursor(...args);\n }\n if (!cursor)\n return;\n cursor = cursor;\n const proxiedCursor = new Proxy(cursor, cursorIteratorTraps);\n ittrProxiedCursorToOriginalProxy.set(proxiedCursor, cursor);\n // Map this double-proxy back to the original, so other cursor methods work.\n reverseTransformCache.set(proxiedCursor, unwrap(cursor));\n while (cursor) {\n yield proxiedCursor;\n // If one of the advancing methods was not called, call continue().\n cursor = await (advanceResults.get(proxiedCursor) || cursor.continue());\n advanceResults.delete(proxiedCursor);\n }\n}\nfunction isIteratorProp(target, prop) {\n return ((prop === Symbol.asyncIterator &&\n instanceOfAny(target, [IDBIndex, IDBObjectStore, IDBCursor])) ||\n (prop === 'iterate' && instanceOfAny(target, [IDBIndex, IDBObjectStore])));\n}\nreplaceTraps((oldTraps) => ({\n ...oldTraps,\n get(target, prop, receiver) {\n if (isIteratorProp(target, prop))\n return iterate;\n return oldTraps.get(target, prop, receiver);\n },\n has(target, prop) {\n return isIteratorProp(target, prop) || oldTraps.has(target, prop);\n },\n}));\n\nexport { deleteDB, openDB, unwrap, wrap };\n","\nexport function scramtag() {\n return (\"\"+1e10).replace(/[018]/g,\n c => (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)\n );\n}\n","import { scramtag } from './snippets/wasm-4b0f351a8e6eeb46/inline0.js';\n\nlet wasm;\n\nfunction addToExternrefTable0(obj) {\n const idx = wasm.__externref_table_alloc();\n wasm.__wbindgen_export_2.set(idx, obj);\n return idx;\n}\n\nfunction handleError(f, args) {\n try {\n return f.apply(this, args);\n } catch (e) {\n const idx = addToExternrefTable0(e);\n wasm.__wbindgen_exn_store(idx);\n }\n}\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nconst cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nlet cachedDataViewMemory0 = null;\n\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n\nfunction takeFromExternrefTable0(idx) {\n const value = wasm.__wbindgen_export_2.get(idx);\n wasm.__externref_table_dealloc(idx);\n return value;\n}\n\nfunction passArray8ToWasm0(arg, malloc) {\n const ptr = malloc(arg.length * 1, 1) >>> 0;\n getUint8ArrayMemory0().set(arg, ptr / 1);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n\nconst RewriterFinalization = (typeof FinalizationRegistry === 'undefined')\n ? { register: () => {}, unregister: () => {} }\n : new FinalizationRegistry(ptr => wasm.__wbg_rewriter_free(ptr >>> 0, 1));\n\nexport class Rewriter {\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n RewriterFinalization.unregister(this);\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_rewriter_free(ptr, 0);\n }\n /**\n * @param {string} js\n * @param {string} base\n * @param {string} url\n * @param {boolean} module\n * @returns {JsRewriterOutput}\n */\n rewrite_js(js, base, url, module) {\n const ptr0 = passStringToWasm0(js, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(base, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len2 = WASM_VECTOR_LEN;\n const ret = wasm.rewriter_rewrite_js(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, module);\n if (ret[2]) {\n throw takeFromExternrefTable0(ret[1]);\n }\n return takeFromExternrefTable0(ret[0]);\n }\n /**\n * @param {Uint8Array} js\n * @param {string} base\n * @param {string} url\n * @param {boolean} module\n * @returns {JsRewriterOutput}\n */\n rewrite_js_bytes(js, base, url, module) {\n const ptr0 = passArray8ToWasm0(js, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(base, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len2 = WASM_VECTOR_LEN;\n const ret = wasm.rewriter_rewrite_js_bytes(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, module);\n if (ret[2]) {\n throw takeFromExternrefTable0(ret[1]);\n }\n return takeFromExternrefTable0(ret[0]);\n }\n /**\n * @param {object} scramjet\n */\n constructor(scramjet) {\n const ret = wasm.rewriter_new(scramjet);\n if (ret[2]) {\n throw takeFromExternrefTable0(ret[1]);\n }\n this.__wbg_ptr = ret[0] >>> 0;\n RewriterFinalization.register(this, this.__wbg_ptr, this);\n return this;\n }\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n if (module.headers.get('Content-Type') != 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {\n const ret = arg0.buffer;\n return ret;\n };\n imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {\n const ret = arg0.call(arg1, arg2);\n return ret;\n }, arguments) };\n imports.wbg.__wbg_call_833bed5770ea2041 = function() { return handleError(function (arg0, arg1, arg2, arg3) {\n const ret = arg0.call(arg1, arg2, arg3);\n return ret;\n }, arguments) };\n imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {\n const ret = Reflect.get(arg0, arg1);\n return ret;\n }, arguments) };\n imports.wbg.__wbg_new_405e22f390576ce2 = function() {\n const ret = new Object();\n return ret;\n };\n imports.wbg.__wbg_new_78feb108b6472713 = function() {\n const ret = new Array();\n return ret;\n };\n imports.wbg.__wbg_new_9ffbe0a71eff35e3 = function() { return handleError(function (arg0, arg1) {\n const ret = new URL(getStringFromWasm0(arg0, arg1));\n return ret;\n }, arguments) };\n imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {\n const ret = new Uint8Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_newwithbase_161c299e7a34e2eb = function() { return handleError(function (arg0, arg1, arg2, arg3) {\n const ret = new URL(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));\n return ret;\n }, arguments) };\n imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {\n const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);\n return ret;\n };\n imports.wbg.__wbg_scramtag_3a255d78b157986d = function(arg0) {\n const ret = scramtag();\n const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len1 = WASM_VECTOR_LEN;\n getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);\n getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);\n };\n imports.wbg.__wbg_set_bb8cecf6a62b9f46 = function() { return handleError(function (arg0, arg1, arg2) {\n const ret = Reflect.set(arg0, arg1, arg2);\n return ret;\n }, arguments) };\n imports.wbg.__wbg_toString_5285597960676b7b = function(arg0) {\n const ret = arg0.toString();\n return ret;\n };\n imports.wbg.__wbg_toString_c813bbd34d063839 = function(arg0) {\n const ret = arg0.toString();\n return ret;\n };\n imports.wbg.__wbindgen_boolean_get = function(arg0) {\n const v = arg0;\n const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;\n return ret;\n };\n imports.wbg.__wbindgen_error_new = function(arg0, arg1) {\n const ret = new Error(getStringFromWasm0(arg0, arg1));\n return ret;\n };\n imports.wbg.__wbindgen_init_externref_table = function() {\n const table = wasm.__wbindgen_export_2;\n const offset = table.grow(4);\n table.set(0, undefined);\n table.set(offset + 0, undefined);\n table.set(offset + 1, null);\n table.set(offset + 2, true);\n table.set(offset + 3, false);\n ;\n };\n imports.wbg.__wbindgen_is_function = function(arg0) {\n const ret = typeof(arg0) === 'function';\n return ret;\n };\n imports.wbg.__wbindgen_memory = function() {\n const ret = wasm.memory;\n return ret;\n };\n imports.wbg.__wbindgen_string_get = function(arg0, arg1) {\n const obj = arg1;\n const ret = typeof(obj) === 'string' ? obj : undefined;\n var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len1 = WASM_VECTOR_LEN;\n getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);\n getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);\n };\n imports.wbg.__wbindgen_string_new = function(arg0, arg1) {\n const ret = getStringFromWasm0(arg0, arg1);\n return ret;\n };\n imports.wbg.__wbindgen_throw = function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n };\n\n return imports;\n}\n\nfunction __wbg_init_memory(imports, memory) {\n\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedDataViewMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n\n\n wasm.__wbindgen_start();\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module !== 'undefined') {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n\n __wbg_init_memory(imports);\n\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n\n const instance = new WebAssembly.Instance(module, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module_or_path !== 'undefined') {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (typeof module_or_path === 'undefined') {\n module_or_path = new URL('wasm_bg.wasm', \"\");\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n __wbg_init_memory(imports);\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n","// getDefaultExport function for compatibility with non-ESM modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};\n","__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/// <reference types=\"@rspack/core/module\" />\n\nimport type { ScramjetVersionInfo } from \"./types\";\n\n/**\n * Hash of the current commit in `MercuryWorkshop/scramjet` Scramjet was built from.\n */\ndeclare const COMMITHASH: string;\n/**\n * Semantic version of the current Scramjet build.\n */\ndeclare const VERSION: string;\n\n/**\n * @category Window Context\n */\nexport type { ScramjetFlags } from \"./types\";\n\n/**\n * @category Window Context\n */\nexport type { ScramjetInitConfig } from \"./types\";\n\n/**\n * @category Window Context\n */\nexport type { ScramjetGlobalEvent } from \"./client/events\";\n\n/**\n * @category Window Context\n */\nexport type { ScramjetGlobalDownloadEvent } from \"./client/events\";\n\n/**\n * @category Window Context\n */\nexport type { ScramjetGlobalEvents } from \"./client/events\";\n\n/**\n * @category Window Context\n */\nexport type { ScramjetDownload } from \"./client/events\";\n\n/**\n * @category Window Context\n */\nexport type { ScramjetEvent } from \"./client/events\";\n\n/**\n * @category Window Context\n */\nexport type { ScramjetEvents } from \"./client/events\";\n\n/**\n * @category Window Context\n */\nexport type { NavigateEvent } from \"./client/events\";\n\n/**\n * @category Window Context\n */\nexport type { UrlChangeEvent } from \"./client/events\";\n\n/**\n * @category Window Context\n */\nexport type { ScramjetContextEvent } from \"./client/events\";\n\n/**\n * @category Window Context\n */\nexport type { ScramjetController } from \"./controller\";\n\n/**\n * @category Window Context\n */\nexport type { ScramjetFrame } from \"./controller/frame\";\n\n/**\n * @category Window Context\n */\nexport type { ScramjetClient } from \"./client\";\n\n/**\n * @category Service Worker Context\n */\nexport type { ScramjetServiceWorker } from \"./worker\";\n\n/**\n * @fileoverview Scramjet Entry Point. This module contain global constants and factory functions to load the APIs in the bundle.\n *\n * @categoryDescription Window Context\n * APIs for the main window context, which includes creating Scramjet Frames and the Controller for managing the Scramjet proxy behavior in the SW.\n * @categoryDescription Service Worker Context\n * APIs designed for the service worker context, where the core logic resides. These are the essentials and include the the `ScramjetServiceWorker`.\n */\n\n/**\n * Factory function that creates the `ScramjetController` class.\n *\n * @returns The `ScramjetController` class.\n *\n * @example\n * ```typescript\n * const { ScramjetController } = $scramjetLoadController();\n *\n * const scramjet = new ScramjetController({\n * prefix: \"/scramjet/\"\n * });\n *\n * await scramjet.init();\n *\n * const frame = scramjet.createFrame();\n * document.body.appendChild(frame.frame);\n * frame.navigate(\"https://example.com\");\n * ```\n *\n * @category Window Context\n */\nexport function $scramjetLoadController() {\n\treturn require(\"./controller/index\");\n}\n/**\n * Factory function that creates the `ScramjetClient` for controlling sandboxing.\n *\n * @returns The `ScramjetClient` class.\n *\n * @example\n * ```typescript\n * const ScramjetClient = $scramjetLoadClient();\n *\n * const scramjetClient = new ScramjetClient.ScramjetClient();\n * ```\n * @category Window Context\n */\nexport function $scramjetLoadClient() {\n\treturn require(\"./client/entry\");\n}\n/**\n * Factory function that creates the `ScramjetServiceWorker` class.\n *\n * @returns The `ScramjetServiceWorker` class.\n *\n * Plain SW example\n * @example\n * ```typescript\n * // In your Service Worker\n * const { ScramjetServiceWorker } = $scramjetLoadWorker();\n *\n * const scramjet = new ScramjetServiceWorker();\n *\n * self.addEventListener(\"fetch\", async (ev) => {\n * await scramjet.loadConfig();\n *\n * if (scramjet.route(ev)) {\n * ev.respondWith(scramjet.fetch(ev));\n * }\n * });\n * ```\n *\n * Workbox-powered SW routing example\n * @example\n * ```typescript\n * // In your Service Worker (ensure you are using a bundler for Workbox)\n * // This is more useful for a webOS or if you have Offline PWA support on your proxy site\n * import { registerRoute } from 'workbox-routing';\n *\n * const { ScramjetServiceWorker } = $scramjetLoadWorker();\n *\n * const scramjet = new ScramjetServiceWorker();\n *\n * registerRoute(\n * ({ request }) => {\n * return scramjet.route({ request });\n * },\n * async ({ event }) => {\n * await scramjet.loadConfig();\n *\n * return scramjet.fetch(event);\n * }\n * );\n * ```\n *\n * @category Service Worker Context\n */\nexport function $scramjetLoadWorker() {\n\treturn require(\"./worker/index\");\n}\n\nglobalThis.$scramjetRequire = function (path: string) {\n\treturn require(path);\n};\n\n/**\n * Version information for the current Scramjet build.\n *\n * @category Window Context\n */\nexport const $scramjetVersion: ScramjetVersionInfo = {\n\tbuild: COMMITHASH,\n\tversion: VERSION,\n};\n\nglobalThis.$scramjetLoadController = $scramjetLoadController;\nglobalThis.$scramjetLoadClient = $scramjetLoadClient;\nglobalThis.$scramjetLoadWorker = $scramjetLoadWorker;\nglobalThis.$scramjetVersion = $scramjetVersion;\n\nif (\"document\" in globalThis && document?.currentScript) {\n\tdocument.currentScript.remove();\n}\n"],"names":["Object","decodeURIComponent","e","console","Date","parseInt","Array","Error","ScramjetClient","CookieStore","Map","global","SCRAMJETCLIENT","iswindow","dbg","SingletonBox","BareClient","Promise","resolve","addEventListener","data","createWrapFn","Proxy","target","prop","split","realProp","realTarget","a","b","original","Reflect","args","that","client","value","base","url","frag","undefined","URL","currentWin","frame","curclient","parentWin","parentClient","createLocationProxy","sframe","SCRAMJETFRAME","currentwin","currentFrame","currentclient","cookiestr","context","modules","key","module","aorder","unrewriteUrl","ev","NavigateEvent","rewriteUrl","name","handler","n","h","constructor","newTarget","returnValue","earlyreturn","ctx","r","fn","pst","err","s","location","config","flagEnabled","getOwnPropertyDescriptorHandler","descriptor","oldDescriptor","v","desc","_self","map","proxy","_receiver","namespace","NamedNodeMap","isNaN","Number","keys","self","msg","controller","rewriteCss","unrewriteCss","style","CSSStyleDeclaration","tostring","String","rewriteHtml","encoder","TextEncoder","bytesToBase64","bytes","btoa","byte","attrObject","urlinterfaces","originalhrefs","attr","element","i","href","node","Document","attrib","cleaned","attrNames","ruleList","htmlRules","rule","ret","_ctx","_namespace","val","newval","rewriteJs","scriptSource","atob","unrewriteHtml","realwin","newclient","Function","callerGlobalThisProxied","callerClient","UrlChangeEvent","f","win","entries","entry","file","order","enabled","disabled","_client","Navigator","registrationmap","WeakMap","registration","fakeRegistration","EventTarget","handle","worker","state","index","property","attributes","localStorageProxy","sessionStorageProxy","globalThis","window","Window","isworker","issw","isdedicated","isshared","isemulatedsw","loadAndHook","setConfig","loadCodecs","Math","runtime","ScramjetServiceWorkerRuntime","contextev","ScramjetContextEvent","urlchangeev","ScramjetGlobalDownloadEvent","Event","download","Location","fakeLocation","descriptorSource","native","log","_v","rewriteBlob","unrewriteBlob","del","argdbg","arg","recurse","Symbol","ar","warn","t","closure","error","stack","newstack","lines","line","l","_value","js","indirectEval","strict","indirection","realOnEvent","handlers","wraplistener","listener","realEvent","type","reciever","origlistener","proxylistener","arr","targets","rewriteFunction","stringifiedFunction","content","RawFunction","RawAsyncFunction","RawGeneratorFunction","RawAsyncGeneratorFunction","boundimport","resolved","metaobj","rootPromise","root","directory","POLLUTANT","wrappedPostMessage","toproxy","pollution","socketmap","socketstreammap","fakeWebSocket","barews","fakeEventSend","fakeev","CloseEvent","payload","Blob","ArrayBuffer","MessageEvent","ws","openResolver","closeResolver","openRejector","reject","ReadableStream","WritableStream","chunk","ARGS","HEADERS","headers","sab","SharedArrayBuffer","view","DataView","now","performance","status","headersLength","headersab","Uint8Array","TextDecoder","bodyLength","bodyab","body","parser","DOMParser","header","match","re","RegExp","SCRAMTAG","buf","tag","before","registerRewrites","sourcemap","decoder","rewrites","rewritelen","cursor","start","size","end","oldLen","oldStr","doUnrewrite","stringified","extracted","extractTag","tagOffset","tagStart","fnStart","fnEnd","getEnd","rewrite","fnrewrites","newString","lastpos","conn","BareMuxConnection","port","identifier","current","test","str","obj","lhs","op","rhs","ownerclient","cevent","event","handleMessage","_e","token","fetchhandlers","request","fakeRequest","Headers","fakeFetchEvent","responded","response","message","_reciever","ScramjetController","deepMerge","source","newConfig","encodeURIComponent","navigator","document","ScramjetFrame","encodedHash","codecEncode","prefixed","codecDecode","db","openDB","newconfig","options","logfuncs","severity","old","_","fmt","meta","cookies","parsed","parse","cookie","domain","sameSite","id","fromJs","validCookies","JSON","ScramjetHeaders","rewriteSrcset","cookieStore","nativeFunction","flag","regex","partialflags","css","handleCss","encodedUrl","importStatement","firstQuote","endQuote","SEC_HEADERS","Set","URL_HEADERS","rewriteLinkHeader","link","rewriteHeaders","rawHeaders","storedReferrerPolicies","cspHeader","urlHeader","referrerUrl","storedPolicyData","storedReferrerPolicy","rawDir","getSiteDirective","getInjectScripts","script","dump","injected","base64Injected","html","fromTop","rewriteHtmlInner","DomHandler","dom","Parser","traverseParsedHtml","sel","eventAttributes","json","Comment","contentArray","childNode","head","findhead","ElementType","child","Element","src","render","traverse","srcset","rewrittenSources","sources","descriptors","rewrittenUrl","res","rewriteJsInner","rewriteJsWasm","input","rewriter","getRewriter","out","scramtag","errors","textDecoder","newjs","pushmap","sourcemapfn","strictMode","tryCanParseURL","origin","blob","realUrl","decodedHash","wasm_u8","asyncSetWasm","fetch","c","MAGIC","x","rewriters","initSync","WebAssembly","len","Rewriter","foundHead","inject","rewriteWorkers","rewritten","SITE_HIERARCHY","getDB","getTracker","setTracker","tracker","deleteTracker","initializeTracker","requestUrl","referrer","initialSite","updateTracker","originalUrl","redirectUrl","newReferrerPolicy","getMostRestrictiveSite","currentSite","trackedValue","currentValue","cleanTracker","storeReferrerPolicy","policy","getReferrerPolicy","CACHE_KEY","getCachedSuffixList","setCachedSuffixList","CACHE_DURATION_MINUTES","referrerURL","isSameSite","url1","url2","registrableDomain1","getRegistrableDomain","publicSuffixes","getPublicSuffixList","labels","hostname","matchedSuffix","isException","suffix","actualSuffix","matchesSuffix","hostnameLabels","suffixLabels","offset","hostLabel","suffixLabel","suffixLabelCount","domainLabelCount","publicSuffixesResponse","cached","publicSuffixesRaw","trimmed","spaceIndex","errorTemplate","trace","fetchedURL","renderError","crossOriginIsolated","Response","FakeServiceWorker","MessageChannel","cb","transfer","isRedirect","handleFetch","topFrameName","parentFrameName","b64","scriptType","extraParams","param","dataUrl","rewriteBody","activeWorker","w","clientURL","isTopLevelProxyNavigation","currentReferrer","allClients","parentChainClient","parentPolicyData","siteDirective","unrewrittenReferrer","ScramjetRequestEvent","handleResponse","errorDetails","AggregateError","formattedError","destination","mode","bareClient","swtarget","responseBody","isNavigationRequest","responseHeaders","newSiteDirective","maybeHeaders","promise","isDownload","contentType","displayableMimes","filename","disp","filenameMatch","length","clis","clients","ScramjetHandleResponseEvent","workertype","statusText","rawResponse","requestHeaders","method","ScramjetServiceWorker","clientId","o","MessagePort","WebSocket","setTimeout","TypeError","p","BroadcastChannel","SharedWorker","DOMException","y","Request","arguments","Uint16Array","IDBTransaction","IDBRequest","IDBCursor","IDBDatabase","IDBObjectStore","IDBIndex","indexedDB","crypto","g","FinalizationRegistry","path","require","COMMITHASH","VERSION"],"mappings":"8BAEA,IAAI,EAAsB,CACxB,aAAc,GACd,IAAK,GACL,OAAQ,EACV,EAEA,SAAS,EAAiB,CAAG,EAC3B,MAAO,AAAe,UAAf,OAAO,GAAoB,CAAC,CAAC,EAAI,IAAI,EAC9C,CAEA,SAAS,EAAY,CAAc,CAAE,CAAO,EAC1C,IAmD0B,EAGtB,EACA,EACA,EAxDA,EAAQ,EAAe,KAAK,CAAC,KAAK,MAAM,CAAC,GAGzC,GAgDsB,EAjDH,EAAM,KAAK,GAoD9B,EAAO,GACP,EAAQ,GAER,CADA,EAAe,EAAiB,KAAK,CAAC,MACzB,MAAM,CAAG,GACxB,EAAO,EAAa,KAAK,GACzB,EAAQ,EAAa,IAAI,CAAC,MAE1B,EAAQ,EAGH,CAAE,KAAM,EAAM,MAAO,CAAM,GA5D9B,EAAO,EAAO,IAAI,CAClB,EAAQ,EAAO,KAAK,CAExB,EAAU,EACNA,OAAO,MAAM,CAAC,CAAC,EAAG,EAAqB,GACvC,EAEJ,GAAI,CACF,EAAQ,EAAQ,YAAY,CAAGC,mBAAmB,GAAS,CAC7D,CAAE,MAAOC,EAAG,CACVC,QAAQ,KAAK,CACX,8EACE,EACA,gEACFD,EAEJ,CAEA,IAAI,EAAS,CACX,KAAM,EACN,MAAO,CACT,EAuBA,OArBA,EAAM,OAAO,CAAC,SAAU,CAAI,EAC1B,IAAI,EAAQ,EAAK,KAAK,CAAC,KACnB,EAAM,EAAM,KAAK,GAAG,QAAQ,GAAG,WAAW,GAC1C,EAAQ,EAAM,IAAI,CAAC,IACnB,AAAQ,aAAR,EACF,EAAO,OAAO,CAAG,IAAIE,KAAK,GACjB,AAAQ,YAAR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+S,EAASJ,EAGZ,EAEShW,EAAQ,IAAI,EAEdmW,AAAAA,GAAAA,EAAAA,CAAAA,AAAAA,EAAOnW,EAAQ,IAAI,CAAE,CAC3B,eAAgB,EACjB,EACD,CAgIO,SAASgT,EAAcqD,CAAc,CAAEjE,CAAa,EAe1D,OAAOkE,AAbkBC,AADTF,EAAO,KAAK,CAAC,QAAQ,GAAG,CAAC,AAACH,GAAQA,EAAI,IAAI,IACzB,GAAG,CAAC,AAACjF,IAGrC,GAAM,CAAC3S,EAAK,GAAGkY,EAAY,CAAGvF,EAAO,KAAK,CAAC,OAGrCwF,EAAe3W,AAAAA,GAAAA,EAAAA,EAAAA,AAAAA,EAAWxB,EAAI,IAAI,GAAI8T,GAE5C,OAAOoE,EAAY,MAAM,CAAG,EACzB,CAAC,EAAEC,EAAa,CAAC,EAAED,EAAY,IAAI,CAAC,KAAK,CAAC,CAC1CC,CACJ,GAEwB,IAAI,CAAC,KAC9B,CAQA,SAAS/T,EAAcC,CAAiB,EAKvC,OAAOC,KAJWrG,MAAM,IAAI,CAACoG,EAAO,AAACE,GACpCP,OAAO,aAAa,CAACO,IACpB,IAAI,CAAC,IAGR,CACA,IAAM2S,EAAkB,CACvB,mBACA,UACA,gBACA,gBACA,iBACA,SACA,WACA,YACA,mBACA,WACA,UACA,UACA,qCACA,gBACA,gBACA,oBACA,cACA,aACA,SACA,YACA,cACA,cACA,aACA,cACA,SACA,mBACA,YACA,UACA,UACA,UACA,aACA,UACA,YACA,YACA,aACA,UACA,SACA,eACA,mBACA,cACA,cACA,eACA,eACA,cACA,aACA,cACA,YACA,eACA,UACA,SACA,YACA,aACA,eACA,UACA,WACA,WACA,4BACA,WACA,YACA,WACA,eACA,YACA,WACA,YACA,eACA,WACA,iBACA,YACA,uBACA,6BACA,yBACA,wBACA,UACA,aACA,sBACA,uBACA,gBACA,gBACA,qBACA,cACA,kBACA,gBACA,eACA,iBACA,iBACA,gBACA,oBACA,iBACA,uBACA,mBACA,kBACA,oBACA,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OAAO,EAAE,OAAO,GAAG,IAAI,SAAS,CAAC,IAAMwK,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY,GAAG,GAAGnM,GAAG,OAAOmM,EAAE,CAAC,EAAE,IAAI7J,IAAI6J,EAAE,GAAG,QAAQ,CAAC,MAAM,AAAI6X,UAAU,kBAAkB,CAAC,IAAI,QAAQ,MAAM,AAAIA,UAAU,kBAAmB,KAAI,SAAS,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC/jB,QAAQ,KAAK,CAAC,2C,gDCA57P,IAAM,EAAe,IAAIO,IAAI,CAChC,WACA,cACA,eACA,eACA,gBACA,mBACA,WACA,UACA,gBACA,sBACA,cACA,mBACA,oBACA,oBACA,iBACA,eACA,UACA,UACA,UACA,UACA,UACA,iBACA,UACA,UACA,cACA,eACA,WACA,eACA,qBACA,cACA,SACA,eACA,gBACA,WACA,iBACA,iBACA,WACH,CAAC,GAAG,CAAC,AAAC,GAAQ,CAAC,EAAI,WAAW,GAAI,EAAI,GAC1B,EAAiB,IAAIA,IAAI,CAClC,gBACA,gBACA,gBACA,gBACA,cACA,WACA,gBACA,kBACA,WACA,cACA,WACA,oBACA,gBACA,eACA,mBACA,YACA,aACA,WACA,eACA,oBACA,eACA,cACA,cACA,mBACA,YACA,aACA,aACA,sBACA,mBACA,eACA,YACA,YACA,YACA,gBACA,sBACA,iBACA,OACA,OACA,cACA,YACA,qBACA,mBACA,mBACA,mBACA,eACA,cACA,eACA,cACA,eACA,iBACA,cACA,UACA,UACA,aACA,UACA,aACA,mBACA,mBACA,aACH,CAAC,GAAG,CAAC,AAAC,GAAQ,CAAC,EAAI,WAAW,GAAI,EAAI,E,0ECvFvC,IAAM,EAAoB,IAAIkX,IAAI,CAC9B,QACA,SACA,MACA,SACA,UACA,WACA,YACA,WACH,EACD,SAAS,EAAc,CAAK,EACxB,OAAO,EAAM,OAAO,CAAC,KAAM,SAC/B,CA+BA,IAAM,EAAY,IAAIA,IAAI,CACtB,OACA,OACA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