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IACAA,EAAatK,SAAS,MACC,iBAAjBsK,GACmB,iBAAnBD,EAEP,MAAO,GACX,IAAMI,EAAcH,EAAa1K,MAAM,KACvC,GAA2B,IAAvB6K,EAAY1J,OAAc,MAAO,GACrC,IAAM2J,EAAeD,EAChBE,KAAI,SAAAC,GAAG,OAAIA,EAAIhL,MAAM,IAAI,IACzBiL,QAAO,SAAArM,GAAG,OAAIA,EAAI,KAAO6L,CAAc,IAC5C,OAAOK,EAAa3J,OAAS,EAAI2J,EAAa,GAAG,GAAK,EAC1D,CFuCgBI,CAAqB,oBACrB9E,GAA2B,GAT/BtB,EAAOqG,SAAQ,SAAAC,GACPA,EAAMnF,OAAOX,EAAW8F,GAC5BA,EAAMhC,iBAAiB,QAAS9D,GAAY,EAChD,GACJ,EA0LJ,CACH,EA1OD,GA0OkBkF,M","sources":["webpack:///./node_modules/@babel/runtime/helpers/typeof.js","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///./html/wp-content/themes/ls/src/js/utils/cors/getEndpoint.ts","webpack:///./html/wp-content/themes/ls/src/js/utils/cors/cors.js","webpack:///./html/wp-content/themes/ls/src/js/utils/errorReporting/LoggingHandler.ts","webpack:///./html/wp-content/themes/ls/src/js/utils/serialize/serializeForm.js","webpack:///./html/wp-content/themes/ls/src/js/utils/isMobile.js","webpack:///./html/wp-content/themes/ls/src/js/page/restaurant.js","webpack:///./html/wp-content/themes/ls/src/js/utils/serialize/serialize.js","webpack:///./html/wp-content/themes/ls/src/js/utils/URLParams/URLParams.js"],"sourcesContent":["function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","////////////////////////////////////// WARNING ///////////////////////////////////////////////\n//! THIS UTILITY FUNCTION HAS BEEN COPIED INTO MULTIPLE REPOSITORIES.\n//! ANY CHANGES MADE HERE MUST BE COPIED OVER TO THE FOLLOWING FILES:\n// - tools/food-cost-calculator/src/helpers/getEndpoint.ts\n// - html/wp-content/plugins/ls_import/src/helpers/getEndpoint.ts\n//////////////////////////////////////////////////////////////////////////////////////////////\n\nconst subdirectoryList: { ch: string; dech: string } = {\n ch: '/ch',\n dech: '/ch-de',\n};\n\ntype SubDirKeys = keyof typeof subdirectoryList;\n\nconst removeTrailingSlash = (url: string): string => url.replace(/\\/$/g, '');\n\nconst isPathInSubdirectoryValues = (subdirPath: string) =>\n Object.values(subdirectoryList).includes(subdirPath);\nconst extractSubdirectoryFromPathName = () => {\n const subdir = window.location.pathname.split('/')[1];\n const subdirPath = subdir ? `/${subdir}` : '';\n return isPathInSubdirectoryValues(subdirPath) ? subdirPath : '';\n};\n\nconst domain: string = document.body.dataset.domain ?? '';\n\nconst isSubdirectory = (domain: string) => domain in subdirectoryList;\nconst createPathFromDomain = (domain: string) => {\n if (domain) {\n if (!isSubdirectory(domain)) return ''; // This applies to all root domains including hq, nl, etc.\n\n const subdirectory: SubDirKeys = domain as SubDirKeys;\n return removeTrailingSlash(subdirectoryList[subdirectory]);\n }\n if (!extractSubdirectoryFromPathName()) return '';\n\n return removeTrailingSlash(extractSubdirectoryFromPathName());\n};\n\nconst isRelativeURL = (url: string) => url.startsWith('/');\n\nconst getEndpoint = (url = '') => {\n return isRelativeURL(url) ? createPathFromDomain(domain) + url : url;\n};\n\nexport { getEndpoint };\n","/*\nXXX_JSREFACTOR_XXX\ntodo @JSREFACTOR\n - possibly replace all instances with built-in async/await function\n*/\n\nimport { getEndpoint } from 'root/utils/cors/getEndpoint';\n\nconst CORS = {\n /**\n * Make a X-Domain request to url and callback.\n *\n * @param url {String}\n * @param method {String} HTTP verb ('GET', 'POST', 'DELETE', etc.)\n * @param data {String} request body\n * @param callback {Function} to callback on completion\n * @param errback {Function} to callback on error\n */\n xdr: function (url, method, data, callback, errback, withCredentials = false) {\n let invocation;\n url = getEndpoint(url);\n\n if (XMLHttpRequest) {\n invocation = new XMLHttpRequest();\n\n if ('withCredentials' in invocation) {\n invocation.open(method, url, true);\n invocation.withCredentials = withCredentials;\n invocation.onerror = errback;\n invocation.setRequestHeader(\n 'Content-Type',\n 'application/x-www-form-urlencoded'\n );\n invocation.onreadystatechange = function () {\n if (invocation.readyState === 4) {\n if (invocation.status >= 200 && invocation.status < 400) {\n callback(invocation.responseText, invocation.status);\n } else {\n errback(invocation.responseText, invocation.status);\n }\n }\n };\n invocation.send(data);\n }\n\n invocation.onerror = function () {\n errback(new Error('Network Interruption Error Occurred'));\n };\n } else if (XDomainRequest) {\n invocation = new XDomainRequest();\n invocation.open(method, url);\n invocation.onerror = errback;\n invocation.onload = function () {\n callback(invocation.responseText);\n };\n invocation.send(data);\n } else {\n errback(new Error('CORS not supported'));\n }\n },\n};\n\nexport { CORS };\n","declare global {\n // eslint-disable-next-line no-unused-vars\n interface Window {\n DD_RUM: LoggingObject | undefined;\n }\n}\n\ntype TagTypes =\n | 'forms'\n | 'fetch'\n | 'navigation'\n | 'ui'\n | 'login'\n | 'restaurant'\n | 'dynamic-pages'\n | 'gtm-tracking'\n | 'hooks'\n | 'recaptcha'\n | 'pricing'\n | 'lexic'\n | 'cookies'\n | 'email'\n | 'email_syntax'\n | 'email_domain'\n | 'sms_optin';\n\ninterface Context {\n searchTerm: string;\n fileName: string;\n tags?: Array;\n additionalData?: object;\n}\n\ninterface LoggingObject {\n addAction?(\n // eslint-disable-next-line no-unused-vars\n actionName: string,\n // eslint-disable-next-line no-unused-vars\n context: Context | undefined\n ): void;\n addError?(error: unknown, context: Context | undefined): void;\n}\n\nfunction LoggingHandler() {\n const LOGGINGSERVICEKEY = 'DD_RUM';\n const loggingObject = window[LOGGINGSERVICEKEY] as LoggingObject;\n\n function isEnabled() {\n return typeof window[LOGGINGSERVICEKEY] !== 'undefined';\n }\n\n // logs an intentional action from a user in Datadog that isn't already being captured automatically (ex. logging into the site, solving a recaptcha, successfully submitting a form etc.)\n function logUserAction(actionName: string, context?: Context | undefined) {\n if (!isEnabled() || !loggingObject.addAction)\n return (obj: object) =>\n console.warn(`${LOGGINGSERVICEKEY} is not in the DOM.`, obj);\n return loggingObject.addAction(actionName, context);\n }\n\n // logs an error that is being deliberately thrown in our codebase\n function logError(error: string, context?: Context | undefined) {\n if (!isEnabled() || !loggingObject.addError) {\n return (obj: object) =>\n console.warn(`${LOGGINGSERVICEKEY} is not in the DOM.`, obj);\n }\n return loggingObject.addError(new Error(JSON.stringify(error)), context);\n }\n\n return {\n logUserAction,\n logError,\n };\n}\n\nexport { LoggingHandler, TagTypes };\n","/*\nXXX_JSREFACTOR_XXX\ntodo @JSREFACTOR\n - write unit tests for different use cases\n*/\n\nimport { Serialize } from 'root/utils/serialize/serialize';\n\nconst SerializeForm = function () {\n const pair = function (key, value) {\n this.key = key;\n this.value = value;\n };\n pair.prototype = {\n getKey() {\n return this.key;\n },\n getValue() {\n return this.value;\n },\n isSet() {\n return typeof this.key !== 'undefined' && typeof this.value !== 'undefined';\n },\n };\n\n function form(formElement) {\n const data = scrapeForm(formElement);\n return Serialize(data);\n }\n\n function scrapeForm(formElement) {\n const obj = {};\n const formElements = formElement.querySelectorAll('input, select, textarea');\n for (let i = 0; i < formElements.length; ++i) {\n const pair = getKeyValuePairFormElement(formElements[i]);\n if (pair.isSet()) {\n obj[pair.getKey()] = pair.getValue();\n }\n }\n return obj;\n }\n\n function getKeyValuePairFormElement(formElement) {\n const formElementType = formElement.type;\n switch (formElementType) {\n case 'checkbox': {\n const isChecked = formElement.checked ? 1 : 0;\n return new pair(formElement.name, isChecked);\n }\n default:\n return new pair(formElement.name, formElement.value);\n }\n }\n\n return {\n form,\n };\n};\n\nexport { SerializeForm };\n","let isMobile = {\n devices: [\n 'Silk',\n 'Playbook',\n 'Nexus 7',\n 'Nexus 10',\n 'Tablet',\n 'Mobile',\n 'iPhone',\n 'iPod',\n 'iPad',\n ],\n\n inMobileDeviceList() {\n return isMobile.devices.some(\n device => navigator.appVersion.indexOf(device) !== -1\n );\n },\n\n // Values are taken from the max width of iPhone 8+ (414px) and max height of iPhone X (812px)\n hasMobileDeviceSize() {\n return (\n document.documentElement.clientWidth < 415 &&\n document.documentElement.clientHeight < 813\n );\n },\n};\nexport { isMobile };\n","import { CORS } from 'root/utils/cors/cors';\nimport { LoggingHandler } from 'root/utils/errorReporting/LoggingHandler';\nimport { SerializeForm } from 'root/utils/serialize/serializeForm';\nimport { isMobile } from 'root/utils/isMobile';\nimport { getParamValueFromUrl } from 'root/utils/URLParams/URLParams';\n\n(function (SerializeForm) {\n const pageLogin = document.querySelector('[data-restaurant-login=container]');\n\n if (pageLogin) {\n let formData;\n let boxContent = pageLogin.querySelector('[data-restaurant-login=box-content]');\n let contentLoginError = boxContent.querySelector(\n '[data-restaurant-login=content-login-error]'\n );\n let contentLoginErrorMessage = contentLoginError.querySelector(\n '[data-restaurant-login=content-login-error-message]'\n );\n let contentForgottenEmail = boxContent.querySelector(\n '[data-restaurant-login=content-forgotten-email]'\n );\n let contentForgottenEmailSent = boxContent.querySelector(\n '[data-restaurant-login=content-forgotten-email-sent]'\n );\n let boxForms = pageLogin.querySelector('[data-restaurant-login=box-forms]');\n let formLogin = boxForms.querySelector('[data-restaurant-login=forms-login]');\n let formForgotten = boxForms.querySelector(\n '[data-restaurant-login=forms-forgotten]'\n );\n let footerLostPassword = pageLogin.querySelector(\n '[data-restaurant-login=footer-lost-password]'\n );\n let footerBackToLogin = pageLogin.querySelector(\n '[data-restaurant-login=footer-back-to-login]'\n );\n let inputs = pageLogin.querySelectorAll('.gb-form__field-text');\n const loggingHandlerDetailsObj = {\n tags: ['forms', 'login', 'restaurant'],\n fileName: 'restaurant.js',\n };\n const urls = {\n // (http://euw2.posios.com/PosServer/JSON-RPC)\n registrationUrl: 'https://euw2.posios.com/PosServer/RegistrationServlet',\n managementUrl: 'https://euw2.posios.com/management/index.html',\n };\n\n let init = () => {\n eventBinder();\n showForgotPasswordFormBasedOnUrlParam();\n inputs.forEach(input => {\n if (input.value) raiseLabel(input);\n input.addEventListener('focus', raiseLabel, false);\n });\n };\n\n const showForgotPasswordFormBasedOnUrlParam = () => {\n return (\n getParamValueFromUrl('forgot-password') &&\n displayFormBasedOnLostPass(false)\n );\n };\n\n let eventBinder = () => {\n formLogin.addEventListener('submit', eventHandler);\n footerLostPassword.addEventListener(\n 'click',\n displayFormBasedOnLostPass.bind(this, false)\n );\n footerBackToLogin.addEventListener(\n 'click',\n displayFormBasedOnLostPass.bind(this, true)\n );\n formForgotten.addEventListener('submit', sendTheEmailForReset);\n };\n\n const raiseLabel = e => {\n const input = e.currentTarget || e;\n const label = input.parentElement.querySelector('.gb-form__field-label');\n label.classList.add('js-raised');\n };\n\n let eventHandler = e => {\n e.preventDefault();\n controlVisibility(contentLoginError, false);\n formData = {\n username: encodeURIComponent(\n formLogin.querySelector('[data-restaurant-login=input-email]').value\n ),\n password: encodeURIComponent(\n formLogin.querySelector('[data-restaurant-login=input-password]')\n .value\n ),\n };\n login(formData, urls.registrationUrl, urls.managementUrl);\n return false;\n };\n\n let displayFormBasedOnLostPass = showForm => {\n controlVisibility(formLogin, showForm);\n controlVisibility(formForgotten, !showForm);\n controlVisibility(contentLoginError, false);\n controlVisibility(contentForgottenEmail, !showForm);\n controlVisibility(contentForgottenEmailSent, false);\n controlVisibility(footerLostPassword, showForm);\n controlVisibility(footerBackToLogin, !showForm);\n };\n\n let sendTheEmailForReset = e => {\n let url = '/rest/resto/Resto-forgot-password';\n if (!validateForm(formForgotten)) {\n return false;\n }\n CORS.xdr(\n url,\n 'POST',\n SerializeForm().form(formForgotten),\n formResetCallback,\n formResetCallback\n );\n\n if (e.preventDefault) {\n e.preventDefault();\n } else {\n e.returnValue = false;\n }\n };\n\n let controlVisibility = (el, bool = false) => {\n el.style.opacity = bool ? 1 : 0;\n el.style.transition = 'opacity 0.5s';\n setTimeout(() => {\n el.style.display = bool ? 'block' : 'none';\n }, 500);\n };\n\n let login = (formData, url, murl) => {\n if (!validateForm(formLogin)) {\n return false;\n }\n loggingHandlerDetailsObj.searchTerm = 'resto-login-initiated';\n LoggingHandler().logUserAction(\n 'User loaded the restaurant login page',\n loggingHandlerDetailsObj\n );\n sendData(formData, url, murl);\n };\n\n let validateForm = formEl => {\n if (typeof formEl === 'object' && formEl.nodeName.toLowerCase() === 'form') {\n return Array.from(getFormFields(formEl)).every(field =>\n field.checkValidity()\n );\n }\n };\n\n let formResetCallback = () => {\n controlVisibility(formForgotten, false);\n controlVisibility(contentForgottenEmail, false);\n controlVisibility(contentForgottenEmailSent, true);\n };\n\n let sendData = (formData, url, murl) => {\n let XHR = new XMLHttpRequest();\n XHR.open('POST', url);\n XHR.setRequestHeader(\n 'Content-Type',\n 'application/x-www-form-urlencoded; charset=UTF-8'\n );\n XHR.withCredentials = false;\n // on success\n XHR.addEventListener('load', XHRLoadCallBack.bind(this, XHR, murl));\n // on error\n XHR.addEventListener('error', XHRErrorCallBack);\n // send data\n XHR.send(\n `method=login&username=${formData.username}&password=${formData.password}`\n );\n };\n\n let getFormFields = formEl => formEl.querySelectorAll('input,select,textarea');\n\n let XHRLoadCallBack = (XHR, murl) => {\n let data = JSON.parse(XHR.responseText.replace(/'/g, '\"'));\n // in case of user error\n if (data != null && data.error != null) {\n let msg = String(data.error); //the error message coming from data.error is: \"Invalid user credentials\"\n controlVisibility(contentLoginError, true);\n contentLoginErrorMessage.innerText = msg;\n\n loggingHandlerDetailsObj.searchTerm = 'resto-login-xhr-load-errors';\n LoggingHandler().logError(msg, loggingHandlerDetailsObj);\n } else if (XHR.status >= 200 && XHR.status < 400) {\n if (data.server !== null && data.server !== undefined) {\n let protocol = 'https';\n loggingHandlerDetailsObj.searchTerm = 'resto-login-found-server';\n LoggingHandler().logUserAction(\n 'Login page found resto-login server',\n loggingHandlerDetailsObj\n );\n login(\n formData,\n `${protocol}://${data.server}/PosServer/RegistrationServlet`,\n `${protocol}://${data.server}/management/index.html`\n );\n } else {\n let pnm = '';\n let pass_for_ipad_login = '';\n if (window.location.href.indexOf('restaurant/app-signup') > -1) {\n pass_for_ipad_login = `&password=${formData.password}`;\n }\n if (urls.managementUrl !== murl) {\n let array = murl.split('/')[2].split(':');\n pnm = `&pnm=switchServer&port=443&server=${array[0]}&extension=/PosServer/JSON-RPC`;\n }\n //redirect\n loggingHandlerDetailsObj.searchTerm = 'resto-login-redirecting-user';\n LoggingHandler().logUserAction(\n 'Login page is redirecting the user',\n loggingHandlerDetailsObj\n );\n let red = `${murl}?token=${data.token + pass_for_ipad_login}&`;\n let isMobileOrTablet = isMobile.inMobileDeviceList();\n let version = isMobileOrTablet ? 'version=1.0' : '';\n window.location = `${red}${version}&redirect=site${pnm}`;\n }\n }\n };\n\n let XHRErrorCallBack = function (e) {\n e.preventDefault();\n loggingHandlerDetailsObj.searchTerm = 'resto-login-xhr-errors';\n loggingHandlerDetailsObj.additionalData.error_email = `email:${formData.username}`;\n LoggingHandler().logError(this.statusText, loggingHandlerDetailsObj);\n controlVisibility(contentLoginError, true);\n };\n\n return {\n init,\n };\n }\n})(SerializeForm).init();\n","/**\n * @return {string}\n */\nfunction Serialize(obj, prefix) {\n const str = [];\n for (let p in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, p)) {\n const key = prefix ? `${prefix}[${p}]` : p;\n const value = obj[p];\n if (value !== null && typeof value === 'object') {\n str.push(this.Serialize(value, key));\n } else {\n str.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`);\n }\n }\n }\n return str.join('&');\n}\n\nfunction Deserialize(str) {\n return str\n ? JSON.parse(\n '{\"' + str.replace(/&/g, '\",\"').replace(/=/g, '\":\"') + '\"}',\n function (key, value) {\n return key === '' ? value : decodeURIComponent(value);\n }\n )\n : {};\n}\nexport { Serialize, Deserialize };\n","const getParamValueFromUrl = function (\n targetParamKey,\n paramsString = window.location.search.substring(1)\n) {\n if (\n !targetParamKey ||\n !paramsString ||\n !paramsString.includes('=') ||\n typeof paramsString !== 'string' ||\n typeof targetParamKey !== 'string'\n )\n return '';\n const paramsArray = paramsString.split('&');\n if (paramsArray.length === 0) return '';\n const paramResults = paramsArray\n .map(val => val.split('='))\n .filter(key => key[0] === targetParamKey);\n return paramResults.length > 0 ? paramResults[0][1] : '';\n};\nconst paramsToObject = function (paramsString = window.location.search.substring(1)) {\n const jsonObject = `{\"${paramsString.replace(/&/g, '\",\"').replace(/=/g, '\":\"')}\"}`;\n\n return paramsString\n ? JSON.parse(jsonObject, (key, value) =>\n key === '' ? value : decodeURIComponent(value)\n )\n : {};\n};\nconst createParams = source => {\n if (\n typeof source === 'string' ||\n (Object.constructor === Object && Object.entries(source).length === 0) ||\n (Array.isArray(source) && source.length === 0)\n )\n return '';\n const array = [];\n for (let key in source) {\n array.push(`${encodeURIComponent(key)}=${encodeURIComponent(source[key])}`);\n }\n return array.join('&');\n};\n\nexport { getParamValueFromUrl, paramsToObject, createParams };\n"],"names":["_typeof","obj","Symbol","iterator","module","exports","constructor","prototype","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","prop","hasOwnProperty","call","subdirectoryList","ch","dech","removeTrailingSlash","url","replace","extractSubdirectoryFromPathName","subdir","window","location","pathname","split","subdirPath","concat","values","includes","isPathInSubdirectoryValues","domain","_document$body$datase","document","body","dataset","CORS","method","data","callback","errback","invocation","withCredentials","arguments","length","startsWith","isRelativeURL","isSubdirectory","createPathFromDomain","getEndpoint","XMLHttpRequest","open","onerror","setRequestHeader","onreadystatechange","readyState","status","responseText","send","Error","XDomainRequest","onload","LoggingHandler","LOGGINGSERVICEKEY","loggingObject","isEnabled","logUserAction","actionName","context","addAction","console","warn","logError","error","addError","JSON","stringify","isMobile","devices","inMobileDeviceList","some","device","navigator","appVersion","indexOf","hasMobileDeviceSize","documentElement","clientWidth","clientHeight","_this","pageLogin","querySelector","formData","boxContent","contentLoginError","contentLoginErrorMessage","contentForgottenEmail","contentForgottenEmailSent","boxForms","formLogin","formForgotten","footerLostPassword","footerBackToLogin","inputs","querySelectorAll","loggingHandlerDetailsObj","tags","fileName","urls","registrationUrl","managementUrl","raiseLabel","e","currentTarget","parentElement","classList","add","eventHandler","preventDefault","controlVisibility","username","encodeURIComponent","value","password","login","displayFormBasedOnLostPass","showForm","sendTheEmailForReset","validateForm","pair","this","getKeyValuePairFormElement","formElement","type","isChecked","checked","name","getKey","getValue","isSet","form","prefix","str","p","push","Serialize","join","formElements","i","scrapeForm","SerializeForm","formResetCallback","returnValue","el","bool","style","opacity","transition","setTimeout","display","murl","searchTerm","sendData","formEl","nodeName","toLowerCase","Array","from","getFormFields","every","field","checkValidity","XHR","addEventListener","XHRLoadCallBack","bind","XHRErrorCallBack","parse","msg","String","innerText","server","protocol","pnm","pass_for_ipad_login","href","array","red","token","version","additionalData","error_email","statusText","init","targetParamKey","paramsString","search","substring","paramsArray","paramResults","map","val","filter","getParamValueFromUrl","forEach","input"],"sourceRoot":""}