{"version":3,"file":"index-kJ16_3AR.js","sources":["../../../node_modules/cookies-js/dist/cookies.js","../../../app/assets/javascripts/plugins/cookies-js/index.ts"],"sourcesContent":["/*\r\n * Cookies.js - 1.2.3\r\n * https://github.com/ScottHamper/Cookies\r\n *\r\n * This is free and unencumbered software released into the public domain.\r\n */\r\n(function (global, undefined) {\r\n 'use strict';\r\n\r\n var factory = function (window) {\r\n if (typeof window.document !== 'object') {\r\n throw new Error('Cookies.js requires a `window` with a `document` object');\r\n }\r\n\r\n var Cookies = function (key, value, options) {\r\n return arguments.length === 1 ?\r\n Cookies.get(key) : Cookies.set(key, value, options);\r\n };\r\n\r\n // Allows for setter injection in unit tests\r\n Cookies._document = window.document;\r\n\r\n // Used to ensure cookie keys do not collide with\r\n // built-in `Object` properties\r\n Cookies._cacheKeyPrefix = 'cookey.'; // Hurr hurr, :)\r\n \r\n Cookies._maxExpireDate = new Date('Fri, 31 Dec 9999 23:59:59 UTC');\r\n\r\n Cookies.defaults = {\r\n path: '/',\r\n secure: false\r\n };\r\n\r\n Cookies.get = function (key) {\r\n if (Cookies._cachedDocumentCookie !== Cookies._document.cookie) {\r\n Cookies._renewCache();\r\n }\r\n \r\n var value = Cookies._cache[Cookies._cacheKeyPrefix + key];\r\n\r\n return value === undefined ? undefined : decodeURIComponent(value);\r\n };\r\n\r\n Cookies.set = function (key, value, options) {\r\n options = Cookies._getExtendedOptions(options);\r\n options.expires = Cookies._getExpiresDate(value === undefined ? -1 : options.expires);\r\n\r\n Cookies._document.cookie = Cookies._generateCookieString(key, value, options);\r\n\r\n return Cookies;\r\n };\r\n\r\n Cookies.expire = function (key, options) {\r\n return Cookies.set(key, undefined, options);\r\n };\r\n\r\n Cookies._getExtendedOptions = function (options) {\r\n return {\r\n path: options && options.path || Cookies.defaults.path,\r\n domain: options && options.domain || Cookies.defaults.domain,\r\n expires: options && options.expires || Cookies.defaults.expires,\r\n secure: options && options.secure !== undefined ? options.secure : Cookies.defaults.secure\r\n };\r\n };\r\n\r\n Cookies._isValidDate = function (date) {\r\n return Object.prototype.toString.call(date) === '[object Date]' && !isNaN(date.getTime());\r\n };\r\n\r\n Cookies._getExpiresDate = function (expires, now) {\r\n now = now || new Date();\r\n\r\n if (typeof expires === 'number') {\r\n expires = expires === Infinity ?\r\n Cookies._maxExpireDate : new Date(now.getTime() + expires * 1000);\r\n } else if (typeof expires === 'string') {\r\n expires = new Date(expires);\r\n }\r\n\r\n if (expires && !Cookies._isValidDate(expires)) {\r\n throw new Error('`expires` parameter cannot be converted to a valid Date instance');\r\n }\r\n\r\n return expires;\r\n };\r\n\r\n Cookies._generateCookieString = function (key, value, options) {\r\n key = key.replace(/[^#$&+\\^`|]/g, encodeURIComponent);\r\n key = key.replace(/\\(/g, '%28').replace(/\\)/g, '%29');\r\n value = (value + '').replace(/[^!#$&-+\\--:<-\\[\\]-~]/g, encodeURIComponent);\r\n options = options || {};\r\n\r\n var cookieString = key + '=' + value;\r\n cookieString += options.path ? ';path=' + options.path : '';\r\n cookieString += options.domain ? ';domain=' + options.domain : '';\r\n cookieString += options.expires ? ';expires=' + options.expires.toUTCString() : '';\r\n cookieString += options.secure ? ';secure' : '';\r\n\r\n return cookieString;\r\n };\r\n\r\n Cookies._getCacheFromString = function (documentCookie) {\r\n var cookieCache = {};\r\n var cookiesArray = documentCookie ? documentCookie.split('; ') : [];\r\n\r\n for (var i = 0; i < cookiesArray.length; i++) {\r\n var cookieKvp = Cookies._getKeyValuePairFromCookieString(cookiesArray[i]);\r\n\r\n if (cookieCache[Cookies._cacheKeyPrefix + cookieKvp.key] === undefined) {\r\n cookieCache[Cookies._cacheKeyPrefix + cookieKvp.key] = cookieKvp.value;\r\n }\r\n }\r\n\r\n return cookieCache;\r\n };\r\n\r\n Cookies._getKeyValuePairFromCookieString = function (cookieString) {\r\n // \"=\" is a valid character in a cookie value according to RFC6265, so cannot `split('=')`\r\n var separatorIndex = cookieString.indexOf('=');\r\n\r\n // IE omits the \"=\" when the cookie value is an empty string\r\n separatorIndex = separatorIndex < 0 ? cookieString.length : separatorIndex;\r\n\r\n var key = cookieString.substr(0, separatorIndex);\r\n var decodedKey;\r\n try {\r\n decodedKey = decodeURIComponent(key);\r\n } catch (e) {\r\n if (console && typeof console.error === 'function') {\r\n console.error('Could not decode cookie with key \"' + key + '\"', e);\r\n }\r\n }\r\n \r\n return {\r\n key: decodedKey,\r\n value: cookieString.substr(separatorIndex + 1) // Defer decoding value until accessed\r\n };\r\n };\r\n\r\n Cookies._renewCache = function () {\r\n Cookies._cache = Cookies._getCacheFromString(Cookies._document.cookie);\r\n Cookies._cachedDocumentCookie = Cookies._document.cookie;\r\n };\r\n\r\n Cookies._areEnabled = function () {\r\n var testKey = 'cookies.js';\r\n var areEnabled = Cookies.set(testKey, 1).get(testKey) === '1';\r\n Cookies.expire(testKey);\r\n return areEnabled;\r\n };\r\n\r\n Cookies.enabled = Cookies._areEnabled();\r\n\r\n return Cookies;\r\n };\r\n var cookiesExport = (global && typeof global.document === 'object') ? factory(global) : factory;\r\n\r\n // AMD support\r\n if (typeof define === 'function' && define.amd) {\r\n define(function () { return cookiesExport; });\r\n // CommonJS/Node.js support\r\n } else if (typeof exports === 'object') {\r\n // Support Node.js specific `module.exports` (which can be a function)\r\n if (typeof module === 'object' && typeof module.exports === 'object') {\r\n exports = module.exports = cookiesExport;\r\n }\r\n // But always support CommonJS module 1.1.1 spec (`exports` cannot be a function)\r\n exports.Cookies = cookiesExport;\r\n } else {\r\n global.Cookies = cookiesExport;\r\n }\r\n})(typeof window === 'undefined' ? this : window);","\nimport Cookies from \"cookies-js\"\n\nCookies.defaults.path = \"/\"\nCookies.defaults.secure = false\n// 1day\nCookies.defaults.expires = (24 * 60 * 60)\n\nexport default Cookies\n"],"names":["global","undefined","factory","window","Cookies","key","value","options","date","expires","now","cookieString","documentCookie","cookieCache","cookiesArray","i","cookieKvp","separatorIndex","decodedKey","e","testKey","areEnabled","cookiesExport","exports","module","this"],"mappings":"oHAMC,SAAUA,EAAQC,EAAW,C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