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,CAClB2B,OAAQ,UACRC,MAAO,UAIgClC,GAAK,mLAIxCgC,EAAG,cAEX,CAEAvD,SAAS2C,iBAAiB,iBAAiB,SAACe,GAC1C,IAAMH,EAAMG,EAAMC,OAAO,GAAG3B,kBAAkB,aACxCT,EAAOmC,EAAMC,OAAO,GAAG3B,kBAAkB,kBAC5B,kBAATuB,GACRD,EAAgBC,EAAKhC,EAEzB,IAEA,K","sources":["webpack://app/./app/javascript/common/controllers/ sync _controller\\.js$","webpack://app/./app/javascript/common/controllers/cookie_banner_controller.js","webpack://app/./app/javascript/helpers/cookies_helper.js","webpack://app/./app/javascript/access/registration_form.js","webpack://app/./app/javascript/access/index.js","webpack://app/./app/javascript/packs/access.js","webpack://app/./app/javascript/packs/xhr_flash_errors.js"],"sourcesContent":["var map = {\n\t\"./cookie_banner_controller.js\": 29619,\n\t\"common/controllers/cookie_banner_controller.js\": 29619\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 = 94190;","import { Controller } from \"stimulus\"\nimport { getCookie } from \"../../helpers/cookies_helper\"\n\nexport default class CookieBannerController extends Controller {\n static targets = [\"banner\"]\n\n connect() {\n this.checkCookieBannerStatus()\n }\n \n accept() {\n this.hideBanner()\n this.acceptCookieBanner()\n }\n \n hideBanner() {\n this.bannerTarget.style.display = \"none\"\n }\n\n acceptCookieBanner() {\n const expiryDate = new Date()\n expiryDate.setFullYear(expiryDate.getFullYear() + 1) // Set the cookie to expire in 1 year\n document.cookie = `cookie_notice=accepted; expires=${expiryDate.toUTCString()}; path=/`\n }\n\n checkCookieBannerStatus() {\n const cookieBanner = this.getCookieBannerStatus()\n if (cookieBanner) {\n this.hideBanner()\n }\n }\n \n getCookieBannerStatus() {\n const cookieValue = getCookie(\"cookie_notice\")\n return cookieValue === \"accepted\"\n }\n}\n","export function getCookie(cname) {\n var name = cname + \"=\";\n var ca = document.cookie.split(';');\n for(var i = 0; i < ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name) == 0) {\n return c.substring(name.length, c.length);\n }\n }\n return \"\";\n}\n","import showAjaxMessage from \"../packs/xhr_flash_errors\"\n\nfunction checkSignUpAgreements() {\n const button = document.getElementById('js-agree-enabled-button');\n if (button) {\n const tosAndPpCheckBox = document.getElementById('js-accepted-tos-and-pp');\n\n const enableButton = function() {\n if(tosAndPpCheckBox.checked) {\n button.removeAttribute('disabled')\n } else {\n button.setAttribute('disabled', 'disabled')\n }\n }\n\n tosAndPpCheckBox.addEventListener('change', enableButton, false);\n enableButton();\n }\n}\n\nfunction loadCountriesList() {\n const countriesSelect = document.getElementById('js-country-select');\n if(!countriesSelect) {\n return false;\n }\n\n fetchCountriesAndPreselect(countriesSelect);\n}\n\nfunction loadPhoneCountryCodesList() {\n const countriesSelect = document.getElementById('js-phone-number-country-code-select');\n if(!countriesSelect) {\n return false;\n }\n\n fetchCountriesAndPreselect(countriesSelect);\n}\n\nfunction fetchCountriesAndPreselect(countriesSelect) {\n Rails.ajax({\n url: countriesSelect.getAttribute('data-url'),\n type: 'get',\n dataType: 'json',\n success: (data, statusText, xhr) => {\n countriesSelect.innerHTML = countriesSelect.innerHTML + data.options\n // the header added by CDN edge function (CloudFront)\n const viewerCountryCode = xhr.getResponseHeader('X-237-Global-Viewer-Country');\n const selectedCountryCode = countriesSelect.getAttribute('data-selected-country-code');\n if (selectedCountryCode) {\n countriesSelect.value = selectedCountryCode;\n } else if (viewerCountryCode) {\n countriesSelect.value = viewerCountryCode;\n } else {\n countriesSelect.value = 'US';\n }\n }\n });\n}\n\nexport function initWebSignUp() {\n const webSignUpForm = document.getElementById('js-web-sign-up-form')\n if(!webSignUpForm) {\n return false;\n }\n checkSignUpAgreements();\n loadCountriesList();\n loadPhoneCountryCodesList();\n}\n","import './styles'\nimport { initWebSignUp } from './registration_form'\n\ndocument.addEventListener('turbolinks:load', function () {\n initWebSignUp();\n})","import { Application } from \"stimulus\"\nimport { definitionsFromContext } from \"stimulus/webpack-helpers\"\nimport 'bootstrap/dist/css/bootstrap';\nimport 'bootstrap/dist/js/bootstrap';\n\nimport './xhr_flash_errors';\nimport 'access';\n\nconst application = Application.start()\nconst context = require.context(\"../common/controllers\", true, /_controller\\.js$/)\napplication.load(definitionsFromContext(context))\n","function showAjaxMessage(msg, type) {\n const error_types = {\n notice: 'success',\n alert: 'danger'\n };\n\n document.getElementById('flashContainer').innerHTML =\n ``;\n}\n\ndocument.addEventListener('ajax:complete', (event) => {\n const msg = event.detail[0].getResponseHeader('X-Message');\n const type = event.detail[0].getResponseHeader('X-Message-Type');\n if(typeof(msg) === 'string') {\n showAjaxMessage(msg, type)\n }\n});\n\nexport default showAjaxMessage\n"],"names":["map","webpackContext","req","id","webpackContextResolve","__webpack_require__","o","e","Error","code","keys","Object","resolve","module","exports","CookieBannerController","_Controller","apply","arguments","_proto","prototype","connect","this","checkCookieBannerStatus","accept","hideBanner","acceptCookieBanner","bannerTarget","style","display","expiryDate","Date","setFullYear","getFullYear","document","cookie","toUTCString","getCookieBannerStatus","getCookie","Controller","targets","cname","name","ca","split","i","length","c","charAt","substring","indexOf","fetchCountriesAndPreselect","countriesSelect","Rails","ajax","url","getAttribute","type","dataType","success","data","statusText","xhr","innerHTML","options","viewerCountryCode","getResponseHeader","selectedCountryCode","value","initWebSignUp","getElementById","button","tosAndPpCheckBox","enableButton","checked","removeAttribute","setAttribute","addEventListener","checkSignUpAgreements","loadCountriesList","loadPhoneCountryCodesList","application","Application","start","context","require","load","definitionsFromContext","showAjaxMessage","msg","notice","alert","event","detail"],"sourceRoot":""}