{"version":3,"sources":["cookie.js"],"names":["global","factory","exports","module","define","amd","self","current","Cookies","noConflict","this","assign","target","i","arguments","length","source","key","api","init","converter","defaultAttributes","set","value","attributes","document","expires","Date","now","toUTCString","encodeURIComponent","replace","decodeURIComponent","escape","stringifiedAttributes","attributeName","split","cookie","write","Object","create","get","cookies","jar","parts","slice","join","foundKey","read","e","remove","withAttributes","withConverter","freeze","path"],"mappings":";;;;CAKC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBA,OAAOD,QAAUD,IAC1D,mBAAXG,QAAyBA,OAAOC,IAAMD,OAAOH,IAC/CD,EAASA,GAAUM,KAAO,WACvB,IAAIC,EAAUP,EAAOQ,QACjBN,EAAUF,EAAOQ,QAAUP,IAC/BC,EAAQO,WAAa,WAAwC,OAA1BT,EAAOQ,QAAUD,EAAgBL,GAH9C,IAHtC,CAQEQ,MAAM,WACJ,aAGA,SAASC,EAAOC,GACZ,IAAK,IAAIC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CACvC,IAAIG,EAASF,UAAUD,GACvB,IAAK,IAAII,KAAOD,EACZJ,EAAOK,GAAOD,EAAOC,GAG7B,OAAOL,EAyHX,IAAIM,EAlGJ,SAASC,EAAKC,EAAWC,GACrB,SAASC,EAAIL,EAAKM,EAAOC,GACrB,GAAwB,oBAAbC,SAAX,CAMkC,iBAFlCD,EAAab,EAAO,GAAIU,EAAmBG,IAErBE,UAClBF,EAAWE,QAAU,IAAIC,KAAKA,KAAKC,MAA6B,MAArBJ,EAAWE,UAEtDF,EAAWE,UACXF,EAAWE,QAAUF,EAAWE,QAAQG,eAG5CZ,EAAMa,mBAAmBb,GACpBc,QAAQ,uBAAwBC,oBAChCD,QAAQ,QAASE,QAEtB,IAAIC,EAAwB,GAC5B,IAAK,IAAIC,KAAiBX,EACjBA,EAAWW,KAIhBD,GAAyB,KAAOC,GAEE,IAA9BX,EAAWW,KAWfD,GAAyB,IAAMV,EAAWW,GAAeC,MAAM,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\n * https://github.com/js-cookie/js-cookie/releases\r\n */\r\n;\r\n(function (global, factory) {\r\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\r\n typeof define === 'function' && define.amd ? define(factory) :\r\n (global = global || self, (function () {\r\n var current = global.Cookies;\r\n var exports = global.Cookies = factory();\r\n exports.noConflict = function () { global.Cookies = current; return exports; };\r\n }()));\r\n}(this, (function () {\r\n 'use strict';\r\n\r\n /* eslint-disable no-var */\r\n function assign(target) {\r\n for (var i = 1; i < arguments.length; i++) {\r\n var source = arguments[i];\r\n for (var key in source) {\r\n target[key] = source[key];\r\n }\r\n }\r\n return target\r\n }\r\n /* eslint-enable no-var */\r\n\r\n /* eslint-disable no-var */\r\n var defaultConverter = {\r\n read: function (value) {\r\n if (value[0] === '\"') {\r\n value = value.slice(1, -1);\r\n }\r\n return value.replace(/(%[\\dA-F]{2})+/gi, decodeURIComponent)\r\n },\r\n write: function (value) {\r\n return encodeURIComponent(value).replace(\r\n /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,\r\n decodeURIComponent\r\n )\r\n }\r\n };\r\n /* eslint-enable no-var */\r\n\r\n /* eslint-disable no-var */\r\n\r\n function init(converter, defaultAttributes) {\r\n function set(key, value, attributes) {\r\n if (typeof document === 'undefined') {\r\n return\r\n }\r\n\r\n attributes = assign({}, defaultAttributes, attributes);\r\n\r\n if (typeof attributes.expires === 'number') {\r\n attributes.expires = new Date(Date.now() + attributes.expires * 864e5);\r\n }\r\n if (attributes.expires) {\r\n attributes.expires = attributes.expires.toUTCString();\r\n }\r\n\r\n key = encodeURIComponent(key)\r\n .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)\r\n .replace(/[()]/g, escape);\r\n\r\n var stringifiedAttributes = '';\r\n for (var attributeName in attributes) {\r\n if (!attributes[attributeName]) {\r\n continue\r\n }\r\n\r\n stringifiedAttributes += '; ' + attributeName;\r\n\r\n if (attributes[attributeName] === true) {\r\n continue\r\n }\r\n\r\n // Considers RFC 6265 section 5.2:\r\n // ...\r\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\r\n // character:\r\n // Consume the characters of the unparsed-attributes up to,\r\n // not including, the first %x3B (\";\") character.\r\n // ...\r\n stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\r\n }\r\n\r\n return (document.cookie =\r\n key + '=' + converter.write(value, key) + stringifiedAttributes)\r\n }\r\n\r\n function get(key) {\r\n if (typeof document === 'undefined' || (arguments.length && !key)) {\r\n return\r\n }\r\n\r\n // To prevent the for loop in the first place assign an empty array\r\n // in case there are no cookies at all.\r\n var cookies = document.cookie ? document.cookie.split('; ') : [];\r\n var jar = {};\r\n for (var i = 0; i < cookies.length; i++) {\r\n var parts = cookies[i].split('=');\r\n var value = parts.slice(1).join('=');\r\n\r\n try {\r\n var foundKey = decodeURIComponent(parts[0]);\r\n jar[foundKey] = converter.read(value, foundKey);\r\n\r\n if (key === foundKey) {\r\n break\r\n }\r\n } catch (e) { }\r\n }\r\n\r\n return key ? jar[key] : jar\r\n }\r\n\r\n return Object.create(\r\n {\r\n set: set,\r\n get: get,\r\n remove: function (key, attributes) {\r\n set(\r\n key,\r\n '',\r\n assign({}, attributes, {\r\n expires: -1\r\n })\r\n );\r\n },\r\n withAttributes: function (attributes) {\r\n return init(this.converter, assign({}, this.attributes, attributes))\r\n },\r\n withConverter: function (converter) {\r\n return init(assign({}, this.converter, converter), this.attributes)\r\n }\r\n },\r\n {\r\n attributes: { value: Object.freeze(defaultAttributes) },\r\n converter: { value: Object.freeze(converter) }\r\n }\r\n )\r\n }\r\n\r\n var api = init(defaultConverter, { path: '/' });\r\n /* eslint-enable no-var */\r\n\r\n return api;\r\n\r\n})));\r\n"]}