{ "version": 3, "sources": ["../../../../../../../../source/febe/ui/src/scripts/report_modules/report-tools.ts", "../../../../../../../../source/febe/ui/src/scripts/report_modules/moderation.ts"], "sourcesContent": ["import { Modal } from \"../components/Modal\";\nimport { Hatch } from \"../classes/Hatch.js\";\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n initSampleDownload();\n initPCAPDownload();\n initPCAPNGDownload();\n\n function initSampleDownload() {\n if (document.querySelector(\"#download_sample\")) {\n document.querySelector(\"#download_sample\").addEventListener(\"click\", () => {\n if (globalThis.user) {\n let template = Hatch`\n
Please be advised that the content you are about to access may include objectionable content, malware, illicit material, or other information not under the control of Hatching, a Recorded Future company. Further, by accessing the sample, you and your organization agree that:
\nDownloading any samples, there is a potential for exposure to malware and other harmful scripts, trojans cookies and malicious files and ransomware that may exfiltrate information or otherwise cause damage.
\nSamples may contain illicit content or content related to criminal activity, including but not limited to ransomware, extortion, physical harm, and possibly child exploitation. You bear any and all legal responsibility for engaging, accessing, or transferring this content. You also bear any and all legal responsibility to report any offending content to law enforcement or elsewhere.
\nthe password is infected
\n \n `;\n\n new Modal({\n body: template,\n });\n } else {\n nonUser();\n }\n });\n }\n }\n\n function initPCAPDownload() {\n if (document.querySelector(\"#download_pcap\")) {\n document.querySelector(\"#download_pcap\").addEventListener(\"click\", () => {\n if (globalThis.user) {\n download(`/samples/${globalThis.page_data.sample.id}/${globalThis.page_data.task.id}/dump.pcap`, `dump.pcap`);\n } else {\n nonUser();\n }\n });\n }\n }\n\n function initPCAPNGDownload() {\n if (document.querySelector(\"#download_pcapng\")) {\n document.querySelector(\"#download_pcapng\").addEventListener(\"click\", () => {\n if (globalThis.user) {\n download(\n `/samples/${globalThis.page_data.sample.id}/${globalThis.page_data.task.id}/dump.pcapng`,\n `dump.pcapng`\n );\n } else {\n nonUser();\n }\n });\n }\n }\n\n function nonUser() {\n const { pathname, origin } = document.location;\n let url = new URL(\"/login\", origin);\n url.searchParams.set(\"return_to\", pathname);\n let template = Hatch`\nThis feature is currently only available for registered users.
\n \n `;\n\n new Modal({\n body: template,\n });\n }\n\n function download(dataurl: string, filename: string) {\n var a = document.createElement(\"a\");\n a.href = dataurl;\n a.setAttribute(\"download\", filename);\n a.click();\n }\n});\n", "import { FormModal } from \"../components/Modal\";\nimport { Hatch } from \"../classes/Hatch\";\ndocument.querySelector(\"#delete-sample\")?.addEventListener(\"click\", () => {\n new FormModal({\n body: Hatch`\nAre you sure you want to delete this analysis? This cannot be undone.
\n \n `,\n action: `/samples/${globalThis.page_data.sample.id}/delete`,\n });\n});\n\ndocument.querySelector(\"#ban-user\")?.addEventListener(\"click\", () => {\n new FormModal({\n body: Hatch`\nAre you sure you want to ban this user?
\n \n `,\n action: `/samples/${globalThis.page_data.sample.id}/ban_user`,\n });\n});\n\ndocument.querySelector(\"#unban-user\")?.addEventListener(\"click\", () => {\n new FormModal({\n body: Hatch`\nAre you admitting we made a mistake?
\n \n `,\n action: `/samples/${globalThis.page_data.sample.id}/unban_user`,\n });\n});\n"], "mappings": "sDAGA,SAAS,iBAAiB,mBAAoB,IAAM,CAClDA,EAAmB,EACnBC,EAAiB,EACjBC,EAAmB,EAEnB,SAASF,GAAqB,CACxB,SAAS,cAAc,kBAAkB,GAC3C,SAAS,cAAc,kBAAkB,EAAE,iBAAiB,QAAS,IAAM,CACzE,GAAI,WAAW,KAAM,CACnB,IAAIG,EAAWC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6EAOoD,WAAW,UAAU,OAAO;AAAA;AAAA,YAI/F,IAAIC,EAAM,CACR,KAAMF,CACR,CAAC,CACH,MACEG,EAAQ,CAEZ,CAAC,CAEL,CAEA,SAASL,GAAmB,CACtB,SAAS,cAAc,gBAAgB,GACzC,SAAS,cAAc,gBAAgB,EAAE,iBAAiB,QAAS,IAAM,CACnE,WAAW,KACbM,EAAS,YAAY,WAAW,UAAU,OAAO,MAAM,WAAW,UAAU,KAAK,eAAgB,WAAW,EAE5GD,EAAQ,CAEZ,CAAC,CAEL,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AAA,gBAON,OAAQ,YAAY,WAAW,UAAU,OAAO,eAClD,CAAC,CACH", "names": ["initSampleDownload", "initPCAPDownload", "initPCAPNGDownload", "template", "Hatch", "Modal", "nonUser", "download", "pathname", "origin", "url", "dataurl", "filename", "_a", "FormModal", "Hatch"] }