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a,CACpC,MAAMW,EAAY,SAAS,eAAe,GAAG/B,CAAU,WAAW,EAC7D+B,IACDD,EAAO9B,CAAU,GACT+B,EAAA,UAAU,IAAI,MAAM,EACpBA,EAAA,UAAU,OAAO,KAAK,IAEtBA,EAAA,UAAU,OAAO,MAAM,EACvBA,EAAA,UAAU,IAAI,KAAK,GAC/B,CAEI,MAAC,qBAAAC,GAAwBF,EAC/B,SAAS,eAAe,iBAAiB,EAAE,UAAYE,EAAqB,SAAS,EACtF,EAAE,MAAS,IACF,YAAI,sCAAuC,EAAE,OAAO,EAC7D,CACH,CAEA,eAAeH,IAAW,CAClB,MAAAI,EAAM,MAAM,MAAM,gBAAgB,EACxC,OAAIA,EAAI,GAAW,MAAMA,EAAI,KAAK,EACtB,CACV,qBAAsB,CACxB,CACF,CCvCO,MAAMC,GAAwB,SAAY,CAC/C,GAAI,kBAAmB,UACjB,IACI,MAAAC,EAAe,MAAM,UAAU,cAAc,SACjD,SACA,CACE,MAAO,IAEX,EACIA,EAAa,WACf,QAAQ,IAAI,2BAA2B,EAC9BA,EAAa,QACtB,QAAQ,IAAI,0BAA0B,EAC7BA,EAAa,QACtB,QAAQ,IAAI,uBAAuB,QAE9BC,EAAO,CACN,cAAM,4BAA4BA,CAAK,EAAE,EAGvD,ECVAF,GAAsB,EACtBT,GAAmB","names":["createEventEmitter","eventsEmitter","worker","host","hostname","url","m","eventName","handler","e","SPLIT_LOWER_UPPER_RE","SPLIT_UPPER_UPPER_RE","SPLIT_SEPARATE_NUMBER_RE","DEFAULT_STRIP_REGEXP","SPLIT_REPLACE_VALUE","DEFAULT_PREFIX_SUFFIX_CHARACTERS","split","value","result","start","end","splitSeparateNumbers","words","i","word","match","offset","sentenceCase","input","options","prefix","suffix","splitPrefixSuffix","lower","lowerFactory","upper","upperFactory","transform","capitalCaseTransformFactory","index","locale","splitFn","prefixCharacters","suffixCharacters","prefixIndex","suffixIndex","char","toggleSelection","selection","active","ranges","range","deselectCurrent","require$$0","clipboardToIE11Formatting","defaultMessage","format","message","copyKey","copy","text","debug","reselectPrevious","mark","success","successful","err","copyToClipboard","TOKENS","IS_SPECIAL_CASE","IS_MANUAL_CASE","ALPHANUMERIC_PATTERN","IS_ACRONYM","WORD_SEPARATORS","SENTENCE_TERMINATORS","TITLE_TERMINATORS","SMALL_WORDS","titleCase","sentenceTerminators","titleTerminators","smallWords","wordSeparators","terminators","isNewSentence","token","whiteSpace","acronym","_","upperAt","matches","isSentenceEnd","wordIndex","nextChar","nargs","stringTemplate","template","string","args","filingDescriptions","imported","formatFilingDescription","transaction","__vitePreload","f","formatString","ClipboardCopy","ExternalLink","delay","setDelay","streamPath","delayMs","createEventComponent","event","eventCardContainer","element","companyNumber","title","description","getDescription","received","originalEvent","latencyMs","copyButton","c","d","filter","filterTextBox","eventsContainer","containers","streamPaths","container","eventCount","eventCard","timeout","startStatusManager","updateHealthIndicators","initialStatus","recurringUpdate","getHealth","health","indicator","currentWsConnections","res","registerServiceWorker","registration","error"],"ignoreList":[1,2,3,4,5],"sources":["../../src/scripts/workerWrapper.ts","../../node_modules/.pnpm/change-case@5.4.4/node_modules/change-case/dist/index.js","../../node_modules/.pnpm/toggle-selection@1.0.6/node_modules/toggle-selection/index.js","../../node_modules/.pnpm/copy-to-clipboard@3.3.3/node_modules/copy-to-clipboard/index.js","../../node_modules/title-case/dist/index.js","../../node_modules/.pnpm/string-template@1.0.0/node_modules/string-template/index.js","../../src/scripts/formatFilingDescription.ts","../../src/assets/icons/ClipboardCopy.svg","../../src/assets/icons/ExternalLink.svg","../../src/scripts/latencyIndicator.ts","../../src/scripts/eventCardFactory.ts","../../src/scripts/eventManager.ts","../../src/scripts/statusManager.ts","../../src/scripts/registerServiceWorker.ts","../../src/scripts/main.ts"],"sourcesContent":["// this should be called from the main thread. it starts a worker and emits the events\r\n\r\n\r\nexport function createEventEmitter() {\r\n const eventsEmitter = new EventTarget()\r\n const worker = new Worker(new URL(\"./websocketWorker.ts\", import.meta.url), {\r\n type: \"module\"\r\n })\r\n const { host, hostname } = window.location\r\n const protocol = hostname === \"localhost\" ? \"ws\" : \"wss\"\r\n const url = `${protocol}://${host}/events`\r\n worker.postMessage({ type: \"url\", url })\r\n worker.addEventListener(\"message\", m => eventsEmitter.dispatchEvent(new CustomEvent(m.data.type, { detail: m.data.data })))\r\n return {\r\n close(){\r\n worker.postMessage({type:'close'})\r\n },\r\n start(){\r\n worker.postMessage({type:'start'})\r\n },\r\n on(eventName, handler){\r\n eventsEmitter.addEventListener(eventName, e=>handler((e).detail))\r\n },\r\n triggerStatus(){\r\n worker.postMessage({ type: \"status\" })\r\n }\r\n }\r\n}\r\n","// Regexps involved with splitting words in various case formats.\nconst SPLIT_LOWER_UPPER_RE = /([\\p{Ll}\\d])(\\p{Lu})/gu;\nconst SPLIT_UPPER_UPPER_RE = /(\\p{Lu})([\\p{Lu}][\\p{Ll}])/gu;\n// Used to iterate over the initial split result and separate numbers.\nconst SPLIT_SEPARATE_NUMBER_RE = /(\\d)\\p{Ll}|(\\p{L})\\d/u;\n// Regexp involved with stripping non-word characters from the result.\nconst DEFAULT_STRIP_REGEXP = /[^\\p{L}\\d]+/giu;\n// The replacement value for splits.\nconst SPLIT_REPLACE_VALUE = \"$1\\0$2\";\n// The default characters to keep after transforming case.\nconst DEFAULT_PREFIX_SUFFIX_CHARACTERS = \"\";\n/**\n * Split any cased input strings into an array of words.\n */\nexport function split(value) {\n let result = value.trim();\n result = result\n .replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE)\n .replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);\n result = result.replace(DEFAULT_STRIP_REGEXP, \"\\0\");\n let start = 0;\n let end = result.length;\n // Trim the delimiter from around the output string.\n while (result.charAt(start) === \"\\0\")\n start++;\n if (start === end)\n return [];\n while (result.charAt(end - 1) === \"\\0\")\n end--;\n return result.slice(start, end).split(/\\0/g);\n}\n/**\n * Split the input string into an array of words, separating numbers.\n */\nexport function splitSeparateNumbers(value) {\n const words = split(value);\n for (let i = 0; i < words.length; i++) {\n const word = words[i];\n const match = SPLIT_SEPARATE_NUMBER_RE.exec(word);\n if (match) {\n const offset = match.index + (match[1] ?? match[2]).length;\n words.splice(i, 1, word.slice(0, offset), word.slice(offset));\n }\n }\n return words;\n}\n/**\n * Convert a string to space separated lower case (`foo bar`).\n */\nexport function noCase(input, options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n return (prefix +\n words.map(lowerFactory(options?.locale)).join(options?.delimiter ?? \" \") +\n suffix);\n}\n/**\n * Convert a string to camel case (`fooBar`).\n */\nexport function camelCase(input, options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n const transform = options?.mergeAmbiguousCharacters\n ? capitalCaseTransformFactory(lower, upper)\n : pascalCaseTransformFactory(lower, upper);\n return (prefix +\n words\n .map((word, index) => {\n if (index === 0)\n return lower(word);\n return transform(word, index);\n })\n .join(options?.delimiter ?? \"\") +\n suffix);\n}\n/**\n * Convert a string to pascal case (`FooBar`).\n */\nexport function pascalCase(input, options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n const transform = options?.mergeAmbiguousCharacters\n ? capitalCaseTransformFactory(lower, upper)\n : pascalCaseTransformFactory(lower, upper);\n return prefix + words.map(transform).join(options?.delimiter ?? \"\") + suffix;\n}\n/**\n * Convert a string to pascal snake case (`Foo_Bar`).\n */\nexport function pascalSnakeCase(input, options) {\n return capitalCase(input, { delimiter: \"_\", ...options });\n}\n/**\n * Convert a string to capital case (`Foo Bar`).\n */\nexport function capitalCase(input, options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n return (prefix +\n words\n .map(capitalCaseTransformFactory(lower, upper))\n .join(options?.delimiter ?? \" \") +\n suffix);\n}\n/**\n * Convert a string to constant case (`FOO_BAR`).\n */\nexport function constantCase(input, options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n return (prefix +\n words.map(upperFactory(options?.locale)).join(options?.delimiter ?? \"_\") +\n suffix);\n}\n/**\n * Convert a string to dot case (`foo.bar`).\n */\nexport function dotCase(input, options) {\n return noCase(input, { delimiter: \".\", ...options });\n}\n/**\n * Convert a string to kebab case (`foo-bar`).\n */\nexport function kebabCase(input, options) {\n return noCase(input, { delimiter: \"-\", ...options });\n}\n/**\n * Convert a string to path case (`foo/bar`).\n */\nexport function pathCase(input, options) {\n return noCase(input, { delimiter: \"/\", ...options });\n}\n/**\n * Convert a string to path case (`Foo bar`).\n */\nexport function sentenceCase(input, options) {\n const [prefix, words, suffix] = splitPrefixSuffix(input, options);\n const lower = lowerFactory(options?.locale);\n const upper = upperFactory(options?.locale);\n const transform = capitalCaseTransformFactory(lower, upper);\n return (prefix +\n words\n .map((word, index) => {\n if (index === 0)\n return transform(word);\n return lower(word);\n })\n .join(options?.delimiter ?? \" \") +\n suffix);\n}\n/**\n * Convert a string to snake case (`foo_bar`).\n */\nexport function snakeCase(input, options) {\n return noCase(input, { delimiter: \"_\", ...options });\n}\n/**\n * Convert a string to header case (`Foo-Bar`).\n */\nexport function trainCase(input, options) {\n return capitalCase(input, { delimiter: \"-\", ...options });\n}\nfunction lowerFactory(locale) {\n return locale === false\n ? (input) => input.toLowerCase()\n : (input) => input.toLocaleLowerCase(locale);\n}\nfunction upperFactory(locale) {\n return locale === false\n ? (input) => input.toUpperCase()\n : (input) => input.toLocaleUpperCase(locale);\n}\nfunction capitalCaseTransformFactory(lower, upper) {\n return (word) => `${upper(word[0])}${lower(word.slice(1))}`;\n}\nfunction pascalCaseTransformFactory(lower, upper) {\n return (word, index) => {\n const char0 = word[0];\n const initial = index > 0 && char0 >= \"0\" && char0 <= \"9\" ? \"_\" + char0 : upper(char0);\n return initial + lower(word.slice(1));\n };\n}\nfunction splitPrefixSuffix(input, options = {}) {\n const splitFn = options.split ?? (options.separateNumbers ? splitSeparateNumbers : split);\n const prefixCharacters = options.prefixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;\n const suffixCharacters = options.suffixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;\n let prefixIndex = 0;\n let suffixIndex = input.length;\n while (prefixIndex < input.length) {\n const char = input.charAt(prefixIndex);\n if (!prefixCharacters.includes(char))\n break;\n prefixIndex++;\n }\n while (suffixIndex > prefixIndex) {\n const index = suffixIndex - 1;\n const char = input.charAt(index);\n if (!suffixCharacters.includes(char))\n break;\n suffixIndex = index;\n }\n return [\n input.slice(0, prefixIndex),\n splitFn(input.slice(prefixIndex, suffixIndex)),\n input.slice(suffixIndex),\n ];\n}\n//# sourceMappingURL=index.js.map","\nmodule.exports = function () {\n var selection = document.getSelection();\n if (!selection.rangeCount) {\n return function () {};\n }\n var active = document.activeElement;\n\n var ranges = [];\n for (var i = 0; i < selection.rangeCount; i++) {\n ranges.push(selection.getRangeAt(i));\n }\n\n switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML\n case 'INPUT':\n case 'TEXTAREA':\n active.blur();\n break;\n\n default:\n active = null;\n break;\n }\n\n selection.removeAllRanges();\n return function () {\n selection.type === 'Caret' &&\n selection.removeAllRanges();\n\n if (!selection.rangeCount) {\n ranges.forEach(function(range) {\n selection.addRange(range);\n });\n }\n\n active &&\n active.focus();\n };\n};\n","\"use strict\";\n\nvar deselectCurrent = require(\"toggle-selection\");\n\nvar clipboardToIE11Formatting = {\n \"text/plain\": \"Text\",\n \"text/html\": \"Url\",\n \"default\": \"Text\"\n}\n\nvar defaultMessage = \"Copy to clipboard: #{key}, Enter\";\n\nfunction format(message) {\n var copyKey = (/mac os x/i.test(navigator.userAgent) ? \"⌘\" : \"Ctrl\") + \"+C\";\n return message.replace(/#{\\s*key\\s*}/g, copyKey);\n}\n\nfunction copy(text, options) {\n var debug,\n message,\n reselectPrevious,\n range,\n selection,\n mark,\n success = false;\n if (!options) {\n options = {};\n }\n debug = options.debug || false;\n try {\n reselectPrevious = deselectCurrent();\n\n range = document.createRange();\n selection = document.getSelection();\n\n mark = document.createElement(\"span\");\n mark.textContent = text;\n // avoid screen readers from reading out loud the text\n mark.ariaHidden = \"true\"\n // reset user styles for span element\n mark.style.all = \"unset\";\n // prevents scrolling to the end of the page\n mark.style.position = \"fixed\";\n mark.style.top = 0;\n mark.style.clip = \"rect(0, 0, 0, 0)\";\n // used to preserve spaces and line breaks\n mark.style.whiteSpace = \"pre\";\n // do not inherit user-select (it may be `none`)\n mark.style.webkitUserSelect = \"text\";\n mark.style.MozUserSelect = \"text\";\n mark.style.msUserSelect = \"text\";\n mark.style.userSelect = \"text\";\n mark.addEventListener(\"copy\", function(e) {\n e.stopPropagation();\n if (options.format) {\n e.preventDefault();\n if (typeof e.clipboardData === \"undefined\") { // IE 11\n debug && console.warn(\"unable to use e.clipboardData\");\n debug && console.warn(\"trying IE specific stuff\");\n window.clipboardData.clearData();\n var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting[\"default\"]\n window.clipboardData.setData(format, text);\n } else { // all other browsers\n e.clipboardData.clearData();\n e.clipboardData.setData(options.format, text);\n }\n }\n if (options.onCopy) {\n e.preventDefault();\n options.onCopy(e.clipboardData);\n }\n });\n\n document.body.appendChild(mark);\n\n range.selectNodeContents(mark);\n selection.addRange(range);\n\n var successful = document.execCommand(\"copy\");\n if (!successful) {\n throw new Error(\"copy command was unsuccessful\");\n }\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using execCommand: \", err);\n debug && console.warn(\"trying IE specific stuff\");\n try {\n window.clipboardData.setData(options.format || \"text\", text);\n options.onCopy && options.onCopy(window.clipboardData);\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using clipboardData: \", err);\n debug && console.error(\"falling back to prompt\");\n message = format(\"message\" in options ? options.message : defaultMessage);\n window.prompt(message, text);\n }\n } finally {\n if (selection) {\n if (typeof selection.removeRange == \"function\") {\n selection.removeRange(range);\n } else {\n selection.removeAllRanges();\n }\n }\n\n if (mark) {\n document.body.removeChild(mark);\n }\n reselectPrevious();\n }\n\n return success;\n}\n\nmodule.exports = copy;\n","const TOKENS = /(\\S+)|(.)/g;\nconst IS_SPECIAL_CASE = /[\\.#][\\p{L}\\p{N}]/u; // #tag, example.com, etc.\nconst IS_MANUAL_CASE = /\\p{Ll}(?=[\\p{Lu}])/u; // iPhone, iOS, etc.\nconst ALPHANUMERIC_PATTERN = /[\\p{L}\\p{N}]+/gu;\nconst IS_ACRONYM = /^([^\\p{L}])*(?:\\p{L}\\.){2,}([^\\p{L}])*$/u;\nexport const WORD_SEPARATORS = new Set([\"—\", \"–\", \"-\", \"―\", \"/\"]);\nexport const SENTENCE_TERMINATORS = new Set([\".\", \"!\", \"?\"]);\nexport const TITLE_TERMINATORS = new Set([\n ...SENTENCE_TERMINATORS,\n \":\",\n '\"',\n \"'\",\n \"”\",\n]);\nexport const SMALL_WORDS = new Set([\n \"a\",\n \"an\",\n \"and\",\n \"as\",\n \"at\",\n \"because\",\n \"but\",\n \"by\",\n \"en\",\n \"for\",\n \"if\",\n \"in\",\n \"neither\",\n \"nor\",\n \"of\",\n \"on\",\n \"only\",\n \"or\",\n \"over\",\n \"per\",\n \"so\",\n \"some\",\n \"than\",\n \"that\",\n \"the\",\n \"to\",\n \"up\",\n \"upon\",\n \"v\",\n \"versus\",\n \"via\",\n \"vs\",\n \"when\",\n \"with\",\n \"without\",\n \"yet\",\n]);\nexport function titleCase(input, options = {}) {\n const { locale = undefined, sentenceCase = false, sentenceTerminators = SENTENCE_TERMINATORS, titleTerminators = TITLE_TERMINATORS, smallWords = SMALL_WORDS, wordSeparators = WORD_SEPARATORS, } = typeof options === \"string\" || Array.isArray(options)\n ? { locale: options }\n : options;\n const terminators = sentenceCase ? sentenceTerminators : titleTerminators;\n let result = \"\";\n let isNewSentence = true;\n // tslint:disable-next-line\n for (const m of input.matchAll(TOKENS)) {\n const { 1: token, 2: whiteSpace, index = 0 } = m;\n if (whiteSpace) {\n result += whiteSpace;\n continue;\n }\n // Ignore URLs, email addresses, acronyms, etc.\n if (IS_SPECIAL_CASE.test(token)) {\n const acronym = token.match(IS_ACRONYM);\n // The period at the end of an acronym is not a new sentence,\n // but we should uppercase first for i.e., e.g., etc.\n if (acronym) {\n const [_, prefix = \"\", suffix = \"\"] = acronym;\n result +=\n sentenceCase && !isNewSentence\n ? token\n : upperAt(token, prefix.length, locale);\n isNewSentence = terminators.has(suffix.charAt(0));\n continue;\n }\n result += token;\n isNewSentence = terminators.has(token.charAt(token.length - 1));\n }\n else {\n const matches = Array.from(token.matchAll(ALPHANUMERIC_PATTERN));\n let value = token;\n let isSentenceEnd = false;\n for (let i = 0; i < matches.length; i++) {\n const { 0: word, index: wordIndex = 0 } = matches[i];\n const nextChar = token.charAt(wordIndex + word.length);\n isSentenceEnd = terminators.has(nextChar);\n // Always the capitalize first word and reset \"new sentence\".\n if (isNewSentence) {\n isNewSentence = false;\n }\n // Skip capitalizing all words if sentence case is enabled.\n else if (sentenceCase || IS_MANUAL_CASE.test(word)) {\n continue;\n }\n // Handle simple words.\n else if (matches.length === 1) {\n // Avoid capitalizing small words, except at the end of a sentence.\n if (smallWords.has(word)) {\n const isFinalToken = index + token.length === input.length;\n if (!isFinalToken && !isSentenceEnd) {\n continue;\n }\n }\n }\n // Multi-word tokens need to be parsed differently.\n else if (i > 0) {\n // Avoid capitalizing words without a valid word separator,\n // e.g. \"apple's\" or \"test(ing)\".\n if (!wordSeparators.has(token.charAt(wordIndex - 1))) {\n continue;\n }\n // Ignore small words in the middle of hyphenated words.\n if (smallWords.has(word) && wordSeparators.has(nextChar)) {\n continue;\n }\n }\n value = upperAt(value, wordIndex, locale);\n }\n result += value;\n isNewSentence =\n isSentenceEnd || terminators.has(token.charAt(token.length - 1));\n }\n }\n return result;\n}\nfunction upperAt(input, index, locale) {\n return (input.slice(0, index) +\n input.charAt(index).toLocaleUpperCase(locale) +\n input.slice(index + 1));\n}\n//# sourceMappingURL=index.js.map","var nargs = /\\{([0-9a-zA-Z_]+)\\}/g\n\nmodule.exports = template\n\nfunction template(string) {\n var args\n\n if (arguments.length === 2 && typeof arguments[1] === \"object\") {\n args = arguments[1]\n } else {\n args = new Array(arguments.length - 1)\n for (var i = 1; i < arguments.length; ++i) {\n args[i - 1] = arguments[i]\n }\n }\n\n if (!args || !args.hasOwnProperty) {\n args = {}\n }\n\n return string.replace(nargs, function replaceArg(match, i, index) {\n var result\n\n if (string[index - 1] === \"{\" &&\n string[index + match.length] === \"}\") {\n return i\n } else {\n result = args.hasOwnProperty(i) ? args[i] : null\n if (result === null || result === undefined) {\n return \"\"\n }\n\n return result\n }\n })\n}\n","import formatString from 'string-template'\r\n\r\nlet filingDescriptions // dynamically import massive JSON document\r\nlet imported = false\r\nexport function formatFilingDescription(transaction){\r\n if(!filingDescriptions && !imported){\r\n imported = true\r\n import('../assets/filingDescriptions.json').then(f=>filingDescriptions = f.default)\r\n }\r\n //todo: format dates properly and add currency to end for statement-of-capital\r\n if(filingDescriptions && transaction.description in filingDescriptions)\r\n return formatString(filingDescriptions[transaction.description], transaction.description_values)\r\n else if(transaction.description === 'legacy') return transaction.description_values?.description ?? transaction.description\r\n else{\r\n if (filingDescriptions) console.warn({ transaction }, \"Filing description not found for \" + transaction.description)\r\n return transaction.description\r\n }\r\n}\r\n","export default \"data:image/svg+xml,%3csvg%20width='15'%20height='15'%20viewBox='0%200%2015%2015'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5%202V1H10V2H5ZM4.75%200C4.33579%200%204%200.335786%204%200.75V1H3.5C2.67157%201%202%201.67157%202%202.5V12.5C2%2013.3284%202.67157%2014%203.5%2014H7V13H3.5C3.22386%2013%203%2012.7761%203%2012.5V2.5C3%202.22386%203.22386%202%203.5%202H4V2.25C4%202.66421%204.33579%203%204.75%203H10.25C10.6642%203%2011%202.66421%2011%202.25V2H11.5C11.7761%202%2012%202.22386%2012%202.5V7H13V2.5C13%201.67157%2012.3284%201%2011.5%201H11V0.75C11%200.335786%2010.6642%200%2010.25%200H4.75ZM9%208.5C9%208.77614%208.77614%209%208.5%209C8.22386%209%208%208.77614%208%208.5C8%208.22386%208.22386%208%208.5%208C8.77614%208%209%208.22386%209%208.5ZM10.5%209C10.7761%209%2011%208.77614%2011%208.5C11%208.22386%2010.7761%208%2010.5%208C10.2239%208%2010%208.22386%2010%208.5C10%208.77614%2010.2239%209%2010.5%209ZM13%208.5C13%208.77614%2012.7761%209%2012.5%209C12.2239%209%2012%208.77614%2012%208.5C12%208.22386%2012.2239%208%2012.5%208C12.7761%208%2013%208.22386%2013%208.5ZM14.5%209C14.7761%209%2015%208.77614%2015%208.5C15%208.22386%2014.7761%208%2014.5%208C14.2239%208%2014%208.22386%2014%208.5C14%208.77614%2014.2239%209%2014.5%209ZM15%2010.5C15%2010.7761%2014.7761%2011%2014.5%2011C14.2239%2011%2014%2010.7761%2014%2010.5C14%2010.2239%2014.2239%2010%2014.5%2010C14.7761%2010%2015%2010.2239%2015%2010.5ZM14.5%2013C14.7761%2013%2015%2012.7761%2015%2012.5C15%2012.2239%2014.7761%2012%2014.5%2012C14.2239%2012%2014%2012.2239%2014%2012.5C14%2012.7761%2014.2239%2013%2014.5%2013ZM14.5%2015C14.7761%2015%2015%2014.7761%2015%2014.5C15%2014.2239%2014.7761%2014%2014.5%2014C14.2239%2014%2014%2014.2239%2014%2014.5C14%2014.7761%2014.2239%2015%2014.5%2015ZM8.5%2011C8.77614%2011%209%2010.7761%209%2010.5C9%2010.2239%208.77614%2010%208.5%2010C8.22386%2010%208%2010.2239%208%2010.5C8%2010.7761%208.22386%2011%208.5%2011ZM9%2012.5C9%2012.7761%208.77614%2013%208.5%2013C8.22386%2013%208%2012.7761%208%2012.5C8%2012.2239%208.22386%2012%208.5%2012C8.77614%2012%209%2012.2239%209%2012.5ZM8.5%2015C8.77614%2015%209%2014.7761%209%2014.5C9%2014.2239%208.77614%2014%208.5%2014C8.22386%2014%208%2014.2239%208%2014.5C8%2014.7761%208.22386%2015%208.5%2015ZM11%2014.5C11%2014.7761%2010.7761%2015%2010.5%2015C10.2239%2015%2010%2014.7761%2010%2014.5C10%2014.2239%2010.2239%2014%2010.5%2014C10.7761%2014%2011%2014.2239%2011%2014.5ZM12.5%2015C12.7761%2015%2013%2014.7761%2013%2014.5C13%2014.2239%2012.7761%2014%2012.5%2014C12.2239%2014%2012%2014.2239%2012%2014.5C12%2014.7761%2012.2239%2015%2012.5%2015Z'%20fill='currentColor'%20fill-rule='evenodd'%20clip-rule='evenodd'%3e%3c/path%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20width='15'%20height='15'%20viewBox='0%200%2015%2015'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3%202C2.44772%202%202%202.44772%202%203V12C2%2012.5523%202.44772%2013%203%2013H12C12.5523%2013%2013%2012.5523%2013%2012V8.5C13%208.22386%2012.7761%208%2012.5%208C12.2239%208%2012%208.22386%2012%208.5V12H3V3L6.5%203C6.77614%203%207%202.77614%207%202.5C7%202.22386%206.77614%202%206.5%202H3ZM12.8536%202.14645C12.9015%202.19439%2012.9377%202.24964%2012.9621%202.30861C12.9861%202.36669%2012.9996%202.4303%2013%202.497L13%202.5V2.50049V5.5C13%205.77614%2012.7761%206%2012.5%206C12.2239%206%2012%205.77614%2012%205.5V3.70711L6.85355%208.85355C6.65829%209.04882%206.34171%209.04882%206.14645%208.85355C5.95118%208.65829%205.95118%208.34171%206.14645%208.14645L11.2929%203H9.5C9.22386%203%209%202.77614%209%202.5C9%202.22386%209.22386%202%209.5%202H12.4999H12.5C12.5678%202%2012.6324%202.01349%2012.6914%202.03794C12.7504%202.06234%2012.8056%202.09851%2012.8536%202.14645Z'%20fill='currentColor'%20fill-rule='evenodd'%20clip-rule='evenodd'%3e%3c/path%3e%3c/svg%3e\"","\r\nexport let latency: number\r\nexport function setLatency(latencyMs: number){\r\n latency = latencyMs\r\n document.getElementById('latency').innerText = latency.toFixed(1) + 'ms'\r\n}\r\n\r\nexport let delay: number\r\nexport function setDelay(streamPath: string, delayMs: number){\r\n delay = delayMs\r\n document.getElementById(`delay-${streamPath}`).innerText = `${delay.toFixed(1)} min delay`\r\n}\r\n","import copy from \"copy-to-clipboard\"\r\nimport { sentenceCase } from \"change-case\"\r\nimport { titleCase } from \"title-case\"\r\nimport { formatFilingDescription } from \"./formatFilingDescription\"\r\nimport ClipboardCopy from \"../assets/icons/ClipboardCopy.svg\"\r\nimport ExternalLink from \"../assets/icons/ExternalLink.svg\"\r\nimport formatString from \"string-template\"\r\nimport { setDelay, setLatency } from \"./latencyIndicator\"\r\n\r\nexport function createEventComponent(event) {\r\n const eventCardContainer = document.createElement(\"div\")\r\n eventCardContainer.className = `event-card-container`\r\n const element = document.createElement(\"div\")\r\n element.className = `event-card ${event.streamPath}`\r\n eventCardContainer.appendChild(element)\r\n try {\r\n const { companyNumber, title, description } = getDescription(event)\r\n element.innerHTML = `\r\n

${title ?? (sentenceCase(event.streamPath) + \"event\")}

\r\n

${description ?? \"\"}

\r\n ${new Date(event.event.published_at).toLocaleTimeString()}\r\n ${companyNumber}\"External\r\n `\r\n // A button which copys the company number on click rather than a link to companies house\r\n // const companyNumberButton = document.createElement(\"code\")\r\n // companyNumberButton.onclick = () => copy(companyNumber)\r\n // companyNumberButton.innerText = companyNumber\r\n // element.appendChild(companyNumberButton)\r\n\r\n const { received, streamPath, ...originalEvent } = event\r\n const latencyMs = performance.timeOrigin + performance.now() - received\r\n // this has been disabled due to the difference in system clocks causing inaccurate latencies (including negative).\r\n // setLatency(latencyMs)\r\n const delay = (Date.now() - new Date(event.event.published_at).getTime()) / 60_000\r\n setDelay(streamPath, delay)\r\n const copyButton = document.createElement(\"button\")\r\n copyButton.onclick = () => copy(JSON.stringify(originalEvent))\r\n copyButton.innerHTML = `\"Copy JSON`\r\n element.appendChild(copyButton)\r\n } catch (e) {\r\n console.log(\"Error creating event card: \", e.message)\r\n element.innerHTML = e.message\r\n }\r\n return eventCardContainer\r\n}\r\n\r\n\r\nexport function getDescription(event) {\r\n switch (event.streamPath) {\r\n case \"companies\":\r\n return {\r\n companyNumber: event.data.company_number,\r\n description: \"\",\r\n title: `${titleCase(event.data.company_name.toLowerCase())}`\r\n }\r\n case \"filings\": {\r\n const [, companyNumber] = event.resource_uri.match(/^\\/company\\/([A-Z0-9]{8})\\/filing-history/)\r\n return {\r\n companyNumber,\r\n description: formatFilingDescription(event.data),\r\n title: sentenceCase(event.data.category ?? \"New\") + \" filing\"\r\n }\r\n }\r\n case \"officers\": {\r\n const [, companyNumber] = event.resource_uri.match(/^\\/company\\/([A-Z0-9]{8})\\/appointments/)\r\n const description = \"resigned_on\" in event.data ? `Resigned on ${event.data.resigned_on}` : `Appointed on ${event.data.appointed_on}`\r\n return { companyNumber, description, title: titleCase(event.data.name.toLowerCase()) }\r\n }\r\n case \"persons-with-significant-control\": {\r\n const [, companyNumber] = event.resource_uri.match(\r\n /^\\/company\\/([A-Z0-9]{6,8})\\/persons-with-significant-control/\r\n )\r\n const description = \"ceased_on\" in event.data ? `Ceased on ${event.data.ceased_on}` : `Notified on ${event.data.notified_on}`\r\n return { companyNumber, description, title: event.data.name }\r\n }\r\n case \"charges\": {\r\n const [, companyNumber] = event.resource_uri.match(/^\\/company\\/([A-Z0-9]{8})\\/charges/)\r\n return {\r\n companyNumber,\r\n description: event.data.particulars?.description,\r\n title: event.data.classification.description\r\n }\r\n }\r\n case \"insolvency-cases\":\r\n return {\r\n companyNumber: event.resource_id,\r\n description: event.data.cases.map(c => sentenceCase(c.type)).join(\", \"),\r\n title: \"Insolvency\"\r\n }\r\n case \"disqualified-officers\":\r\n const descriptionFormat = \"Disqualified from {companies}\"\r\n const description = formatString(descriptionFormat, { companies: event.data.disqualifications?.flatMap(d => d.company_names).join(\", \") })\r\n const titleFormat = \"{forename} {other_forenames} {surname}\"\r\n const title = formatString(titleFormat, event.data)\r\n return { companyNumber: \"\", description, title }\r\n case \"persons-with-significant-control-statements\": {\r\n //TODO: write actual description for PSC statement using pscDescriptions.json file\r\n const [, companyNumber] = event.resource_uri.match(/^\\/company\\/([A-Z0-9]{8})\\//)\r\n return {\r\n companyNumber,\r\n description: `PSC statement descriptions not yet developed`,\r\n title: titleCase(event.data.linked_psc_name)\r\n }\r\n }\r\n case \"company-exemptions\": {\r\n //TODO: write actual description for exemptions using https://github.com/companieshouse/api-enumerations/blob/master/exemption_descriptions.yml\r\n const [, companyNumber] = event.resource_uri.match(/company\\/([A-Z0-9]{8})\\/exemptions/)\r\n return {\r\n companyNumber,\r\n description: `Company exemptions descriptions not yet developed`,\r\n title: titleCase(event.data.linked_psc_name)\r\n }\r\n }\r\n default:\r\n return { companyNumber: \"\", description: `No description available`, title: titleCase(event.streamPath) }\r\n }\r\n}\r\n\r\n","import \"../styles/events.scss\"\r\nimport { createEventEmitter } from \"./workerWrapper\"\r\nimport { sentenceCase } from \"change-case\"\r\nimport { createEventComponent, getDescription } from \"./eventCardFactory\"\r\nimport { streamPaths } from \"./streamPaths\"\r\n\r\nlet filter = \"\"\r\nconst filterTextBox = document.getElementById(\"filter-text\") as HTMLInputElement\r\nfilterTextBox?.addEventListener(\"keyup\", e => {\r\n // if(filterTextBox?.value.length === 8) // must be 8 character company number\r\n filter = filterTextBox?.value ?? \"\"\r\n // else filter = ''\r\n})\r\n\r\n/* Create a column for each stream */\r\nconst eventsContainer = document.getElementById(\"events\")\r\nconst containers = {}\r\nfor (const streamPath of streamPaths) {\r\n //TODO: add an option for the user to combine some columns: [officers, disqualified officers] [psc, psc statements, exemptions]\r\n const container = document.createElement(\"div\")\r\n container.id = `${streamPath}-container`\r\n container.className = \"event-column\"\r\n container.innerHTML = `\r\n
\r\n

${sentenceCase(streamPath)} \r\n \r\n

\r\n \r\n /${streamPath}\r\n
\r\n
`\r\n eventsContainer.appendChild(container)\r\n containers[streamPath] = container.lastElementChild\r\n}\r\n\r\n\r\n/* Get events from web worker that listens to websocket */\r\nlet eventCount = 0\r\nconst eventsEmitter = createEventEmitter()\r\neventsEmitter.on(\"event\", event => {\r\n document.getElementById(\"notification-counter\").innerText = (++eventCount).toString()\r\n const { companyNumber } = getDescription(event)\r\n // add events if browser is not visible only if the filter is set to a company number\r\n if (document.visibilityState === \"visible\" || filter.length === 8) {\r\n if (companyNumber.includes(filter)) {\r\n const eventCard = createEventComponent(event)\r\n containers[event.streamPath].insertAdjacentElement(\"afterbegin\", eventCard)\r\n const timeout = (filter.length + 0.5) * 30_000\r\n setTimeout(() => {\r\n // remove after some time depending on how specific the filter is\r\n containers[event.streamPath].removeChild(eventCard)\r\n }, timeout)\r\n }\r\n }\r\n})\r\n\r\neventsEmitter.on(\"connected\", () => {\r\n document.getElementById(\"connection-indicator\").className = \"connected indicator\"\r\n document.getElementById(\"connection-button\").onclick = () => eventsEmitter.close()\r\n document.getElementById(\"connection-button\").innerText = \"Disconnect\"\r\n})\r\neventsEmitter.on(\"disconnected\", () => {\r\n document.getElementById(\"connection-indicator\").className = \"disconnected indicator\"\r\n document.getElementById(\"connection-button\").onclick = () => eventsEmitter.start()\r\n document.getElementById(\"connection-button\").innerText = \"Connect\"\r\n})\r\n\r\n// start the first connection\r\ndocument.getElementById(\"connection-button\").onclick = () => eventsEmitter.start()\r\neventsEmitter.start()\r\n","import { streamPaths } from \"./streamPaths.js\"\r\n\r\n/** returns cleanup function that kills the status manager */\r\nexport function startStatusManager() {\r\n updateHealthIndicators()\r\n const initialStatus = setTimeout(updateHealthIndicators, 500) // another status update after 500ms to update users online count\r\n const recurringUpdate = setInterval(updateHealthIndicators, 5000)\r\n return () => {\r\n clearTimeout(initialStatus)\r\n clearInterval(recurringUpdate)\r\n }\r\n}\r\n\r\n\r\nfunction updateHealthIndicators(){\r\n getHealth().then(health=>{\r\n for (const streamPath of streamPaths) {\r\n const indicator = document.getElementById(`${streamPath}-upstream`)\r\n if (!indicator) continue\r\n if (health[streamPath]) {\r\n indicator.classList.add(\"good\")\r\n indicator.classList.remove(\"bad\")\r\n } else {\r\n indicator.classList.remove(\"good\")\r\n indicator.classList.add(\"bad\")\r\n }\r\n }\r\n const {currentWsConnections} = health\r\n document.getElementById('open-websockets').innerText = currentWsConnections.toString()\r\n }).catch(e=>{\r\n console.log('Health indicators failed to update:', e.message)\r\n })\r\n}\r\n\r\nasync function getHealth(){\r\n const res = await fetch(\"/events/health\")\r\n if (res.ok) return await res.json()\r\n else return {\r\n currentWsConnections: 1\r\n }\r\n}\r\n","\r\nexport const registerServiceWorker = async () => {\r\n if ('serviceWorker' in navigator) {\r\n try {\r\n const registration = await navigator.serviceWorker.register(\r\n '/sw.js',\r\n {\r\n scope: '/',\r\n }\r\n );\r\n if (registration.installing) {\r\n console.log('Service worker installing');\r\n } else if (registration.waiting) {\r\n console.log('Service worker installed');\r\n } else if (registration.active) {\r\n console.log('Service worker active');\r\n }\r\n } catch (error) {\r\n console.error(`Registration failed with ${error}`);\r\n }\r\n }\r\n};\r\n","/* import global styles */\r\nimport '../styles/indicators.css'\r\nimport '../styles/layout.css'\r\nimport '../styles/header.scss'\r\nimport '../styles/main.css'\r\n\r\n/* import scripts */\r\nimport './eventManager'\r\nimport { startStatusManager } from \"./statusManager\"\r\nimport { registerServiceWorker } from \"./registerServiceWorker\"\r\n\r\nregisterServiceWorker()\r\nstartStatusManager()\r\n"],"file":"assets/index-CcCNngcq.js"}