>}\r\n */\n\n\n VisualDescriptor.prototype.resizeVisual = function (width, height) {\n return __awaiter(this, void 0, void 0, function () {\n var pageName, visualName, report;\n return __generator(this, function (_a) {\n pageName = this.page.name;\n visualName = this.name;\n report = this.page.report;\n return [2\n /*return*/\n , report.resizeVisual(pageName, visualName, width, height)];\n });\n });\n };\n\n return VisualDescriptor;\n }();\n\n exports.VisualDescriptor = VisualDescriptor;\n /***/\n }\n /******/\n\n })\n );\n});","jQuery(document).on(\"turbolinks:load\", function () {\r\n if (document.querySelector(\"#category_id\")) {\r\n document.querySelector(\"#category_id\").addEventListener(\"change\", () => {\r\n getSeverity(\r\n jQuery(\"#category_id\").val(),\r\n jQuery(\"#organization_id\").val()\r\n );\r\n });\r\n }\r\n if (document.querySelector(\"#origin_from\")) {\r\n document.querySelector(\"#origin_from\").addEventListener(\"change\", () => {\r\n if (document.querySelector(\"#protocol_number\")) {\r\n if (document.querySelector(\"#origin_from\").value == 4) {\r\n document.querySelector(\"#protocol_number\").disabled = false;\r\n } else {\r\n document.querySelector(\"#protocol_number\").disabled = true;\r\n }\r\n }\r\n });\r\n }\r\n\r\n if (document.querySelector(\"#organization\")) {\r\n document.querySelector(\"#organization\").addEventListener(\"change\", () => {\r\n document.querySelector(\"#search_form\").submit();\r\n });\r\n }\r\n});\r\n\r\nfunction getSeverity(category_id, organization_id) {\r\n jQuery.ajax({\r\n url: \"category_severity\",\r\n data: {\r\n category_id: category_id,\r\n organization_id: organization_id,\r\n },\r\n success: function (data) {\r\n jQuery(\"#severity\").val(data.severity);\r\n },\r\n error: function (data) {\r\n jQuery(\"#severity\").val(\"low\");\r\n },\r\n dataType: \"json\",\r\n });\r\n}\r\n","jQuery( document ).on('turbolinks:load', function() {\r\n if (document.querySelector('#denunciation_group')) {\r\n getUsersByGroup();\r\n document.querySelector('#denunciation_group').addEventListener('change', () => {\r\n getUsersByGroup();\r\n });\r\n }\r\n});\r\n\r\nfunction getUsersByGroup() {\r\n jQuery.ajax({\r\n url: \"users_by_group\",\r\n data: {\r\n group_id : $('#denunciation_group').val(),\r\n tenant_name: $('#tenant_name').val()\r\n },\r\n success: function(data) {\r\n var users = JSON.parse(data);\r\n var userList = '';\r\n document.querySelector('#user_list').innerHTML = ''\r\n if(users!=undefined){\r\n users.forEach(element => {\r\n userList = userList.concat(``)\r\n });\r\n document.querySelector('#user_list').innerHTML = userList;\r\n }\r\n },\r\n dataType: \"script\"\r\n });\r\n}\r\n","jQuery(document).on(\"turbolinks:load\", function () {\r\n jQuery(\"#is_identified_yes\").click(function () {\r\n cancelAnonymous();\r\n });\r\n\r\n jQuery(\"#is_identified_yes_modal\").click(function () {\r\n cancelAnonymous();\r\n });\r\n\r\n jQuery(\"#is_identified_no_modal\").click(function () {\r\n jQuery(\".is-identified\").addClass(\"not-identified\");\r\n jQuery(\".is-identified\").removeClass(\"is-identified\");\r\n\r\n jQuery(\"#is_identified_no\").addClass(\"active\");\r\n jQuery(\"#is_identified_yes\").removeClass(\"active\");\r\n });\r\n\r\n var input = document.querySelector(\".intl-tel-input\");\r\n\r\n if (input) {\r\n window.intlTelInput(input, {\r\n initialCountry: \"BR\",\r\n separateDialCode: true,\r\n preferredCountries: [\"BR\"],\r\n });\r\n\r\n input.value = input.value.replace(\" \", \"\").replace(\"-\", \"\");\r\n }\r\n\r\n if (document.querySelector(\"#denunciation_category_id\")) {\r\n document\r\n .querySelector(\"#denunciation_category_id\")\r\n .addEventListener(\"change\", () => {\r\n getEditCategorySeverity(jQuery(\"#denunciation_category_id\").val());\r\n });\r\n }\r\n});\r\n\r\ndocument.addEventListener(\"turbolinks:load\", () => {\r\n let yes_btn = document.querySelector(\".is_identified_no\");\r\n if (yes_btn) {\r\n yes_btn.addEventListener(\"click\", () => {\r\n document.querySelector(\r\n \"#denunciation_is_identified_true\"\r\n ).checked = false;\r\n document.querySelector(\r\n \"#denunciation_is_identified_false\"\r\n ).checked = true;\r\n });\r\n\r\n document\r\n .querySelector(\".is_identified_yes\")\r\n .addEventListener(\"click\", () => {\r\n document.querySelector(\r\n \"#denunciation_is_identified_true\"\r\n ).checked = true;\r\n document.querySelector(\r\n \"#denunciation_is_identified_false\"\r\n ).checked = false;\r\n });\r\n }\r\n});\r\n\r\nfunction cancelAnonymous() {\r\n jQuery(\".not-identified\").addClass(\"is-identified\");\r\n jQuery(\".not-identified\").removeClass(\"not-identified\");\r\n\r\n jQuery(\"#is_identified_no\").removeClass(\"active\");\r\n jQuery(\"#is_identified_yes\").addClass(\"active\");\r\n}\r\n\r\nfunction getEditCategorySeverity(category_id) {\r\n jQuery.ajax({\r\n url: \"category_severity\",\r\n data: {\r\n category_id: category_id,\r\n },\r\n success: function (data) {\r\n jQuery(\"#denunciation_severity\").val(data.severity);\r\n },\r\n error: function (data) {\r\n jQuery(\"#denunciation_severity\").val(\"0\");\r\n },\r\n dataType: \"json\",\r\n });\r\n}\r\n","jQuery(document).on(\"turbolinks:load\", () => {\r\n let headings = document.querySelectorAll(\"h4.denunciation-heading\");\r\n let menu = document.querySelector(\"#denunciation-menu\");\r\n\r\n if (!menu) {\r\n return;\r\n }\r\n\r\n headings.forEach((item, i) => {\r\n let text = item.textContent;\r\n item.setAttribute(\"id\", `h4-${i}`);\r\n let listItem = document.createElement(\"li\");\r\n let anchorTag = document.createElement(\"a\");\r\n menu.appendChild(listItem);\r\n anchorTag.text = text;\r\n anchorTag.setAttribute(\"href\", `#${item.getAttribute(\"id\")}`);\r\n listItem.appendChild(anchorTag);\r\n });\r\n\r\n prepareFixedMenu();\r\n\r\n let scrollButton = document.querySelector(\".btn-scroll-top\");\r\n\r\n if (scrollButton) {\r\n let topAttribute = Number.parseInt(getComputedStyle(scrollButton).top);\r\n window.addEventListener(\"scroll\", () => {\r\n\r\n if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {\r\n scrollButton.style.display = \"flex\";\r\n } else {\r\n scrollButton.style.display = \"none\";\r\n }\r\n\r\n let newTopAttribute = window.scrollY + topAttribute;\r\n scrollButton.style.top = `${newTopAttribute}px`;\r\n });\r\n\r\n scrollButton.addEventListener(\"click\", () => {\r\n document.body.scrollTop = 0;\r\n document.documentElement.scrollTop = 0;\r\n });\r\n }\r\n});\r\n\r\n\r\nfunction prepareFixedMenu() {\r\n let denunciationMenu = document.querySelector(\".denunciation-menu\");\r\n let fixedMenuDiv = document.querySelector(\"nav.denunciation-menu div.position-fixed\");\r\n \r\n if (!denunciationMenu || !fixedMenuDiv) {\r\n return;\r\n }\r\n\r\n fixedMenuDiv.style.width = getComputedStyle(denunciationMenu).width;\r\n}\r\n","jQuery(document).on(\"turbolinks:load\", function () {\r\n jQuery(\"div[data-link]\").click(function () {\r\n window.location = this.dataset.link;\r\n });\r\n if (document.querySelector(\"#defaultModal\")) {\r\n jQuery(\"#defaultModal\").modal(\"show\");\r\n }\r\n jQuery(\".first-button\").on(\"click\", function () {\r\n jQuery(\".animated-icon1\").toggleClass(\"open\");\r\n });\r\n\r\n jQuery(\"#index_filter\").click(() => {\r\n jQuery(\"#filters\").toggleClass(\"d-none\");\r\n });\r\n\r\n jQuery(\"#close-filters\").click(() => {\r\n jQuery(\"#filters\").toggleClass(\"d-none\");\r\n });\r\n\r\n jQuery(\"#clean-filters\").click(() => {\r\n cleanFilters();\r\n });\r\n\r\n let filterInputs = document.querySelectorAll(\".filter\");\r\n\r\n if (filterInputs) {\r\n filterInputs.forEach((input) => {\r\n input.addEventListener(\"change\", () => {\r\n countFilters();\r\n });\r\n });\r\n }\r\n\r\n countFilters();\r\n prepareScrollButton();\r\n});\r\n\r\nfunction countFilters() {\r\n let count = 0;\r\n const filterInputs = document.querySelectorAll(\".filter\");\r\n if (filterInputs) {\r\n filterInputs.forEach((input) => {\r\n if (input.value !== \"\") {\r\n count++;\r\n input.parentElement.firstElementChild.classList.add(\"active-filter\");\r\n } else {\r\n input.parentElement.firstElementChild.classList.remove(\"active-filter\");\r\n }\r\n });\r\n }\r\n\r\n const filterCount = document.querySelector(\"#filter_count\");\r\n const secondaryFilterCount = document.querySelector(\"#filter_secondary_count\");\r\n\r\n if (filterCount && count > 0) {\r\n filterCount.innerHTML = count;\r\n filterCount.classList.remove(\"d-none\");\r\n } else if (filterCount) {\r\n filterCount.classList.add(\"d-none\");\r\n }\r\n\r\n if (secondaryFilterCount && count > 0) {\r\n secondaryFilterCount.innerHTML = count;\r\n secondaryFilterCount.classList.remove(\"d-none\");\r\n } else if (secondaryFilterCount) {\r\n secondaryFilterCount.classList.add(\"d-none\");\r\n }\r\n}\r\n\r\nfunction cleanFilters() {\r\n const filterInputs = document.querySelectorAll(\".filter\");\r\n if (filterInputs) {\r\n filterInputs.forEach((input) => {\r\n input.value = \"\"\r\n });\r\n\r\n countFilters();\r\n }\r\n}\r\n\r\nfunction prepareScrollButton() {\r\n let scrollButton = document.querySelector(\".btn-scroll-top\");\r\n\r\n if (scrollButton) {\r\n let topAttribute = Number.parseInt(getComputedStyle(scrollButton).top);\r\n let navDiv = scrollButton.parentElement.parentElement;\r\n navDiv.addEventListener(\"scroll\", () => {\r\n if (navDiv.scrollTop > 100) {\r\n scrollButton.style.display = \"flex\";\r\n } else {\r\n scrollButton.style.display = \"none\";\r\n }\r\n\r\n let newTopAttribute = navDiv.scrollTop + topAttribute;\r\n scrollButton.style.top = `${newTopAttribute}px`;\r\n });\r\n\r\n scrollButton.addEventListener(\"click\", () => {\r\n navDiv.scrollTop = 0;\r\n });\r\n }\r\n}\r\n","const { each } = require(\"jquery\");\r\n\r\ndocument.addEventListener(\"turbolinks:load\", () => {\r\n let no_btn = document.querySelector(\".is_identified_false\");\r\n if (no_btn) {\r\n no_btn.addEventListener(\"click\", (event) => {\r\n document.querySelector(\".user_informations\").style.display = \"none\";\r\n event.target.classList.add(\"active\");\r\n document.querySelector(\".is_identified_true\").classList.remove(\"active\");\r\n document.querySelector(\"#denunciation_is_identified_1\").checked = false;\r\n document.querySelector(\"#denunciation_is_identified_0\").checked = true;\r\n });\r\n\r\n document\r\n .querySelector(\".is_identified_true\")\r\n .addEventListener(\"click\", (event) => {\r\n document.querySelector(\".user_informations\").style.display = \"block\";\r\n event.target.classList.add(\"active\");\r\n document\r\n .querySelector(\".is_identified_false\")\r\n .classList.remove(\"active\");\r\n document.querySelector(\"#denunciation_is_identified_1\").checked = true;\r\n document.querySelector(\"#denunciation_is_identified_0\").checked = false;\r\n });\r\n }\r\n\r\n let checkbox = document.querySelector(\"#denunciation_check_phone_number\");\r\n\r\n if (checkbox) {\r\n checkbox.addEventListener(\"click\", (event) => {\r\n if (document.getElementById(\"denunciation_check_phone_number\").checked) {\r\n document.querySelector(\"#denunciation_phone_number\").required = true;\r\n } else {\r\n document.querySelector(\"#denunciation_phone_number\").required = false;\r\n }\r\n });\r\n }\r\n\r\n let trixToolbar = document.querySelector(\"trix-toolbar\");\r\n\r\n if (trixToolbar) {\r\n trixToolbar.setAttribute(\"aria-hidden\", \"true\");\r\n }\r\n\r\n let locationSelectInput = document.querySelector(\"#denunciation_location_id\");\r\n\r\n if (locationSelectInput) {\r\n locationSelectInput.addEventListener(\"change\", () => {\r\n fetchChildren(locationSelectInput);\r\n });\r\n }\r\n});\r\n\r\njQuery(document).on(\"turbolinks:load\", function () {\r\n if (document.getElementById(\"denunciation_is_identified_0\")) {\r\n if (document.getElementById(\"denunciation_is_identified_0\").checked) {\r\n document.querySelector(\".user_informations\").style.display = \"none\";\r\n } else {\r\n document.querySelector(\".user_informations\").style.display = \"block\";\r\n var vclass = document.querySelector(\"#active_is_indentified\");\r\n vclass.classList.add(\"active\");\r\n }\r\n }\r\n});\r\n\r\njQuery(document).on(\"turbolinks:load\", function () {\r\n if (jQuery(\"#invalid_accept_term\").text().trim() !== \"\") {\r\n jQuery(jQuery(\"#denunciation_validate_field\")).insertAfter(\r\n \"#link_accept_term\"\r\n );\r\n jQuery(jQuery(\"#checkmark_accept_term\")).insertAfter(\r\n \"#denunciation_validate_field\"\r\n );\r\n jQuery(\"#checkmark_accept_term\").click();\r\n }\r\n});\r\n\r\njQuery(document).on(\"turbolinks:load\", function () {\r\n jQuery(\"#denunciation_check_phone_number\").on(\"click\", () => {\r\n disablePhoneDiv();\r\n });\r\n jQuery(\"#denunciation_is_identified_check\").on(\"click\", () => {\r\n disableIdenfiedDiv();\r\n });\r\n function disablePhoneDiv() {\r\n if (jQuery(\"#denunciation_check_phone_number\").is(\":checked\")) {\r\n jQuery(\"#div_phone_number\").css(\"display\", \"block\");\r\n } else {\r\n jQuery(\"#div_phone_number\").css(\"display\", \"none\");\r\n }\r\n }\r\n function disableIdenfiedDiv() {\r\n if (jQuery(\"#denunciation_is_identified_check\").is(\":checked\")) {\r\n jQuery(\"#user_informations\").css(\"display\", \"block\");\r\n jQuery(\"#div_phone_number\").css(\"display\", \"block\");\r\n jQuery(\"#denunciation_check_phone_number\").prop(\"checked\", true);\r\n jQuery(\"#div_father_phone_number\").css(\"display\", \"block\");\r\n jQuery(\"#denunciation_phone_number\").prop(\"required\", \"required\");\r\n } else {\r\n jQuery(\"#user_informations\").css(\"display\", \"none\");\r\n jQuery(\"#div_phone_number\").css(\"display\", \"none\");\r\n jQuery(\"#denunciation_check_phone_number\").prop(\"checked\", false);\r\n jQuery(\"#div_father_phone_number\").css(\"display\", \"none\");\r\n jQuery(\"#denunciation_phone_number\").removeAttr(\"required\");\r\n }\r\n }\r\n disablePhoneDiv();\r\n disableIdenfiedDiv();\r\n});\r\n\r\nfunction fetchChildren(parentElement, nestedLevel = 0) {\r\n if (nestedLevel == 0) {\r\n jQuery(\".location-children\").remove();\r\n } else {\r\n for (let i = nestedLevel + 1; i <= jQuery(\".location-children\").length; i++) {\r\n jQuery(`#denunciation_location_id_${i}`).remove();\r\n }\r\n }\r\n\r\n let locationSelectInput = document.querySelector(\"#denunciation_location_id\");\r\n let notInformedText = locationSelectInput.options[0].text;\r\n\r\n jQuery.ajax({\r\n url: \"location_children\",\r\n data: {\r\n location_id: parentElement.value,\r\n },\r\n success: function (data) {\r\n if (data[\"children\"].length == 0) {\r\n return;\r\n }\r\n nestedLevel += 1;\r\n const select = jQuery('', {\r\n class: 'form-control btn cdd-btn-icon location-children mt-2',\r\n name: `denunciation[location_id_${nestedLevel}]`,\r\n id: `denunciation_location_id_${nestedLevel}`\r\n });\r\n\r\n select.append(jQuery('', {\r\n value: '',\r\n text: notInformedText\r\n }));\r\n\r\n jQuery.each(data[\"children\"], function (index, item) {\r\n select.append(jQuery('', {\r\n value: item[1],\r\n text: item[0]\r\n }));\r\n });\r\n\r\n jQuery(parentElement).after(select);\r\n select.on(\"change\", () => {\r\n fetchChildren(select[0], nestedLevel);\r\n });\r\n },\r\n error: function (data) {\r\n console.error(data);\r\n },\r\n dataType: \"json\",\r\n });\r\n}\r\n","document.addEventListener(\"turbolinks:load\", () => {\r\n const denunciationsList = document.querySelector(\"#denunciations-list\");\r\n const selectedDenunciationsListItems = document.querySelectorAll(\"#selected-denunciations-list > li\");\r\n const searchCaseForm = document.querySelector(\"#search-case-form\");\r\n const pathParams = window.location.pathname.split(\"/\");\r\n const tenantPrefix = pathParams[1];\r\n const tenantName = pathParams[2];\r\n const basePath = `/${tenantPrefix}/${tenantName}/denunciations/search`;\r\n\r\n if (denunciationsList) {\r\n fetchAndProcessData(basePath, denunciationsList, tenantName, tenantPrefix);\r\n }\r\n\r\n if (searchCaseForm) {\r\n searchCaseForm.addEventListener(\"submit\", (event) => {\r\n event.preventDefault();\r\n const formData = new FormData(searchCaseForm);\r\n const searchParams = new URLSearchParams(formData).toString();\r\n const searchPath = `${basePath}?${searchParams}`;\r\n\r\n fetchAndProcessData(searchPath, denunciationsList, tenantName, tenantPrefix);\r\n });\r\n }\r\n\r\n if (selectedDenunciationsListItems && selectedDenunciationsListItems.length > 0) {\r\n selectedDenunciationsListItems.forEach((item) => {\r\n item.addEventListener(\"click\", () => {\r\n item.classList.toggle(\"selected\");\r\n });\r\n });\r\n }\r\n\r\n setupMoveButton(\"#add-selected\", \".selectable-for-case.selected\", \"#selected-denunciations-list\", [\"selected\", \"selectable-for-case\"], [\"selected-for-case\"]);\r\n setupMoveButton(\"#add-all-selected\", \".selectable-for-case\", \"#selected-denunciations-list\", [\"selected\", \"selectable-for-case\"], [\"selected-for-case\"]);\r\n setupMoveButton(\"#remove-selected\", \".selected-for-case.selected\", \"#denunciations-list\", [\"selected\", \"selected-for-case\"], [\"selectable-for-case\"]);\r\n setupMoveButton(\"#remove-all-selected\", \".selected-for-case\", \"#denunciations-list\", [\"selected\", \"selected-for-case\"], [\"selectable-for-case\"]);\r\n});\r\n\r\nfunction setupMoveButton(buttonSelector, sourceSelector, destinationSelector, removeClasses, addClasses) {\r\n document.querySelector(buttonSelector).addEventListener(\"click\", () => {\r\n moveDenunciations(sourceSelector, destinationSelector, removeClasses, addClasses);\r\n });\r\n}\r\n\r\nfunction buildDenunciationListItem(denunciation, locale, tenantName, tenantPrefix, buttonLabel) {\r\n const li = document.createElement(\"li\");\r\n li.classList.add(\"d-flex\", \"justify-content-between\", \"align-items-center\", \"py-2\", \"selectable-for-case\", \"px-3\", \"my-1\");\r\n li.setAttribute(\"data-denunciation-id\", denunciation.id);\r\n li.innerHTML = `\r\n ${denunciation.protocol_number}
\r\n ${denunciation.aasm_status[locale]}
\r\n ${buttonLabel}\r\n `;\r\n li.addEventListener(\"click\", () => {\r\n li.classList.toggle(\"selected\");\r\n });\r\n return li;\r\n}\r\n\r\nasync function fetchAndProcessData(path, denunciationsList, tenantName, tenantPrefix) {\r\n try {\r\n const response = await fetch(path);\r\n const data = await response.json();\r\n denunciationsList.innerHTML = \"\";\r\n data.denunciations.forEach((denunciation) => {\r\n denunciationsList.appendChild(buildDenunciationListItem(denunciation, data.locale, tenantName, tenantPrefix, data.button_label));\r\n });\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n}\r\n\r\nfunction moveDenunciations(sourceSelector, destinationSelector, removeClasses, addClasses) {\r\n const sourceElements = document.querySelectorAll(sourceSelector);\r\n const destinationContainer = document.querySelector(destinationSelector);\r\n sourceElements.forEach((element) => {\r\n destinationContainer.appendChild(element);\r\n removeClasses.forEach((cls) => element.classList.remove(cls));\r\n addClasses.forEach((cls) => element.classList.add(cls));\r\n\r\n if (destinationSelector === \"#denunciations-list\") {\r\n updateDenunciationIds(element, \"remove\");\r\n } else {\r\n updateDenunciationIds(element, \"add\");\r\n }\r\n });\r\n}\r\n\r\nfunction updateDenunciationIds(element, action) {\r\n const denunciationId = element.getAttribute(\"data-denunciation-id\");\r\n const hiddenInput = document.querySelector(\"#denunciation_ids\");\r\n const denunciationIds = hiddenInput.value.split(\",\").filter(id => id);\r\n\r\n if (action === \"add\" && !denunciationIds.includes(denunciationId)) {\r\n denunciationIds.push(denunciationId);\r\n } else if (action === \"remove\") {\r\n const index = denunciationIds.indexOf(denunciationId);\r\n if (index > -1) {\r\n denunciationIds.splice(index, 1);\r\n }\r\n }\r\n\r\n hiddenInput.value = denunciationIds.join(\",\");\r\n}\r\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","jQuery(document).on(\"turbolinks:load\", function () {\r\n let involved_id = jQuery(\"[id^=select_involved_]\");\r\n if (involved_id) {\r\n involved_id.on(\"click\", function () {\r\n var matches = this.name.match(/\\[(.*?)\\]/);\r\n\r\n jQuery(\"#involved_id\").val(matches[1]);\r\n\r\n var formAction =\r\n jQuery(\"#form-edit-involved\").attr(\"action\") +\r\n \"/edit?involved_id=\" +\r\n matches[1];\r\n\r\n jQuery(\"#form-edit-involved\").attr(\"action\", formAction);\r\n jQuery(\"#button-edit-involved\").attr(\"href\", formAction);\r\n });\r\n }\r\n});\r\n\r\njQuery(document).on(\"turbolinks:load\", function () {\r\n $('*[data-href]').on('click', function() {\r\n window.location = $(this).data(\"href\");\r\n });\r\n});\r\n","jQuery(document).on(\"turbolinks:load\", function () {\r\n jQuery(document).ready(() => {\r\n window.setInterval(function() {\r\n if(jQuery(\"#selected_involved_type\").val() !== \"\"){\r\n jQuery(\"#involved-color-\"+jQuery(\"#selected_involved_type\").val()).click();\r\n }\r\n }, 1000);\r\n function activeButton(value, btn_active, id_check, btns_to_disable){\r\n jQuery(\"#\" + btn_active).addClass(\"active\");\r\n document.getElementById(id_check).checked = true;\r\n jQuery.each(btns_to_disable, function(i, val) {\r\n jQuery(\"#\" + val).removeClass(\"active\");\r\n });\r\n jQuery(\"#selected_involved_type\").val(value);\r\n }\r\n\r\n jQuery(\"#involved-color-witness\").on(\"click\", () => {\r\n activeButton(\"witness\", \"involved-color-witness\", \"involved_denunciation_involved_type_witness\", ['involved-color-denounced', 'involved-color-mentioned', 'involved-color-denunciator']);\r\n });\r\n\r\n jQuery(\"#involved-color-denounced\").on(\"click\", () => {\r\n activeButton(\"denounced\", \"involved-color-denounced\", \"involved_denunciation_involved_type_denounced\", ['involved-color-witness', 'involved-color-mentioned', 'involved-color-denunciator']);\r\n });\r\n\r\n jQuery(\"#involved-color-mentioned\").on(\"click\", () => {\r\n activeButton(\"mentioned\", \"involved-color-mentioned\", \"involved_denunciation_involved_type_mentioned\", ['involved-color-witness', 'involved-color-denounced', 'involved-color-denunciator']);\r\n });\r\n \r\n jQuery(\"#involved-color-denunciator\").on(\"click\", () => {\r\n activeButton(\"denunciator\", \"involved-color-denunciator\", \"involved_denunciation_involved_type_denunciator\", ['involved-color-witness', 'involved-color-denounced', 'involved-color-mentioned']);\r\n });\r\n });\r\n});\r\n","document.addEventListener(\"turbolinks:load\", () => {\r\n let internal_btn = document.querySelector(\"#lb_internal\");\r\n let ethic_btn = document.querySelector(\"#lb_ethic_committee\");\r\n let internal_ethic_btn = document.querySelector(\"#lb_internal_ethic_committee\");\r\n\r\n if (internal_btn) {\r\n internal_btn.addEventListener(\"click\", (event) => {\r\n if (ethic_btn) {\r\n ethic_btn.classList.remove(\"active\");\r\n document.querySelector(\"#more_information_info_type_ethic_committee\").checked = false;\r\n }\r\n if (internal_ethic_btn !== null) {\r\n internal_ethic_btn.classList.remove(\"active\");\r\n document.querySelector(\"#more_information_info_type_internal_ethic_committee\").checked = false;\r\n }\r\n document.querySelector(\"#lb_denunciator\").classList.remove(\"active\");\r\n document.querySelector(\"#more_information_info_type_denunciator\").checked = false;\r\n\r\n document.querySelector(\"#lb_internal\").classList.add(\"active\");\r\n document.querySelector(\"#more_information_info_type_internal\").checked = true;\r\n });\r\n }\r\n\r\n if (ethic_btn) {\r\n ethic_btn.addEventListener(\"click\", (event) => {\r\n if (internal_btn) {\r\n internal_btn.classList.remove(\"active\");\r\n document.querySelector(\"#more_information_info_type_internal\").checked = false;\r\n }\r\n if (internal_ethic_btn) {\r\n internal_ethic_btn.classList.remove(\"active\");\r\n document.querySelector(\"#more_information_info_type_internal_ethic_committee\").checked = false;\r\n }\r\n document.querySelector(\"#lb_denunciator\").classList.remove(\"active\");\r\n document.querySelector(\"#more_information_info_type_denunciator\").checked = false;\r\n\r\n document.querySelector(\"#lb_ethic_committee\").classList.add(\"active\");\r\n document.querySelector(\"#more_information_info_type_ethic_committee\").checked = true;\r\n });\r\n }\r\n\r\n if (internal_ethic_btn) {\r\n internal_ethic_btn.addEventListener(\"click\", (event) => {\r\n if (internal_btn) {\r\n internal_btn.classList.remove(\"active\");\r\n document.querySelector(\"#more_information_info_type_internal\").checked = false;\r\n }\r\n if (ethic_btn !== null) {\r\n document.querySelector(\"#lb_ethic_committee\").classList.remove(\"active\");\r\n document.querySelector(\"#more_information_info_type_ethic_committee\").checked = false;\r\n }\r\n document.querySelector(\"#lb_denunciator\").classList.remove(\"active\");\r\n document.querySelector(\"#more_information_info_type_denunciator\").checked = false;\r\n\r\n document.querySelector(\"#lb_internal_ethic_committee\").classList.add(\"active\");\r\n document.querySelector(\"#more_information_info_type_internal_ethic_committee\").checked = true;\r\n });\r\n }\r\n\r\n document.querySelector(\"#lb_denunciator\").addEventListener(\"click\", (event) => {\r\n if (internal_btn) {\r\n internal_btn.classList.remove(\"active\");\r\n document.querySelector(\"#more_information_info_type_internal\").checked = false;\r\n }\r\n if (ethic_btn) {\r\n ethic_btn.classList.remove(\"active\");\r\n document.querySelector(\"#more_information_info_type_ethic_committee\").checked = false;\r\n }\r\n if (internal_ethic_btn) {\r\n internal_ethic_btn.classList.remove(\"active\");\r\n document.querySelector(\"#more_information_info_type_internal_ethic_committee\").checked = false;\r\n }\r\n document.querySelector(\"#lb_denunciator\").classList.add(\"active\");\r\n document.querySelector(\"#more_information_info_type_denunciator\").checked = true;\r\n });\r\n\r\n\r\n let showContentLink = document.querySelector(\"p.show-content\");\r\n\r\n if (showContentLink) {\r\n document.querySelector(\"p.show-content + div.trix-content\").classList.toggle(\"hide\");\r\n\r\n showContentLink.addEventListener(\"click\", () => {\r\n document.querySelector(\"p.show-content + div.trix-content\").classList.toggle(\"hide\");\r\n showContentLink.classList.toggle(\"mb-0\");\r\n showContentLink.querySelector(\"span:last-child\").classList.toggle(\"d-none\");\r\n showContentLink.querySelector(\"span:first-child\").classList.toggle(\"d-none\");\r\n });\r\n }\r\n});","jQuery(document).on(\"turbolinks:load\", function () {\r\n jQuery(\".cdd-btn-icon\").on(\"click\", function (f) {\r\n var new_params = {};\r\n if (this.id == \"involved_correlation_btn\") {\r\n new_params = {\r\n name: $(\"#involved_denunciation_name\")[0].value,\r\n correlation_id: $(\"#involved_correlation_id\")[0].value,\r\n involved_type: $(\"#selected_involved_type\")[0].value,\r\n job_title: $(\"#involved_denunciation_job_title\")[0].value,\r\n involved_id: $(\"#involved_id\")[0].value,\r\n };\r\n } else if (this.id == \"category-btn\") {\r\n new_params = build_new_params();\r\n if (new_params[\"severity\"]) {\r\n delete new_params.severity;\r\n }\r\n } else {\r\n new_params = build_new_params();\r\n }\r\n this.href += \"&\" + jQuery.param(new_params);\r\n });\r\n});\r\n\r\njQuery(document).on(\"turbolinks:load\", function () {\r\n jQuery(\".cdd-btn-icon-select\").on(\"click\", function (f) {\r\n var new_url =\r\n this.href.split(\"?\")[0] +\r\n \"?&return_select=true&\" +\r\n $(\"#field_select_option\")[0].value +\r\n \"=\" +\r\n this.id;\r\n $(\".cdd-select-params\").each(function () {\r\n if (this.name !== $(\"#field_select_option\")[0].value) {\r\n new_url += \"&\" + this.name + \"=\" + this.value;\r\n }\r\n });\r\n this.href = \"\";\r\n this.href = new_url;\r\n });\r\n});\r\n\r\nfunction build_new_params() {\r\n let params = {};\r\n let info = [\r\n document.querySelector(\"#denunciation_category_id\"),\r\n document.querySelector(\"#denunciation_location_id\"),\r\n document.querySelector(\"#denunciation_correlation_id\"),\r\n document.querySelector(\"#origin_from\"),\r\n document.querySelector(\"#severity\"),\r\n document.querySelector(\"#action_type_id\"),\r\n document.querySelector(\"#priority\"),\r\n ];\r\n\r\n info\r\n .filter((x) => {\r\n return x !== null;\r\n })\r\n .forEach((elem) => {\r\n try {\r\n if (elem.getAttribute(\"data-initial\") !== elem.value) {\r\n params[elem.getAttribute(\"data-name\")] = elem.value;\r\n }\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n });\r\n\r\n return params;\r\n}\r\n","import Tagify from \"@yaireo/tagify\";\r\n\r\nvar tagify;\r\nvar controller;\r\n\r\n$(document).on(\"turbolinks:load\", () => {\r\n let input = document.querySelector(\"#responsibles-emails\");\r\n\r\n if (input) {\r\n tagify = new Tagify(input, {\r\n pattern:\r\n /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/,\r\n whitelist: [],\r\n });\r\n\r\n tagify.on(\"input\", onInput);\r\n }\r\n\r\n if (document.querySelector(\"#action_plan_done_checkbox\")) {\r\n $(\".checkbox-container.action-plan-item\").on(\"click\", toggleCheckBoxValue);\r\n }\r\n\r\n if (document.querySelector(\"#action_plan_done_checkbox_on_show\")) {\r\n $(\".checkbox-container.action-plan-item\").on(\"click\", submitShowForm);\r\n }\r\n});\r\n\r\nfunction onInput(e) {\r\n var value = e.detail.value;\r\n\r\n if (value.length < 3) {\r\n return false;\r\n }\r\n\r\n tagify.whitelist = null;\r\n\r\n controller && controller.abort();\r\n controller = new AbortController();\r\n\r\n tagify.loading(true).dropdown.hide();\r\n\r\n let split_current_url = window.location.href.split(\"/\");\r\n let search_url = `${split_current_url[0]}//${split_current_url[2]}/${split_current_url[3]}/${split_current_url[4]}/${split_current_url[5]}/${split_current_url[6]}/action_plan_items/list_external_users?query=${value}`;\r\n\r\n fetch(search_url, {\r\n signal: controller.signal,\r\n })\r\n .then((RES) => RES.json())\r\n .then(function (newWhitelist) {\r\n tagify.whitelist = newWhitelist;\r\n tagify.loading(false).dropdown.show(value);\r\n });\r\n}\r\n\r\nfunction toggleCheckBoxValue(e, checkbox_id = null) {\r\n e.preventDefault();\r\n let checkbox = checkbox_id\r\n ? document.querySelector(checkbox_id)\r\n : document.querySelector(\"#action_plan_done_checkbox\");\r\n if (checkbox.checked && checkbox.value === \"1\") {\r\n checkbox.checked = false;\r\n checkbox.value = \"0\";\r\n } else {\r\n checkbox.checked = true;\r\n checkbox.value = \"1\";\r\n }\r\n}\r\n\r\nfunction submitShowForm(e) {\r\n if (\r\n document\r\n .querySelector(\"#action_plan_done_checkbox_on_show\")\r\n .getAttribute(\"disabled\") === \"disabled\"\r\n ) {\r\n return false;\r\n }\r\n toggleCheckBoxValue(e, \"#action_plan_done_checkbox_on_show\");\r\n document.querySelector(\"form.edit_action_plan_item\").submit();\r\n}\r\n","import Tagify from \"@yaireo/tagify\";\r\n\r\nvar tagify;\r\n\r\n$(document).on(\"turbolinks:load\", () => {\r\n let input = document.querySelector(\"#report_to_do_responsibles\");\r\n\r\n if (input) {\r\n tagify = new Tagify(input, {\r\n pattern:\r\n /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/,\r\n whitelist: []\r\n });\r\n\r\n tagify.on(\"focus\", onFocus);\r\n }\r\n\r\n if (document.querySelector(\"#report_to_do_done_checkbox\")) {\r\n $(\".checkbox-container.report-to-do\").on(\"click\", toggleCheckBoxValue);\r\n }\r\n\r\n if (document.querySelector(\"#report_to_do_done_checkbox_on_show\")) {\r\n $(\".checkbox-container.report-to-do\").on(\"click\", submitShowForm);\r\n }\r\n});\r\n\r\nfunction onFocus(e) {\r\n var value = e.detail.value;\r\n\r\n if (value.length < 3) {\r\n return false;\r\n }\r\n\r\n tagify.whitelist = null;\r\n\r\n controller && controller.abort();\r\n controller = new AbortController();\r\n\r\n tagify.loading(true).dropdown.hide();\r\n\r\n let split_current_url = window.location.href.split(\"/\");\r\n let search_url = `${split_current_url[0]}//${split_current_url[2]}/${split_current_url[3]}/${split_current_url[4]}/${split_current_url[5]}/${split_current_url[6]}/report_to_dos/list_external_users?query=${value}`;\r\n\r\n fetch(search_url, {\r\n signal: controller.signal,\r\n })\r\n .then((RES) => RES.json())\r\n .then(function (newWhitelist) {\r\n tagify.whitelist = newWhitelist;\r\n tagify.loading(false).dropdown.show(value);\r\n });\r\n}\r\n\r\nfunction toggleCheckBoxValue(e, checkbox_id = null) {\r\n e.preventDefault();\r\n let checkbox = checkbox_id\r\n ? document.querySelector(checkbox_id)\r\n : document.querySelector(\"#report_to_do_done_checkbox\");\r\n if (checkbox.checked && checkbox.value === \"1\") {\r\n checkbox.checked = false;\r\n checkbox.value = \"0\";\r\n } else {\r\n checkbox.checked = true;\r\n checkbox.value = \"1\";\r\n }\r\n}\r\n\r\nfunction submitShowForm(e) {\r\n if (\r\n document\r\n .querySelector(\"#report_to_do_done_checkbox_on_show\")\r\n .getAttribute(\"disabled\") === \"disabled\"\r\n ) {\r\n return false;\r\n }\r\n toggleCheckBoxValue(e, \"#report_to_do_done_checkbox_on_show\");\r\n document.querySelector(\"form.edit_report_to_do\").submit();\r\n}\r\n","jQuery(document).on(\"turbolinks:load\", function () {\r\n const blobLinks = document.querySelectorAll('.add-blank');\r\n\r\n if(blobLinks.length > 0) {\r\n blobLinks.forEach((item) => {\r\n item.setAttribute('target', '_blank')\r\n });\r\n }\r\n\r\n const spanForms = document.querySelectorAll('.add-download-form');\r\n\r\n if(spanForms.length > 0) {\r\n spanForms.forEach((item) => {\r\n var form = document.createElement('form');\r\n form.setAttribute('id', 'download_file');\r\n form.setAttribute('method', 'post');\r\n\r\n var action = item.querySelector('.form_action');\r\n form.setAttribute('action', action.innerHTML);\r\n action.remove();\r\n\r\n var procotocolNumber = document.createElement('input');\r\n procotocolNumber.setAttribute('type', 'hidden');\r\n procotocolNumber.setAttribute('id', 'protocol_number');\r\n procotocolNumber.setAttribute('name', 'protocol_number');\r\n procotocolNumber.setAttribute('value', document.querySelector('#protocol_number').innerHTML);\r\n form.append(procotocolNumber);\r\n\r\n var inputBlobId = document.createElement('input');\r\n inputBlobId.setAttribute('type', 'hidden');\r\n inputBlobId.setAttribute('id', 'blob_id');\r\n inputBlobId.setAttribute('name', 'blob_id');\r\n var blob_id = item.querySelector('.blob_id')\r\n inputBlobId.setAttribute('value', blob_id.innerHTML);\r\n blob_id.remove();\r\n form.append(inputBlobId);\r\n \r\n var inputSubmit = document.createElement('input');\r\n inputSubmit.setAttribute('type', 'submit');\r\n var download_label = item.querySelector('.download_label')\r\n inputSubmit.setAttribute('value', download_label.innerHTML);\r\n download_label.remove();\r\n form.append(inputSubmit);\r\n item.append(form);\r\n })\r\n }\r\n});\r\n","jQuery(document).on(\"turbolinks:load\", function () {\r\n let backgroundDiv = document.querySelector(\"#bg-pages\");\r\n\r\n if (backgroundDiv) {\r\n let dataURI = backgroundDiv.getAttribute(\"data-bg-img\");\r\n\r\n if (dataURI) {\r\n backgroundDiv.style.backgroundImage = `url(${dataURI.replace(\r\n /[\\r\\n]/gm,\r\n \"\"\r\n )})`;\r\n }\r\n }\r\n});\r\n","jQuery(document).on(\"turbolinks:load\", () => {\r\n let loginForm = document.querySelector(\"#login-form\");\r\n let appUrl = document.querySelector(\"#app_url\");\r\n\r\n let domain = window.location.href;\r\n\r\n if ((domain.includes(\"app\") || domain.includes(\"local\")) && !!loginForm) {\r\n loginForm.submit();\r\n } else if (!!appUrl){\r\n window.location.href = appUrl.value;\r\n }\r\n});\r\n","$(document).on(\"turbolinks:load\", function () {\r\n\r\n if($(\"#report-container\").get(0) === undefined) return\r\n\r\n var reportContainer = $(\"#report-container\").get(0);\r\n\r\n powerbi.bootstrap(reportContainer, { type: \"report\" });\r\n\r\n var reportLoadConfig = {\r\n type: \"report\",\r\n tokenType: 1,\r\n };\r\n\r\n let pathParams = window.location.pathname.split(\"/\");\r\n let tenantPrefix = pathParams[1];\r\n let tenantname = pathParams[2];\r\n let path = `/${tenantPrefix}/${tenantname}/get_embed_info`;\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n url: path,\r\n dataType: \"json\",\r\n success: function (data) {\r\n let embedData = $.parseJSON(JSON.stringify(data));\r\n reportLoadConfig.accessToken = embedData.token;\r\n reportLoadConfig.embedUrl = embedData.embedUrl;\r\n var report = powerbi.embed(reportContainer, reportLoadConfig);\r\n\r\n report.on(\"loaded\", function () {\r\n console.log(\"Report load successful\");\r\n report.updateSettings({\r\n filterPaneEnabled: false,\r\n navContentPaneEnabled: false,\r\n panes: {\r\n filters: {\r\n visible: false,\r\n },\r\n },\r\n });\r\n });\r\n\r\n report.on(\"rendered\", function () {\r\n console.log(\"Report render successful\");\r\n report.refresh();\r\n });\r\n\r\n report.off(\"error\");\r\n\r\n report.on(\"error\", function (event) {\r\n var errorMsg = event.detail;\r\n\r\n console.error(errorMsg);\r\n return;\r\n });\r\n },\r\n error: function (err) {\r\n console.error(err);\r\n },\r\n });\r\n});\r\n","var map = {\n\t\"./ad\": 164,\n\t\"./ad.svg\": 164,\n\t\"./ae\": 165,\n\t\"./ae.svg\": 165,\n\t\"./af\": 166,\n\t\"./af.svg\": 166,\n\t\"./ag\": 167,\n\t\"./ag.svg\": 167,\n\t\"./ai\": 168,\n\t\"./ai.svg\": 168,\n\t\"./al\": 169,\n\t\"./al.svg\": 169,\n\t\"./am\": 170,\n\t\"./am.svg\": 170,\n\t\"./ao\": 171,\n\t\"./ao.svg\": 171,\n\t\"./aq\": 172,\n\t\"./aq.svg\": 172,\n\t\"./ar\": 173,\n\t\"./ar.svg\": 173,\n\t\"./as\": 174,\n\t\"./as.svg\": 174,\n\t\"./at\": 175,\n\t\"./at.svg\": 175,\n\t\"./au\": 176,\n\t\"./au.svg\": 176,\n\t\"./aw\": 177,\n\t\"./aw.svg\": 177,\n\t\"./ax\": 178,\n\t\"./ax.svg\": 178,\n\t\"./az\": 179,\n\t\"./az.svg\": 179,\n\t\"./ba\": 180,\n\t\"./ba.svg\": 180,\n\t\"./bb\": 181,\n\t\"./bb.svg\": 181,\n\t\"./bd\": 182,\n\t\"./bd.svg\": 182,\n\t\"./be\": 183,\n\t\"./be.svg\": 183,\n\t\"./bf\": 184,\n\t\"./bf.svg\": 184,\n\t\"./bg\": 27,\n\t\"./bg.png\": 27,\n\t\"./bg.svg\": 469,\n\t\"./bg@2x\": 185,\n\t\"./bg@2x.png\": 185,\n\t\"./bg@3x\": 186,\n\t\"./bg@3x.png\": 186,\n\t\"./bh\": 187,\n\t\"./bh.svg\": 187,\n\t\"./bi\": 188,\n\t\"./bi.svg\": 188,\n\t\"./bj\": 189,\n\t\"./bj.svg\": 189,\n\t\"./bl\": 190,\n\t\"./bl.svg\": 190,\n\t\"./bm\": 191,\n\t\"./bm.svg\": 191,\n\t\"./bn\": 192,\n\t\"./bn.svg\": 192,\n\t\"./bo\": 193,\n\t\"./bo.svg\": 193,\n\t\"./bq\": 194,\n\t\"./bq.svg\": 194,\n\t\"./bs\": 195,\n\t\"./bs.svg\": 195,\n\t\"./bt\": 196,\n\t\"./bt.svg\": 196,\n\t\"./bv\": 197,\n\t\"./bv.svg\": 197,\n\t\"./bw\": 198,\n\t\"./bw.svg\": 198,\n\t\"./by\": 199,\n\t\"./by.svg\": 199,\n\t\"./bz\": 200,\n\t\"./bz.svg\": 200,\n\t\"./ca\": 201,\n\t\"./ca.svg\": 201,\n\t\"./cc\": 202,\n\t\"./cc.svg\": 202,\n\t\"./cd\": 203,\n\t\"./cd.svg\": 203,\n\t\"./cf\": 204,\n\t\"./cf.svg\": 204,\n\t\"./cg\": 205,\n\t\"./cg.svg\": 205,\n\t\"./ch\": 206,\n\t\"./ch.svg\": 206,\n\t\"./ci\": 207,\n\t\"./ci.svg\": 207,\n\t\"./ck\": 208,\n\t\"./ck.svg\": 208,\n\t\"./cl\": 209,\n\t\"./cl.svg\": 209,\n\t\"./cm\": 210,\n\t\"./cm.svg\": 210,\n\t\"./cn\": 211,\n\t\"./cn.svg\": 211,\n\t\"./co\": 212,\n\t\"./co.svg\": 212,\n\t\"./cr\": 213,\n\t\"./cr.svg\": 213,\n\t\"./cu\": 214,\n\t\"./cu.svg\": 214,\n\t\"./cv\": 215,\n\t\"./cv.svg\": 215,\n\t\"./cw\": 216,\n\t\"./cw.svg\": 216,\n\t\"./cx\": 217,\n\t\"./cx.svg\": 217,\n\t\"./cy\": 218,\n\t\"./cy.svg\": 218,\n\t\"./cz\": 219,\n\t\"./cz.svg\": 219,\n\t\"./de\": 220,\n\t\"./de.svg\": 220,\n\t\"./dj\": 221,\n\t\"./dj.svg\": 221,\n\t\"./dk\": 222,\n\t\"./dk.svg\": 222,\n\t\"./dm\": 223,\n\t\"./dm.svg\": 223,\n\t\"./do\": 224,\n\t\"./do.svg\": 224,\n\t\"./dz\": 225,\n\t\"./dz.svg\": 225,\n\t\"./ec\": 226,\n\t\"./ec.svg\": 226,\n\t\"./ee\": 227,\n\t\"./ee.svg\": 227,\n\t\"./eg\": 228,\n\t\"./eg.svg\": 228,\n\t\"./eh\": 229,\n\t\"./eh.svg\": 229,\n\t\"./en\": 230,\n\t\"./en.svg\": 230,\n\t\"./er\": 231,\n\t\"./er.svg\": 231,\n\t\"./es\": 232,\n\t\"./es-ct\": 233,\n\t\"./es-ct.svg\": 233,\n\t\"./es-ga\": 234,\n\t\"./es-ga.svg\": 234,\n\t\"./es.svg\": 232,\n\t\"./et\": 235,\n\t\"./et.svg\": 235,\n\t\"./ethic-code\": 236,\n\t\"./ethic-code.png\": 236,\n\t\"./eu\": 237,\n\t\"./eu.svg\": 237,\n\t\"./fi\": 238,\n\t\"./fi.svg\": 238,\n\t\"./fj\": 239,\n\t\"./fj.svg\": 239,\n\t\"./fk\": 240,\n\t\"./fk.svg\": 240,\n\t\"./fm\": 241,\n\t\"./fm.svg\": 241,\n\t\"./fo\": 242,\n\t\"./fo.svg\": 242,\n\t\"./follow-up-report\": 243,\n\t\"./follow-up-report.png\": 243,\n\t\"./fr\": 244,\n\t\"./fr.svg\": 244,\n\t\"./ga\": 245,\n\t\"./ga.svg\": 245,\n\t\"./gb\": 246,\n\t\"./gb-eng\": 247,\n\t\"./gb-eng.svg\": 247,\n\t\"./gb-nir\": 248,\n\t\"./gb-nir.svg\": 248,\n\t\"./gb-sct\": 249,\n\t\"./gb-sct.svg\": 249,\n\t\"./gb-wls\": 250,\n\t\"./gb-wls.svg\": 250,\n\t\"./gb.svg\": 246,\n\t\"./gd\": 251,\n\t\"./gd.svg\": 251,\n\t\"./ge\": 252,\n\t\"./ge.svg\": 252,\n\t\"./gf\": 253,\n\t\"./gf.svg\": 253,\n\t\"./gg\": 254,\n\t\"./gg.svg\": 254,\n\t\"./gh\": 255,\n\t\"./gh.svg\": 255,\n\t\"./gi\": 256,\n\t\"./gi.svg\": 256,\n\t\"./gl\": 257,\n\t\"./gl.svg\": 257,\n\t\"./gm\": 258,\n\t\"./gm.svg\": 258,\n\t\"./gn\": 259,\n\t\"./gn.svg\": 259,\n\t\"./gp\": 260,\n\t\"./gp.svg\": 260,\n\t\"./gq\": 261,\n\t\"./gq.svg\": 261,\n\t\"./gr\": 262,\n\t\"./gr.svg\": 262,\n\t\"./gs\": 263,\n\t\"./gs.svg\": 263,\n\t\"./gt\": 264,\n\t\"./gt.svg\": 264,\n\t\"./gu\": 265,\n\t\"./gu.svg\": 265,\n\t\"./gw\": 266,\n\t\"./gw.svg\": 266,\n\t\"./gy\": 267,\n\t\"./gy.svg\": 267,\n\t\"./hk\": 268,\n\t\"./hk.svg\": 268,\n\t\"./hm\": 269,\n\t\"./hm.svg\": 269,\n\t\"./hn\": 270,\n\t\"./hn.svg\": 270,\n\t\"./hr\": 271,\n\t\"./hr.svg\": 271,\n\t\"./ht\": 272,\n\t\"./ht.svg\": 272,\n\t\"./hu\": 273,\n\t\"./hu.svg\": 273,\n\t\"./id\": 274,\n\t\"./id.svg\": 274,\n\t\"./ie\": 275,\n\t\"./ie.svg\": 275,\n\t\"./il\": 276,\n\t\"./il.svg\": 276,\n\t\"./im\": 277,\n\t\"./im.svg\": 277,\n\t\"./in\": 278,\n\t\"./in.svg\": 278,\n\t\"./io\": 279,\n\t\"./io.svg\": 279,\n\t\"./iq\": 280,\n\t\"./iq.svg\": 280,\n\t\"./ir\": 281,\n\t\"./ir.svg\": 281,\n\t\"./is\": 282,\n\t\"./is.svg\": 282,\n\t\"./it\": 283,\n\t\"./it.svg\": 283,\n\t\"./je\": 284,\n\t\"./je.svg\": 284,\n\t\"./jm\": 285,\n\t\"./jm.svg\": 285,\n\t\"./jo\": 286,\n\t\"./jo.svg\": 286,\n\t\"./jp\": 287,\n\t\"./jp.svg\": 287,\n\t\"./ke\": 288,\n\t\"./ke.svg\": 288,\n\t\"./kg\": 289,\n\t\"./kg.svg\": 289,\n\t\"./kh\": 290,\n\t\"./kh.svg\": 290,\n\t\"./ki\": 291,\n\t\"./ki.svg\": 291,\n\t\"./km\": 292,\n\t\"./km.svg\": 292,\n\t\"./kn\": 293,\n\t\"./kn.svg\": 293,\n\t\"./kp\": 294,\n\t\"./kp.svg\": 294,\n\t\"./kpmg\": 295,\n\t\"./kpmg-logo\": 14,\n\t\"./kpmg-logo.svg\": 14,\n\t\"./kpmg.svg\": 295,\n\t\"./kr\": 296,\n\t\"./kr.svg\": 296,\n\t\"./kw\": 297,\n\t\"./kw.svg\": 297,\n\t\"./ky\": 298,\n\t\"./ky.svg\": 298,\n\t\"./kz\": 299,\n\t\"./kz.svg\": 299,\n\t\"./la\": 300,\n\t\"./la.svg\": 300,\n\t\"./lb\": 301,\n\t\"./lb.svg\": 301,\n\t\"./lc\": 302,\n\t\"./lc.svg\": 302,\n\t\"./li\": 303,\n\t\"./li.svg\": 303,\n\t\"./lk\": 304,\n\t\"./lk.svg\": 304,\n\t\"./lr\": 305,\n\t\"./lr.svg\": 305,\n\t\"./ls\": 306,\n\t\"./ls.svg\": 306,\n\t\"./lt\": 307,\n\t\"./lt.svg\": 307,\n\t\"./lu\": 308,\n\t\"./lu.svg\": 308,\n\t\"./lv\": 309,\n\t\"./lv.svg\": 309,\n\t\"./ly\": 310,\n\t\"./ly.svg\": 310,\n\t\"./ma\": 311,\n\t\"./ma.svg\": 311,\n\t\"./main-image\": 312,\n\t\"./main-image.png\": 312,\n\t\"./make-your-report\": 313,\n\t\"./make-your-report.png\": 313,\n\t\"./mc\": 314,\n\t\"./mc.svg\": 314,\n\t\"./md\": 315,\n\t\"./md.svg\": 315,\n\t\"./me\": 316,\n\t\"./me.svg\": 316,\n\t\"./mf\": 317,\n\t\"./mf.svg\": 317,\n\t\"./mg\": 318,\n\t\"./mg.svg\": 318,\n\t\"./mh\": 319,\n\t\"./mh.svg\": 319,\n\t\"./mk\": 320,\n\t\"./mk.svg\": 320,\n\t\"./ml\": 321,\n\t\"./ml.svg\": 321,\n\t\"./mm\": 322,\n\t\"./mm.svg\": 322,\n\t\"./mn\": 323,\n\t\"./mn.svg\": 323,\n\t\"./mo\": 324,\n\t\"./mo.svg\": 324,\n\t\"./mp\": 325,\n\t\"./mp.svg\": 325,\n\t\"./mq\": 326,\n\t\"./mq.svg\": 326,\n\t\"./mr\": 327,\n\t\"./mr.svg\": 327,\n\t\"./ms\": 328,\n\t\"./ms-logo\": 329,\n\t\"./ms-logo.svg\": 329,\n\t\"./ms.svg\": 328,\n\t\"./mt\": 330,\n\t\"./mt.svg\": 330,\n\t\"./mu\": 331,\n\t\"./mu.svg\": 331,\n\t\"./mv\": 332,\n\t\"./mv.svg\": 332,\n\t\"./mw\": 333,\n\t\"./mw.svg\": 333,\n\t\"./mx\": 334,\n\t\"./mx.svg\": 334,\n\t\"./my\": 335,\n\t\"./my.svg\": 335,\n\t\"./mz\": 336,\n\t\"./mz.svg\": 336,\n\t\"./na\": 337,\n\t\"./na.svg\": 337,\n\t\"./nc\": 338,\n\t\"./nc.svg\": 338,\n\t\"./ne\": 339,\n\t\"./ne.svg\": 339,\n\t\"./nf\": 340,\n\t\"./nf.svg\": 340,\n\t\"./ng\": 341,\n\t\"./ng.svg\": 341,\n\t\"./ni\": 342,\n\t\"./ni.svg\": 342,\n\t\"./nl\": 343,\n\t\"./nl.svg\": 343,\n\t\"./no\": 344,\n\t\"./no.svg\": 344,\n\t\"./np\": 345,\n\t\"./np.svg\": 345,\n\t\"./nr\": 346,\n\t\"./nr.svg\": 346,\n\t\"./nu\": 347,\n\t\"./nu.svg\": 347,\n\t\"./nz\": 348,\n\t\"./nz.svg\": 348,\n\t\"./om\": 349,\n\t\"./om.svg\": 349,\n\t\"./pa\": 350,\n\t\"./pa.svg\": 350,\n\t\"./pe\": 351,\n\t\"./pe.svg\": 351,\n\t\"./pf\": 352,\n\t\"./pf.svg\": 352,\n\t\"./pg\": 353,\n\t\"./pg.svg\": 353,\n\t\"./ph\": 354,\n\t\"./ph.svg\": 354,\n\t\"./picture\": 355,\n\t\"./picture.png\": 355,\n\t\"./picture@2x\": 356,\n\t\"./picture@2x.png\": 356,\n\t\"./picture@3x\": 357,\n\t\"./picture@3x.png\": 357,\n\t\"./pk\": 358,\n\t\"./pk.svg\": 358,\n\t\"./pl\": 359,\n\t\"./pl.svg\": 359,\n\t\"./pm\": 360,\n\t\"./pm.svg\": 360,\n\t\"./pn\": 361,\n\t\"./pn.svg\": 361,\n\t\"./pr\": 362,\n\t\"./pr.svg\": 362,\n\t\"./ps\": 363,\n\t\"./ps.svg\": 363,\n\t\"./pt\": 364,\n\t\"./pt-BR\": 365,\n\t\"./pt-BR.svg\": 365,\n\t\"./pt.svg\": 364,\n\t\"./pw\": 366,\n\t\"./pw.svg\": 366,\n\t\"./py\": 367,\n\t\"./py.svg\": 367,\n\t\"./qa\": 368,\n\t\"./qa.svg\": 368,\n\t\"./re\": 369,\n\t\"./re.svg\": 369,\n\t\"./ro\": 370,\n\t\"./ro.svg\": 370,\n\t\"./rs\": 371,\n\t\"./rs.svg\": 371,\n\t\"./ru\": 372,\n\t\"./ru.svg\": 372,\n\t\"./rw\": 373,\n\t\"./rw.svg\": 373,\n\t\"./sa\": 374,\n\t\"./sa.svg\": 374,\n\t\"./sb\": 375,\n\t\"./sb.svg\": 375,\n\t\"./sc\": 376,\n\t\"./sc.svg\": 376,\n\t\"./sd\": 377,\n\t\"./sd.svg\": 377,\n\t\"./se\": 378,\n\t\"./se.svg\": 378,\n\t\"./sg\": 379,\n\t\"./sg.svg\": 379,\n\t\"./sh\": 380,\n\t\"./sh.svg\": 380,\n\t\"./si\": 381,\n\t\"./si.svg\": 381,\n\t\"./sj\": 382,\n\t\"./sj.svg\": 382,\n\t\"./sk\": 383,\n\t\"./sk.svg\": 383,\n\t\"./sl\": 384,\n\t\"./sl.svg\": 384,\n\t\"./sm\": 385,\n\t\"./sm.svg\": 385,\n\t\"./sn\": 386,\n\t\"./sn.svg\": 386,\n\t\"./so\": 387,\n\t\"./so.svg\": 387,\n\t\"./sr\": 388,\n\t\"./sr.svg\": 388,\n\t\"./ss\": 389,\n\t\"./ss.svg\": 389,\n\t\"./st\": 390,\n\t\"./st.svg\": 390,\n\t\"./sv\": 391,\n\t\"./sv.svg\": 391,\n\t\"./sx\": 392,\n\t\"./sx.svg\": 392,\n\t\"./sy\": 393,\n\t\"./sy.svg\": 393,\n\t\"./sz\": 394,\n\t\"./sz.svg\": 394,\n\t\"./tc\": 395,\n\t\"./tc.svg\": 395,\n\t\"./td\": 396,\n\t\"./td.svg\": 396,\n\t\"./tf\": 397,\n\t\"./tf.svg\": 397,\n\t\"./tg\": 398,\n\t\"./tg.svg\": 398,\n\t\"./th\": 399,\n\t\"./th.svg\": 399,\n\t\"./tj\": 400,\n\t\"./tj.svg\": 400,\n\t\"./tk\": 401,\n\t\"./tk.svg\": 401,\n\t\"./tl\": 402,\n\t\"./tl.svg\": 402,\n\t\"./tm\": 403,\n\t\"./tm.svg\": 403,\n\t\"./tn\": 404,\n\t\"./tn.svg\": 404,\n\t\"./to\": 405,\n\t\"./to.svg\": 405,\n\t\"./tr\": 406,\n\t\"./tr.svg\": 406,\n\t\"./tt\": 407,\n\t\"./tt.svg\": 407,\n\t\"./tv\": 408,\n\t\"./tv.svg\": 408,\n\t\"./tw\": 409,\n\t\"./tw.svg\": 409,\n\t\"./tz\": 410,\n\t\"./tz.svg\": 410,\n\t\"./ua\": 411,\n\t\"./ua.svg\": 411,\n\t\"./ug\": 412,\n\t\"./ug.svg\": 412,\n\t\"./um\": 413,\n\t\"./um.svg\": 413,\n\t\"./un\": 414,\n\t\"./un.svg\": 414,\n\t\"./user_pin\": 415,\n\t\"./user_pin.png\": 415,\n\t\"./userdefault\": 416,\n\t\"./userdefault.png\": 416,\n\t\"./userprofile\": 417,\n\t\"./userprofile.png\": 417,\n\t\"./uy\": 418,\n\t\"./uy.svg\": 418,\n\t\"./uz\": 419,\n\t\"./uz.svg\": 419,\n\t\"./va\": 420,\n\t\"./va.svg\": 420,\n\t\"./vc\": 421,\n\t\"./vc.svg\": 421,\n\t\"./ve\": 422,\n\t\"./ve.svg\": 422,\n\t\"./vg\": 423,\n\t\"./vg.svg\": 423,\n\t\"./vi\": 424,\n\t\"./vi.svg\": 424,\n\t\"./vn\": 425,\n\t\"./vn.svg\": 425,\n\t\"./vu\": 426,\n\t\"./vu.svg\": 426,\n\t\"./wf\": 427,\n\t\"./wf.svg\": 427,\n\t\"./ws\": 428,\n\t\"./ws.svg\": 428,\n\t\"./xk\": 429,\n\t\"./xk.svg\": 429,\n\t\"./ye\": 430,\n\t\"./ye.svg\": 430,\n\t\"./yt\": 431,\n\t\"./yt.svg\": 431,\n\t\"./za\": 432,\n\t\"./za.svg\": 432,\n\t\"./zm\": 433,\n\t\"./zm.svg\": 433,\n\t\"./zw\": 434,\n\t\"./zw.svg\": 434\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 468;","module.exports = __webpack_public_path__ + \"media/images/bg-0f0c4071ee02fe249df1fd9b74a9732a.svg\";","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { DirectUpload } from \"@rails/activestorage\";\nexport var AttachmentUpload = /*#__PURE__*/function () {\n function AttachmentUpload(attachment, element) {\n _classCallCheck(this, AttachmentUpload);\n\n this.attachment = attachment;\n this.element = element;\n this.directUpload = new DirectUpload(attachment.file, this.directUploadUrl, this);\n }\n\n _createClass(AttachmentUpload, [{\n key: \"start\",\n value: function start() {\n this.directUpload.create(this.directUploadDidComplete.bind(this));\n }\n }, {\n key: \"directUploadWillStoreFileWithXHR\",\n value: function directUploadWillStoreFileWithXHR(xhr) {\n var _this = this;\n\n xhr.upload.addEventListener(\"progress\", function (event) {\n var progress = event.loaded / event.total * 100;\n\n _this.attachment.setUploadProgress(progress);\n });\n }\n }, {\n key: \"directUploadDidComplete\",\n value: function directUploadDidComplete(error, attributes) {\n if (error) {\n throw new Error(\"Direct upload failed: \".concat(error));\n }\n\n this.attachment.setAttributes({\n sgid: attributes.attachable_sgid,\n url: this.createBlobUrl(attributes.signed_id, attributes.filename)\n });\n }\n }, {\n key: \"createBlobUrl\",\n value: function createBlobUrl(signedId, filename) {\n return this.blobUrlTemplate.replace(\":signed_id\", signedId).replace(\":filename\", encodeURIComponent(filename));\n }\n }, {\n key: \"directUploadUrl\",\n get: function get() {\n return this.element.dataset.directUploadUrl;\n }\n }, {\n key: \"blobUrlTemplate\",\n get: function get() {\n return this.element.dataset.blobUrlTemplate;\n }\n }]);\n\n return AttachmentUpload;\n}();","import { AttachmentUpload } from \"@rails/actiontext/app/javascript/actiontext/attachment_upload\";\r\n\r\nconst maxFileSize = 25 * 1024 * 1024;\r\nconst maxVideoFileSize = 50 * 1024 * 1024;\r\nconst acceptedTypes = [\r\n \"image/jpeg\",\r\n \"image/png\",\r\n \"image/gif\",\r\n \"image/webp\",\r\n \"audio/wav\",\r\n \"audio/mpeg\",\r\n \"audio/webm\",\r\n \"video/mp4\",\r\n \"video/mpeg\",\r\n \"video/webm\",\r\n \"video/x-msvideo\",\r\n \"video/x-ms-wmv\",\r\n \"application/pdf\",\r\n \"application/office-document\",\r\n];\r\n\r\nwindow.addEventListener(\"trix-attachment-add\", async (event) => {\r\n const { attachment, target } = event;\r\n let byteStream = await readFile(attachment.file);\r\n const uint = new Uint8Array(byteStream);\r\n let bytes = [];\r\n uint.forEach((byte) => {\r\n bytes.push(byte.toString(16));\r\n });\r\n const hex = bytes.join(\"\").toUpperCase();\r\n let mimeType = getMimetype(hex);\r\n\r\n if (!acceptedTypes.includes(mimeType)) {\r\n event.preventDefault();\r\n alert(\"File type not supported.\");\r\n attachment.remove();\r\n } else if (\r\n mimeType.includes(\"video\") &&\r\n attachment.file.size > maxVideoFileSize\r\n ) {\r\n event.preventDefault();\r\n attachment.remove();\r\n alert(\"Video file size is too big. The size limit is 50 MB.\");\r\n } else if (\r\n !mimeType.includes(\"video\") &&\r\n attachment.file.size > maxFileSize\r\n ) {\r\n event.preventDefault();\r\n attachment.remove();\r\n alert(\"File size is too big. The size limit is 25 MB.\");\r\n } else {\r\n if (attachment.file) {\r\n const upload = new AttachmentUpload(attachment, target);\r\n upload.start();\r\n }\r\n }\r\n});\r\n\r\nfunction readFile(file) {\r\n return new Promise((resolve, reject) => {\r\n const filereader = new FileReader();\r\n filereader.onloadend = (event) => {\r\n if (event.target.readyState === FileReader.DONE) {\r\n resolve(event.target.result);\r\n }\r\n };\r\n filereader.onerror = reject;\r\n const blob = file.slice(0, 12);\r\n filereader.readAsArrayBuffer(blob);\r\n });\r\n}\r\n\r\nfunction getMimetype(signature) {\r\n if (\r\n signature.startsWith(\"FFFB\") ||\r\n signature.startsWith(\"FFF3\") ||\r\n signature.startsWith(\"FFF2\") ||\r\n signature.startsWith(\"494433\")\r\n ) {\r\n return \"audio/mpeg\";\r\n } else if (signature.startsWith(\"4F676753\")) {\r\n return \"audio/webm\";\r\n } else if (signature.startsWith(\"52494646\")) {\r\n return getRIFFBasedMimeType(signature);\r\n } else if (\r\n signature.startsWith(\"FFD8FFDB\") ||\r\n signature.startsWith(\"FFD8FFE0\")\r\n ) {\r\n return \"image/jpeg\";\r\n } else if (signature.startsWith(\"89504E47\")) {\r\n return \"image/png\";\r\n } else if (signature.startsWith(\"47494638\")) {\r\n return \"image/gif\";\r\n } else if (\r\n signature.startsWith(\"000001BA\") ||\r\n signature.startsWith(\"000001B3\")\r\n ) {\r\n return \"video/mpeg\";\r\n } else if (signature.startsWith(\"1A45DFA3\")) {\r\n return \"video/webm\";\r\n } else if (signature.startsWith(\"3026B275\")) {\r\n return \"video/x-ms-wmv\";\r\n } else if (signature.startsWith(\"25504446\")) {\r\n return \"application/pdf\";\r\n } else if (\r\n signature.startsWith(\"D0CF11E0A1B11AE1\") ||\r\n signature.startsWith(\"504B34140608000\")\r\n ) {\r\n return \"application/office-document\";\r\n } else {\r\n return checkOffsets(signature);\r\n }\r\n}\r\n\r\nfunction getRIFFBasedMimeType(signature) {\r\n if (signature.endsWith(\"57415645\")) {\r\n return \"audio/wav\";\r\n } else if (signature.endsWith(\"41564920\")) {\r\n return \"video/x-msvideo\";\r\n } else if (signature.endsWith(\"57454250\")) {\r\n return \"image/webp\";\r\n } else {\r\n return \"Unknown filetype\";\r\n }\r\n}\r\n\r\nfunction checkOffsets(signature) {\r\n if (signature.substring(5, signature.length - 1).startsWith(\"66747970\")) {\r\n return \"video/mp4\";\r\n } else {\r\n return \"Unknown filetype\";\r\n }\r\n}\r\n"],"sourceRoot":""}