{"version":3,"file":"Utils.js","names":["defineDs","m","Utils","QuickLink","LoginSSO","Overlay","ModalDialog","Dictionary","defaultReceiptRedirect","get","hasObjectProperty","obj","path","options","args","split","params","extend","getValue","i","length","hasOwnProperty","populateUrlWithAssertionIdAndLoginId","url","callback","relay","data","assertionId","loginId","initialQueryCharacter","indexOf","finalUrl","encodeURIComponent","ready","then","d","bind","prefix","dialogcontent","overlay","buttons","text","close","show","getValidAppRedirectUrl","getParameter","getDefaultRedirectUrl","decodedUrl","decodeURIComponent","isAppUrl","repopulateUrlWithAssertionIdAndLoginId","populatedUrl","window","location","href","currentJossoAssertionId","currentLoginId","replace","checkEncodeURI","str","test","matches","some","match","urlContainsLoginInformation","every","toLowerCase","cookie","DS","Config","CONTEXT","Url","origin","getRedirectUrlWithDsApplicationIdAndReturnUrl","dsApplicationId","dsApplicationConfig","ApplicationId","returnUrl","hash","substr","undefined","key","queryString","search","substring","charAt","keyVal","deleteParameter","newUrlQuery","push","join","replaceParameterValue","val","appendParameter","queryKey","queryValue","pathname","existingParams","assignMethod","Object","assign","formatDate","date","toLocaleDateString","toLocaleTimeString","slice","formatDateShort","getDate","getMonth","getHours","getMinutes","formatDateOnly","day","month","getFullYear","getPreviousDatesFromToday","count","descending","arguments","today","Date","dates","calculatedDate","setDate","dateWithoutTime","reverse","formatCurrencyWithoutDecimals","amount","toString","formatCurrency","Number","toFixed","formatInputValue","value","inputValue","parts","convertCentsToKroner","parseInt","convertKronerToCents","convertCentsToKronerAndFormat","scrollToError","error","document","querySelectorAll","routeSlide","elemOffsetY","offsetTop","isFixed","routeSlideStyle","getComputedStyle","getPropertyValue","scrollTopPos","scrollTo","top","behavior","fileExtension","filename","lastIndexOf","sortCardsList","cardsList","sort","a","b","isPrimaryCard","cardExpirationDate","expired","uniqueParams","querySplit","paramsSplit","unique","param","replaceDynamicText","replacements","replacementKeys","keys","RegExp","chunks","inputArray","chunkSize","result","reduce","resultArray","item","index","chunkIndex","Math","floor","getPercentageOfSize","size","totalSize","sumAllTransactionPeriods","type","periods","initialSum","sum","previousValue","currentPeriod","isTopFrame","self","calculateAge","dateString","year","timeNow","body","getAttribute","century","birthDate","age","isApp"],"sources":["DanskeSpil/Framework/PlayerAccountManagement/Scripts/Helpers/Utils.js"],"sourcesContent":["defineDs('DanskeSpil/Framework/PlayerAccountManagement/Scripts/Helpers/Utils', [\r\n 'Shared/Framework/Mithril/Scripts/Core/Mithril',\r\n 'Shared/Framework/Mithril/Scripts/Helpers/Utils',\r\n 'Shared/Framework/Mithril/Scripts/Helpers/QuickLink',\r\n 'DanskeSpil/Domain/Authentification/Scripts/LoginSSO',\r\n 'Shared/Framework/Mithril/Scripts/Templates/Overlay',\r\n 'DanskeSpil/Framework/PlayerAccountManagement/Scripts/Templates/ModalDialog',\r\n 'DanskeSpil/Framework/PlayerAccountManagement/Scripts/Helpers/Dictionary'\r\n], function (m, Utils, QuickLink, LoginSSO, Overlay, ModalDialog, Dictionary) {\r\n\r\n var defaultReceiptRedirect = new QuickLink('/AccountOverview').get;\r\n\r\n // Functions:\r\n var hasObjectProperty = function (obj, path, options) {\r\n var args = path.split('.');\r\n var params = Utils.extend(true, {\r\n getValue: false\r\n }, options);\r\n\r\n for (var i = 0; i < args.length; i++) {\r\n if (!obj || !obj.hasOwnProperty(args[i])) {\r\n return false;\r\n }\r\n obj = obj[args[i]];\r\n }\r\n if (params.getValue) {\r\n return obj;\r\n } else {\r\n return true;\r\n }\r\n };\r\n\r\n var populateUrlWithAssertionIdAndLoginId = function (url, callback) {\r\n LoginSSO.relay(function (data) {\r\n if (data.assertionId && data.loginId) {\r\n var assertionId = data.assertionId;\r\n var loginId = data.loginId;\r\n var initialQueryCharacter = url.indexOf('?') > -1 ? '&' : '?';\r\n var finalUrl = url + initialQueryCharacter + 'josso_assertion_id=' + assertionId + '&loginId=' + encodeURIComponent(loginId);\r\n callback(finalUrl);\r\n } else {\r\n Dictionary.ready.then(function () {\r\n var d = Dictionary.get.bind({ prefix: 'GeneralErrorHandler/' });\r\n var dialogcontent = [\r\n m('h1', d('Headline')),\r\n m('p', d('BodyText'))\r\n ];\r\n var overlay = new Overlay(ModalDialog(dialogcontent, {\r\n buttons: [\r\n {\r\n text: d('ButtonText'), callback: function (close) {\r\n close();\r\n }\r\n }\r\n ]\r\n }));\r\n overlay.show();\r\n });\r\n }\r\n });\r\n };\r\n\r\n var getValidAppRedirectUrl = function () {\r\n var url = getParameter('signupSuccessUrl') || getParameter('returnUrl') || getDefaultRedirectUrl();\r\n var decodedUrl = decodeURIComponent(url);\r\n\r\n if (isAppUrl(decodedUrl)) {\r\n repopulateUrlWithAssertionIdAndLoginId(decodedUrl, function (populatedUrl) {\r\n window.location.href = populatedUrl;\r\n });\r\n\r\n } else {\r\n window.location.href = decodedUrl;\r\n }\r\n };\r\n\r\n var repopulateUrlWithAssertionIdAndLoginId = function (url, callback) {\r\n LoginSSO.relay(function (data) {\r\n if (data.assertionId && data.loginId) {\r\n var assertionId = data.assertionId;\r\n var loginId = data.loginId;\r\n var initialQueryCharacter = url.indexOf('?') > -1 ? '&' : '?';\r\n\r\n var currentJossoAssertionId = getParameter('josso_assertion_id');\r\n var currentLoginId = getParameter('loginId');\r\n\r\n var finalUrl;\r\n if (currentJossoAssertionId && currentLoginId) {\r\n url.replace(currentJossoAssertionId, assertionId);\r\n url.replace(currentLoginId, loginId);\r\n finalUrl = url;\r\n } else if (currentJossoAssertionId && !currentLoginId) {\r\n url.replace(currentJossoAssertionId, assertionId);\r\n finalUrl = url + '&loginId=' + encodeURIComponent(loginId);\r\n } else if (currentLoginId && !currentJossoAssertionId) {\r\n url.replace(currentLoginId, loginId);\r\n finalUrl = url + '&josso_assertion_id=' + assertionId;\r\n } else {\r\n finalUrl = url + initialQueryCharacter + 'josso_assertion_id=' + assertionId + '&loginId=' + encodeURIComponent(loginId);\r\n }\r\n callback(finalUrl);\r\n } else {\r\n Dictionary.ready.then(function () {\r\n var d = Dictionary.get.bind({ prefix: 'GeneralErrorHandler/' });\r\n var dialogcontent = [\r\n m('h1', d('Headline')),\r\n m('p', d('BodyText'))\r\n ];\r\n var overlay = new Overlay(ModalDialog(dialogcontent, {\r\n buttons: [\r\n {\r\n text: d('ButtonText'), callback: function (close) {\r\n close();\r\n }\r\n }\r\n ]\r\n }));\r\n overlay.show();\r\n });\r\n }\r\n });\r\n };\r\n\r\n var checkEncodeURI = function (str) {\r\n return /\\%/i.test(str); // eslint-disable-line no-useless-escape\r\n };\r\n\r\n var isAppUrl = function (url) {\r\n var matches = [\r\n 'app://dummy'\r\n ];\r\n return matches.some(function (match) {\r\n return url.indexOf(match) > -1;\r\n });\r\n };\r\n\r\n var urlContainsLoginInformation = function (url) {\r\n var matches = [\r\n 'assertionId',\r\n 'loginId'\r\n ];\r\n return matches.every(function (match) {\r\n return url.toLowerCase().indexOf(match.toLowerCase()) > -1;\r\n });\r\n };\r\n\r\n var getDefaultRedirectUrl = function () {\r\n return Utils.cookie(DS.Config.CONTEXT + 'currentBrandURL') || defaultReceiptRedirect('ReceiptFallback').Url || window.location.origin;\r\n };\r\n\r\n var getRedirectUrlWithDsApplicationIdAndReturnUrl = function (url) {\r\n var dsApplicationId = getParameter('dsApplicationId') || (window.dsApplicationConfig && window.dsApplicationConfig.ApplicationId);\r\n var returnUrl = getParameter('returnUrl');\r\n var hash = '';\r\n\r\n // Check for hash values and store temp\r\n if (url.indexOf('#') >= 0) {\r\n hash = url.substr(url.indexOf('#'), url.length);\r\n url = url.substr(0, url.indexOf('#'));\r\n }\r\n\r\n // Check if other query params exists before appending returnUrl\r\n if (returnUrl) {\r\n url = url + (url.indexOf('?') >= 0 ? '&' : '?') + 'returnUrl=' + returnUrl;\r\n }\r\n\r\n // Check if other query params exists before append dsApplicationId\r\n if (dsApplicationId !== undefined) {\r\n url = url + (url.indexOf('?') >= 0 ? '&' : '?') + 'dsApplicationId=' + dsApplicationId;\r\n }\r\n\r\n // Reappend hash value if exist.\r\n if (hash.length > 0) {\r\n url = url + hash;\r\n }\r\n\r\n return url;\r\n };\r\n\r\n var getParameter = function (key, queryString) {\r\n // if queryString not defined, use current location URL\r\n if (typeof queryString === 'undefined') {\r\n queryString = location.search.substring(1);\r\n }\r\n\r\n if (queryString.charAt(0) === '?') {\r\n queryString = queryString.substring(1);\r\n }\r\n\r\n var params = queryString.split('&');\r\n for (var i = 0; i < params.length; i++) {\r\n var keyVal = params[i].split('=');\r\n if (keyVal.length > 1 && keyVal[0].toLowerCase() == key.toLowerCase()) {\r\n return keyVal[1];\r\n }\r\n }\r\n return null;\r\n };\r\n\r\n var deleteParameter = function (key, queryString) {\r\n if (typeof queryString === 'undefined') {\r\n queryString = location.search.substring(1);\r\n }\r\n\r\n var params = queryString.split('&');\r\n var newUrlQuery = [];\r\n\r\n for (var i = 0; i < params.length; i++) {\r\n var keyVal = params[i].split('=');\r\n\r\n if (keyVal[0].toLowerCase() !== key.toLowerCase()) {\r\n newUrlQuery.push(keyVal[0] + '=' + keyVal[1]);\r\n }\r\n }\r\n\r\n return newUrlQuery.join('');\r\n };\r\n\r\n var replaceParameterValue = function (key, val, queryString) {\r\n if (typeof queryString === 'undefined') {\r\n queryString = location.search.substring(1);\r\n }\r\n\r\n var params = queryString.split('&');\r\n var newUrlQuery = [];\r\n\r\n for (var i = 0; i < params.length; i++) {\r\n var keyVal = params[i].split('=');\r\n\r\n if (keyVal[0].toLowerCase() === key.toLowerCase()) {\r\n newUrlQuery.push(keyVal[0] + '=' + val);\r\n }\r\n }\r\n\r\n return '?' + newUrlQuery.join('&');\r\n };\r\n\r\n var appendParameter = function (queryKey, queryValue, url) {\r\n // if queryString not defined, use current location URL\r\n if (!url) {\r\n url = window.location.origin + window.location.pathname + window.location.search;\r\n }\r\n var existingParams = url.indexOf('?') > -1;\r\n url += (existingParams ? '&' : '?') + queryKey + '=' + queryValue;\r\n\r\n return url;\r\n };\r\n\r\n var assignMethod = Object.assign;\r\n\r\n var formatDate = function (date) {\r\n return date.toLocaleDateString('da-DK').replace(/\\//g, '.') + ' kl. ' + date.toLocaleTimeString('da-DK').replace(/\\./g, ':').slice(0, -3);\r\n };\r\n\r\n var formatDateShort = function (date) {\r\n return date.getDate() + '/' + (date.getMonth() + 1) + ' kl. ' + date.getHours() + ':' + (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());\r\n };\r\n\r\n var formatDateOnly = function (date) {\r\n var day = date.getDate();\r\n var month = date.getMonth() + 1;\r\n return (day < 10 ? '0' + day : day) + '-' + (month < 10 ? '0' + month : month) + '-' + date.getFullYear();\r\n };\r\n\r\n var getPreviousDatesFromToday = function (count, descending = false) {\r\n const today = new Date();\r\n let dates = [];\r\n\r\n for (let i = 0; i <= count; i++) {\r\n const calculatedDate = new Date(new Date().setDate(today.getDate() - i));\r\n const dateWithoutTime = new Date(calculatedDate.getFullYear(), calculatedDate.getMonth(), calculatedDate.getDate());\r\n dates.push(dateWithoutTime);\r\n }\r\n\r\n if (descending) {\r\n return dates.reverse();\r\n }\r\n\r\n return dates;\r\n };\r\n\r\n var formatCurrencyWithoutDecimals = function (amount) {\r\n if (typeof amount === 'number') {\r\n amount = amount.toString();\r\n }\r\n\r\n amount = amount.split('.')[0];\r\n return formatCurrency(amount);\r\n };\r\n\r\n var formatCurrency = function (amount) {\r\n if (typeof amount === 'number') {\r\n amount = Number(amount).toFixed(2);\r\n }\r\n\r\n amount = amount.replace('.', ',');\r\n return amount.replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, '$1.');\r\n };\r\n\r\n var formatInputValue = function (value) {\r\n var inputValue = value || null;\r\n\r\n // Strip all illegal characters\r\n if (inputValue) {\r\n var matches = inputValue.match(/[\\d.,]+/gi);\r\n inputValue = matches ? matches.join('') : '';\r\n }\r\n\r\n // Replace all commas with period. In order to probably split integer and decimal value.\r\n inputValue = inputValue.replace(/,/g, '.');\r\n\r\n // Build parts array\r\n var parts = inputValue.split('.');\r\n\r\n // Handle if the user is trying to add a second decimal point.\r\n // Example:\r\n // Input: 15.5. (after split() length is 3)\r\n // Output: 15.5 (throw away last element)\r\n if (parts.length > 2) {\r\n parts = parts.slice(0, 2);\r\n }\r\n\r\n // Sanitize decimal part of the input. This removes redundant decimal points and constrains decimal part to two digits.\r\n if (parts[1] && parts[1] !== '') {\r\n parts[1] = parts[1].replace(/,|\\./g, '').slice(0, 2);\r\n }\r\n\r\n // Finally tie everything together and enforce comma as decimal point.\r\n return parts.join(',');\r\n };\r\n\r\n var convertCentsToKroner = function (value) {\r\n var amount = parseInt(value, 10);\r\n return amount / 100;\r\n };\r\n\r\n var convertKronerToCents = function (value) {\r\n var amount = parseInt(value, 10);\r\n return amount * 100;\r\n };\r\n\r\n var convertCentsToKronerAndFormat = function (value) {\r\n var amount = convertCentsToKroner(value);\r\n return formatCurrency(amount);\r\n };\r\n\r\n var scrollToError = function () {\r\n\r\n var error = document.querySelectorAll('.has--error');\r\n if (error.length > 0) {\r\n var routeSlide = document.querySelectorAll('.route-slide');\r\n var elemOffsetY = error[0].offsetTop;\r\n var isFixed = false;\r\n\r\n if (routeSlide.length) {\r\n var routeSlideStyle = window.getComputedStyle(routeSlide[0], null);\r\n isFixed = routeSlideStyle !== null && routeSlideStyle.getPropertyValue('position') === 'fixed';\r\n }\r\n\r\n const scrollTopPos = elemOffsetY - 50;\r\n\r\n if (isFixed) {\r\n routeSlide[0].scrollTo({ top: scrollTopPos, behavior: 'smooth' });\r\n } else {\r\n window.scrollTo({ top: scrollTopPos, behavior: 'smooth' });\r\n }\r\n }\r\n };\r\n\r\n var fileExtension = function (filename) {\r\n return filename.substring(filename.lastIndexOf('.') + 1).toLowerCase();\r\n };\r\n\r\n var sortCardsList = function (cardsList) {\r\n return cardsList.sort(function (a, b) {\r\n if (a.isPrimaryCard || b.cardExpirationDate.expired) return -1;\r\n if (b.isPrimaryCard || a.cardExpirationDate.expired) return 1;\r\n return 0;\r\n });\r\n };\r\n\r\n var uniqueParams = function (params) {\r\n var querySplit = params.split('?');\r\n\r\n if (querySplit.length !== 2) {\r\n return params;\r\n }\r\n\r\n var paramsSplit = querySplit[1].split('&');\r\n var unique = [];\r\n\r\n for (var i = 0; i < paramsSplit.length; i++) {\r\n var param = paramsSplit[i];\r\n\r\n if (unique.indexOf(param) === -1) {\r\n unique.push(param);\r\n }\r\n }\r\n\r\n return querySplit[0] + '?' + unique.join('&');\r\n };\r\n\r\n var replaceDynamicText = function (text, replacements) {\r\n if (typeof replacements !== 'object') {\r\n return text;\r\n }\r\n\r\n const replacementKeys = Object.keys(replacements);\r\n\r\n for (var i = 0; i < replacementKeys.length; i++) {\r\n const key = replacementKeys[i];\r\n const val = replacements[key];\r\n\r\n text = text.replace(new RegExp('{' + key + '}', 'gi'), val);\r\n }\r\n\r\n return text;\r\n };\r\n\r\n const chunks = (inputArray = [], chunkSize = 1) => {\r\n const result = inputArray.reduce((resultArray, item, index) => {\r\n const chunkIndex = Math.floor(index / chunkSize);\r\n\r\n if (!resultArray[chunkIndex]) {\r\n resultArray[chunkIndex] = [];\r\n }\r\n\r\n resultArray[chunkIndex].push(item);\r\n\r\n return resultArray;\r\n }, []);\r\n\r\n return result;\r\n };\r\n\r\n const getPercentageOfSize = (size, totalSize) => {\r\n if (size <= 0) {\r\n return 0.5;\r\n }\r\n\r\n return size / totalSize;\r\n };\r\n\r\n const sumAllTransactionPeriods = (type, periods = []) => {\r\n const initialSum = 0;\r\n const sum = periods.reduce((previousValue, currentPeriod) => {\r\n return previousValue + currentPeriod[type];\r\n }, initialSum);\r\n\r\n return sum;\r\n };\r\n\r\n const isTopFrame = () => {\r\n return window.self === window.top;\r\n };\r\n\r\n const calculateAge = (dateString, today) => {\r\n if (!dateString) return;\r\n\r\n const day = parseInt(dateString.substring(0, 2), 10);\r\n const month = parseInt(dateString.substring(2, 4), 10) - 1; // JS months are 0-indexed\r\n const year = parseInt(dateString.substring(4, 6), 10);\r\n\r\n // Set 'today' based on the 'data-time-now' attribute or the current date\r\n if (!today) {\r\n const timeNow = document.body.getAttribute('data-time-now');\r\n today = timeNow ? new Date(timeNow) : new Date();\r\n }\r\n\r\n // Use the year from 'today' for century calculation\r\n const century = year > today.getFullYear() % 100 ? 1900 : 2000;\r\n const birthDate = new Date(century + year, month, day);\r\n\r\n let age = today.getFullYear() - birthDate.getFullYear();\r\n const m = today.getMonth() - birthDate.getMonth();\r\n\r\n if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {\r\n age--;\r\n }\r\n\r\n return age;\r\n };\r\n\r\n // Public functions:\r\n return {\r\n appendParameter,\r\n assignMethod,\r\n calculateAge,\r\n checkEncodeURI,\r\n chunks,\r\n convertCentsToKroner,\r\n convertCentsToKronerAndFormat,\r\n convertKronerToCents,\r\n deleteParameter,\r\n fileExtension,\r\n formatCurrency,\r\n formatCurrencyWithoutDecimals,\r\n formatDate,\r\n formatDateOnly,\r\n formatDateShort,\r\n formatInputValue,\r\n getDefaultRedirectUrl,\r\n getParameter,\r\n getPercentageOfSize,\r\n getPreviousDatesFromToday,\r\n getRedirectUrlWithDsApplicationIdAndReturnUrl,\r\n getValidAppRedirectUrl,\r\n hasObjectProperty,\r\n isApp: Utils.isApp,\r\n isAppUrl,\r\n isTopFrame,\r\n populateUrlWithAssertionIdAndLoginId,\r\n replaceDynamicText,\r\n replaceParameterValue,\r\n repopulateUrlWithAssertionIdAndLoginId,\r\n scrollToError,\r\n sortCardsList,\r\n sumAllTransactionPeriods,\r\n uniqueParams,\r\n urlContainsLoginInformation,\r\n };\r\n});\r\n"],"mappings":"AAAAA,QAAQ,CAAC,oEAAoE,EAAE,CAC7E,+CAA+C,EAC/C,gDAAgD,EAChD,oDAAoD,EACpD,qDAAqD,EACrD,oDAAoD,EACpD,4EAA4E,EAC5E,yEAAyE,CAC1E,EAAE,UAAUC,CAAC,EAAEC,KAAK,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,WAAW,EAAEC,UAAU,EAAE;EAE5E,IAAIC,sBAAsB,GAAG,IAAIL,SAAS,CAAC,kBAAkB,CAAC,CAACM,GAAG;;EAElE;EACA,IAAIC,iBAAiB,GAAG,SA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