@amaui/cookie
Advanced tools
Comparing version 1.0.112 to 1.0.113
@@ -53,3 +53,3 @@ "use strict"; | ||
const parts = cookie.split('='); | ||
items[this.propertyOriginal(parts[0])] = (0, _utils.castParam)(parts.slice(1).join('=')); | ||
items[this.propertyOriginal(parts[0])] = (0, _utils.parse)(parts.slice(1).join('=')); | ||
} | ||
@@ -56,0 +56,0 @@ |
@@ -10,3 +10,3 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck"; | ||
import { is, merge, serialize, castParam, isEnvironment } from '@amaui/utils'; | ||
import { is, merge, serialize, isEnvironment, parse } from '@amaui/utils'; | ||
import { add as _add } from '@amaui/date'; | ||
@@ -65,3 +65,3 @@ var optionsDefault = { | ||
var parts = cookie.split('='); | ||
items[this.propertyOriginal(parts[0])] = castParam(parts.slice(1).join('=')); | ||
items[this.propertyOriginal(parts[0])] = parse(parts.slice(1).join('=')); | ||
} | ||
@@ -68,0 +68,0 @@ } catch (err) { |
@@ -1,2 +0,2 @@ | ||
/** @license AmauiCookie v1.0.112 | ||
/** @license AmauiCookie v1.0.113 | ||
* | ||
@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the |
@@ -1,2 +0,2 @@ | ||
/** @license AmauiCookie v1.0.112 | ||
/** @license AmauiCookie v1.0.113 | ||
* | ||
@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the |
@@ -10,3 +10,3 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck"; | ||
import { is, merge, serialize, castParam, isEnvironment } from '@amaui/utils'; | ||
import { is, merge, serialize, isEnvironment, parse } from '@amaui/utils'; | ||
import { add as _add } from '@amaui/date'; | ||
@@ -65,3 +65,3 @@ var optionsDefault = { | ||
var parts = cookie.split('='); | ||
items[this.propertyOriginal(parts[0])] = castParam(parts.slice(1).join('=')); | ||
items[this.propertyOriginal(parts[0])] = parse(parts.slice(1).join('=')); | ||
} | ||
@@ -68,0 +68,0 @@ } catch (err) { |
@@ -1,2 +0,2 @@ | ||
/** @license AmauiCookie v1.0.112 | ||
/** @license AmauiCookie v1.0.113 | ||
* | ||
@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the |
@@ -1,2 +0,2 @@ | ||
import { is, merge, serialize, castParam, isEnvironment } from '@amaui/utils'; | ||
import { is, merge, serialize, isEnvironment, parse } from '@amaui/utils'; | ||
import { add } from '@amaui/date'; | ||
@@ -44,3 +44,3 @@ const optionsDefault = { | ||
const parts = cookie.split('='); | ||
items[this.propertyOriginal(parts[0])] = castParam(parts.slice(1).join('=')); | ||
items[this.propertyOriginal(parts[0])] = parse(parts.slice(1).join('=')); | ||
} | ||
@@ -47,0 +47,0 @@ |
@@ -1,2 +0,2 @@ | ||
/** @license AmauiCookie v1.0.112 | ||
/** @license AmauiCookie v1.0.113 | ||
* | ||
@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the |
{ | ||
"name": "@amaui/cookie", | ||
"version": "1.0.112", | ||
"version": "1.0.113", | ||
"description": "Cookie", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/amaui-org/amaui-cookie.git", |
@@ -15,3 +15,3 @@ | ||
<sub>Production ready </sub> | ||
<sub>3.8kb gzipped </sub> | ||
<sub>6.7kb gzipped </sub> | ||
<sub>100% test cov </sub> | ||
@@ -18,0 +18,0 @@ <sub>Browser</sub> |
@@ -1,2 +0,2 @@ | ||
/** @license AmauiCookie v1.0.112 | ||
/** @license AmauiCookie v1.0.113 | ||
* | ||
@@ -69,3 +69,3 @@ * This source code is licensed under the MIT license found in the | ||
var optionsDefault$4 = { | ||
var optionsDefault$8 = { | ||
elementIsObject: false | ||
@@ -77,5 +77,5 @@ }; // Multiple is methods instead of one, | ||
var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; | ||
var options_ = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : optionsDefault$4; | ||
var options_ = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : optionsDefault$8; | ||
var options = _extends({}, optionsDefault$4, options_); | ||
var options = _extends({}, optionsDefault$8, options_); | ||
@@ -192,3 +192,3 @@ switch (type) { | ||
var optionsDefault$3 = { | ||
var optionsDefault$7 = { | ||
copy: false, | ||
@@ -201,5 +201,5 @@ merge: { | ||
var merge = function merge(target, source) { | ||
var options_ = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : optionsDefault$3; | ||
var options_ = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : optionsDefault$7; | ||
var options = _extends({}, optionsDefault$3, options_); | ||
var options = _extends({}, optionsDefault$7, options_); | ||
@@ -230,3 +230,3 @@ if (options.merge.array && is('array', target) && is('array', source)) { | ||
var optionsDefault$2 = { | ||
var optionsDefault$6 = { | ||
decode: true, | ||
@@ -237,4 +237,4 @@ decodeMethod: decodeURIComponent | ||
var castParam = function castParam(value) { | ||
var options_ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : optionsDefault$2; | ||
var options = merge$1(options_, optionsDefault$2); | ||
var options_ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : optionsDefault$6; | ||
var options = merge$1(options_, optionsDefault$6); | ||
var newValue = value; | ||
@@ -282,2 +282,1227 @@ if (is('string', value) && options.decode && is('function', options.decodeMethod)) newValue = options.decodeMethod(value); | ||
var capitalize = function capitalize(value) { | ||
if (is('string', value)) return "".concat(value.charAt(0).toUpperCase()).concat(value.slice(1)); | ||
return value; | ||
}; | ||
var capitalize$1 = capitalize; | ||
function commonjsRequire (path) { | ||
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); | ||
} | ||
var sha256 = {exports: {}}; | ||
var core = {exports: {}}; | ||
(function (module, exports) { | ||
(function (root, factory) { | ||
{ | ||
// CommonJS | ||
module.exports = factory(); | ||
} | ||
}(this, function () { | ||
/*globals window, global, require*/ | ||
/** | ||
* CryptoJS core components. | ||
*/ | ||
var CryptoJS = CryptoJS || (function (Math, undefined$1) { | ||
var crypto; | ||
// Native crypto from window (Browser) | ||
if (typeof window !== 'undefined' && window.crypto) { | ||
crypto = window.crypto; | ||
} | ||
// Native crypto in web worker (Browser) | ||
if (typeof self !== 'undefined' && self.crypto) { | ||
crypto = self.crypto; | ||
} | ||
// Native crypto from worker | ||
if (typeof globalThis !== 'undefined' && globalThis.crypto) { | ||
crypto = globalThis.crypto; | ||
} | ||
// Native (experimental IE 11) crypto from window (Browser) | ||
if (!crypto && typeof window !== 'undefined' && window.msCrypto) { | ||
crypto = window.msCrypto; | ||
} | ||
// Native crypto from global (NodeJS) | ||
if (!crypto && typeof global$1 !== 'undefined' && global$1.crypto) { | ||
crypto = global$1.crypto; | ||
} | ||
// Native crypto import via require (NodeJS) | ||
if (!crypto && typeof commonjsRequire === 'function') { | ||
try { | ||
crypto = require('crypto'); | ||
} catch (err) {} | ||
} | ||
/* | ||
* Cryptographically secure pseudorandom number generator | ||
* | ||
* As Math.random() is cryptographically not safe to use | ||
*/ | ||
var cryptoSecureRandomInt = function () { | ||
if (crypto) { | ||
// Use getRandomValues method (Browser) | ||
if (typeof crypto.getRandomValues === 'function') { | ||
try { | ||
return crypto.getRandomValues(new Uint32Array(1))[0]; | ||
} catch (err) {} | ||
} | ||
// Use randomBytes method (NodeJS) | ||
if (typeof crypto.randomBytes === 'function') { | ||
try { | ||
return crypto.randomBytes(4).readInt32LE(); | ||
} catch (err) {} | ||
} | ||
} | ||
throw new Error('Native crypto module could not be used to get secure random number.'); | ||
}; | ||
/* | ||
* Local polyfill of Object.create | ||
*/ | ||
var create = Object.create || (function () { | ||
function F() {} | ||
return function (obj) { | ||
var subtype; | ||
F.prototype = obj; | ||
subtype = new F(); | ||
F.prototype = null; | ||
return subtype; | ||
}; | ||
}()); | ||
/** | ||
* CryptoJS namespace. | ||
*/ | ||
var C = {}; | ||
/** | ||
* Library namespace. | ||
*/ | ||
var C_lib = C.lib = {}; | ||
/** | ||
* Base object for prototypal inheritance. | ||
*/ | ||
var Base = C_lib.Base = (function () { | ||
return { | ||
/** | ||
* Creates a new object that inherits from this object. | ||
* | ||
* @param {Object} overrides Properties to copy into the new object. | ||
* | ||
* @return {Object} The new object. | ||
* | ||
* @static | ||
* | ||
* @example | ||
* | ||
* var MyType = CryptoJS.lib.Base.extend({ | ||
* field: 'value', | ||
* | ||
* method: function () { | ||
* } | ||
* }); | ||
*/ | ||
extend: function (overrides) { | ||
// Spawn | ||
var subtype = create(this); | ||
// Augment | ||
if (overrides) { | ||
subtype.mixIn(overrides); | ||
} | ||
// Create default initializer | ||
if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { | ||
subtype.init = function () { | ||
subtype.$super.init.apply(this, arguments); | ||
}; | ||
} | ||
// Initializer's prototype is the subtype object | ||
subtype.init.prototype = subtype; | ||
// Reference supertype | ||
subtype.$super = this; | ||
return subtype; | ||
}, | ||
/** | ||
* Extends this object and runs the init method. | ||
* Arguments to create() will be passed to init(). | ||
* | ||
* @return {Object} The new object. | ||
* | ||
* @static | ||
* | ||
* @example | ||
* | ||
* var instance = MyType.create(); | ||
*/ | ||
create: function () { | ||
var instance = this.extend(); | ||
instance.init.apply(instance, arguments); | ||
return instance; | ||
}, | ||
/** | ||
* Initializes a newly created object. | ||
* Override this method to add some logic when your objects are created. | ||
* | ||
* @example | ||
* | ||
* var MyType = CryptoJS.lib.Base.extend({ | ||
* init: function () { | ||
* // ... | ||
* } | ||
* }); | ||
*/ | ||
init: function () { | ||
}, | ||
/** | ||
* Copies properties into this object. | ||
* | ||
* @param {Object} properties The properties to mix in. | ||
* | ||
* @example | ||
* | ||
* MyType.mixIn({ | ||
* field: 'value' | ||
* }); | ||
*/ | ||
mixIn: function (properties) { | ||
for (var propertyName in properties) { | ||
if (properties.hasOwnProperty(propertyName)) { | ||
this[propertyName] = properties[propertyName]; | ||
} | ||
} | ||
// IE won't copy toString using the loop above | ||
if (properties.hasOwnProperty('toString')) { | ||
this.toString = properties.toString; | ||
} | ||
}, | ||
/** | ||
* Creates a copy of this object. | ||
* | ||
* @return {Object} The clone. | ||
* | ||
* @example | ||
* | ||
* var clone = instance.clone(); | ||
*/ | ||
clone: function () { | ||
return this.init.prototype.extend(this); | ||
} | ||
}; | ||
}()); | ||
/** | ||
* An array of 32-bit words. | ||
* | ||
* @property {Array} words The array of 32-bit words. | ||
* @property {number} sigBytes The number of significant bytes in this word array. | ||
*/ | ||
var WordArray = C_lib.WordArray = Base.extend({ | ||
/** | ||
* Initializes a newly created word array. | ||
* | ||
* @param {Array} words (Optional) An array of 32-bit words. | ||
* @param {number} sigBytes (Optional) The number of significant bytes in the words. | ||
* | ||
* @example | ||
* | ||
* var wordArray = CryptoJS.lib.WordArray.create(); | ||
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); | ||
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); | ||
*/ | ||
init: function (words, sigBytes) { | ||
words = this.words = words || []; | ||
if (sigBytes != undefined$1) { | ||
this.sigBytes = sigBytes; | ||
} else { | ||
this.sigBytes = words.length * 4; | ||
} | ||
}, | ||
/** | ||
* Converts this word array to a string. | ||
* | ||
* @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex | ||
* | ||
* @return {string} The stringified word array. | ||
* | ||
* @example | ||
* | ||
* var string = wordArray + ''; | ||
* var string = wordArray.toString(); | ||
* var string = wordArray.toString(CryptoJS.enc.Utf8); | ||
*/ | ||
toString: function (encoder) { | ||
return (encoder || Hex).stringify(this); | ||
}, | ||
/** | ||
* Concatenates a word array to this word array. | ||
* | ||
* @param {WordArray} wordArray The word array to append. | ||
* | ||
* @return {WordArray} This word array. | ||
* | ||
* @example | ||
* | ||
* wordArray1.concat(wordArray2); | ||
*/ | ||
concat: function (wordArray) { | ||
// Shortcuts | ||
var thisWords = this.words; | ||
var thatWords = wordArray.words; | ||
var thisSigBytes = this.sigBytes; | ||
var thatSigBytes = wordArray.sigBytes; | ||
// Clamp excess bits | ||
this.clamp(); | ||
// Concat | ||
if (thisSigBytes % 4) { | ||
// Copy one byte at a time | ||
for (var i = 0; i < thatSigBytes; i++) { | ||
var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; | ||
thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); | ||
} | ||
} else { | ||
// Copy one word at a time | ||
for (var j = 0; j < thatSigBytes; j += 4) { | ||
thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2]; | ||
} | ||
} | ||
this.sigBytes += thatSigBytes; | ||
// Chainable | ||
return this; | ||
}, | ||
/** | ||
* Removes insignificant bits. | ||
* | ||
* @example | ||
* | ||
* wordArray.clamp(); | ||
*/ | ||
clamp: function () { | ||
// Shortcuts | ||
var words = this.words; | ||
var sigBytes = this.sigBytes; | ||
// Clamp | ||
words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); | ||
words.length = Math.ceil(sigBytes / 4); | ||
}, | ||
/** | ||
* Creates a copy of this word array. | ||
* | ||
* @return {WordArray} The clone. | ||
* | ||
* @example | ||
* | ||
* var clone = wordArray.clone(); | ||
*/ | ||
clone: function () { | ||
var clone = Base.clone.call(this); | ||
clone.words = this.words.slice(0); | ||
return clone; | ||
}, | ||
/** | ||
* Creates a word array filled with random bytes. | ||
* | ||
* @param {number} nBytes The number of random bytes to generate. | ||
* | ||
* @return {WordArray} The random word array. | ||
* | ||
* @static | ||
* | ||
* @example | ||
* | ||
* var wordArray = CryptoJS.lib.WordArray.random(16); | ||
*/ | ||
random: function (nBytes) { | ||
var words = []; | ||
for (var i = 0; i < nBytes; i += 4) { | ||
words.push(cryptoSecureRandomInt()); | ||
} | ||
return new WordArray.init(words, nBytes); | ||
} | ||
}); | ||
/** | ||
* Encoder namespace. | ||
*/ | ||
var C_enc = C.enc = {}; | ||
/** | ||
* Hex encoding strategy. | ||
*/ | ||
var Hex = C_enc.Hex = { | ||
/** | ||
* Converts a word array to a hex string. | ||
* | ||
* @param {WordArray} wordArray The word array. | ||
* | ||
* @return {string} The hex string. | ||
* | ||
* @static | ||
* | ||
* @example | ||
* | ||
* var hexString = CryptoJS.enc.Hex.stringify(wordArray); | ||
*/ | ||
stringify: function (wordArray) { | ||
// Shortcuts | ||
var words = wordArray.words; | ||
var sigBytes = wordArray.sigBytes; | ||
// Convert | ||
var hexChars = []; | ||
for (var i = 0; i < sigBytes; i++) { | ||
var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; | ||
hexChars.push((bite >>> 4).toString(16)); | ||
hexChars.push((bite & 0x0f).toString(16)); | ||
} | ||
return hexChars.join(''); | ||
}, | ||
/** | ||
* Converts a hex string to a word array. | ||
* | ||
* @param {string} hexStr The hex string. | ||
* | ||
* @return {WordArray} The word array. | ||
* | ||
* @static | ||
* | ||
* @example | ||
* | ||
* var wordArray = CryptoJS.enc.Hex.parse(hexString); | ||
*/ | ||
parse: function (hexStr) { | ||
// Shortcut | ||
var hexStrLength = hexStr.length; | ||
// Convert | ||
var words = []; | ||
for (var i = 0; i < hexStrLength; i += 2) { | ||
words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); | ||
} | ||
return new WordArray.init(words, hexStrLength / 2); | ||
} | ||
}; | ||
/** | ||
* Latin1 encoding strategy. | ||
*/ | ||
var Latin1 = C_enc.Latin1 = { | ||
/** | ||
* Converts a word array to a Latin1 string. | ||
* | ||
* @param {WordArray} wordArray The word array. | ||
* | ||
* @return {string} The Latin1 string. | ||
* | ||
* @static | ||
* | ||
* @example | ||
* | ||
* var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); | ||
*/ | ||
stringify: function (wordArray) { | ||
// Shortcuts | ||
var words = wordArray.words; | ||
var sigBytes = wordArray.sigBytes; | ||
// Convert | ||
var latin1Chars = []; | ||
for (var i = 0; i < sigBytes; i++) { | ||
var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; | ||
latin1Chars.push(String.fromCharCode(bite)); | ||
} | ||
return latin1Chars.join(''); | ||
}, | ||
/** | ||
* Converts a Latin1 string to a word array. | ||
* | ||
* @param {string} latin1Str The Latin1 string. | ||
* | ||
* @return {WordArray} The word array. | ||
* | ||
* @static | ||
* | ||
* @example | ||
* | ||
* var wordArray = CryptoJS.enc.Latin1.parse(latin1String); | ||
*/ | ||
parse: function (latin1Str) { | ||
// Shortcut | ||
var latin1StrLength = latin1Str.length; | ||
// Convert | ||
var words = []; | ||
for (var i = 0; i < latin1StrLength; i++) { | ||
words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); | ||
} | ||
return new WordArray.init(words, latin1StrLength); | ||
} | ||
}; | ||
/** | ||
* UTF-8 encoding strategy. | ||
*/ | ||
var Utf8 = C_enc.Utf8 = { | ||
/** | ||
* Converts a word array to a UTF-8 string. | ||
* | ||
* @param {WordArray} wordArray The word array. | ||
* | ||
* @return {string} The UTF-8 string. | ||
* | ||
* @static | ||
* | ||
* @example | ||
* | ||
* var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); | ||
*/ | ||
stringify: function (wordArray) { | ||
try { | ||
return decodeURIComponent(escape(Latin1.stringify(wordArray))); | ||
} catch (e) { | ||
throw new Error('Malformed UTF-8 data'); | ||
} | ||
}, | ||
/** | ||
* Converts a UTF-8 string to a word array. | ||
* | ||
* @param {string} utf8Str The UTF-8 string. | ||
* | ||
* @return {WordArray} The word array. | ||
* | ||
* @static | ||
* | ||
* @example | ||
* | ||
* var wordArray = CryptoJS.enc.Utf8.parse(utf8String); | ||
*/ | ||
parse: function (utf8Str) { | ||
return Latin1.parse(unescape(encodeURIComponent(utf8Str))); | ||
} | ||
}; | ||
/** | ||
* Abstract buffered block algorithm template. | ||
* | ||
* The property blockSize must be implemented in a concrete subtype. | ||
* | ||
* @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 | ||
*/ | ||
var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ | ||
/** | ||
* Resets this block algorithm's data buffer to its initial state. | ||
* | ||
* @example | ||
* | ||
* bufferedBlockAlgorithm.reset(); | ||
*/ | ||
reset: function () { | ||
// Initial values | ||
this._data = new WordArray.init(); | ||
this._nDataBytes = 0; | ||
}, | ||
/** | ||
* Adds new data to this block algorithm's buffer. | ||
* | ||
* @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. | ||
* | ||
* @example | ||
* | ||
* bufferedBlockAlgorithm._append('data'); | ||
* bufferedBlockAlgorithm._append(wordArray); | ||
*/ | ||
_append: function (data) { | ||
// Convert string to WordArray, else assume WordArray already | ||
if (typeof data == 'string') { | ||
data = Utf8.parse(data); | ||
} | ||
// Append | ||
this._data.concat(data); | ||
this._nDataBytes += data.sigBytes; | ||
}, | ||
/** | ||
* Processes available data blocks. | ||
* | ||
* This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. | ||
* | ||
* @param {boolean} doFlush Whether all blocks and partial blocks should be processed. | ||
* | ||
* @return {WordArray} The processed data. | ||
* | ||
* @example | ||
* | ||
* var processedData = bufferedBlockAlgorithm._process(); | ||
* var processedData = bufferedBlockAlgorithm._process(!!'flush'); | ||
*/ | ||
_process: function (doFlush) { | ||
var processedWords; | ||
// Shortcuts | ||
var data = this._data; | ||
var dataWords = data.words; | ||
var dataSigBytes = data.sigBytes; | ||
var blockSize = this.blockSize; | ||
var blockSizeBytes = blockSize * 4; | ||
// Count blocks ready | ||
var nBlocksReady = dataSigBytes / blockSizeBytes; | ||
if (doFlush) { | ||
// Round up to include partial blocks | ||
nBlocksReady = Math.ceil(nBlocksReady); | ||
} else { | ||
// Round down to include only full blocks, | ||
// less the number of blocks that must remain in the buffer | ||
nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); | ||
} | ||
// Count words ready | ||
var nWordsReady = nBlocksReady * blockSize; | ||
// Count bytes ready | ||
var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); | ||
// Process blocks | ||
if (nWordsReady) { | ||
for (var offset = 0; offset < nWordsReady; offset += blockSize) { | ||
// Perform concrete-algorithm logic | ||
this._doProcessBlock(dataWords, offset); | ||
} | ||
// Remove processed words | ||
processedWords = dataWords.splice(0, nWordsReady); | ||
data.sigBytes -= nBytesReady; | ||
} | ||
// Return processed words | ||
return new WordArray.init(processedWords, nBytesReady); | ||
}, | ||
/** | ||
* Creates a copy of this object. | ||
* | ||
* @return {Object} The clone. | ||
* | ||
* @example | ||
* | ||
* var clone = bufferedBlockAlgorithm.clone(); | ||
*/ | ||
clone: function () { | ||
var clone = Base.clone.call(this); | ||
clone._data = this._data.clone(); | ||
return clone; | ||
}, | ||
_minBufferSize: 0 | ||
}); | ||
/** | ||
* Abstract hasher template. | ||
* | ||
* @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) | ||
*/ | ||
C_lib.Hasher = BufferedBlockAlgorithm.extend({ | ||
/** | ||
* Configuration options. | ||
*/ | ||
cfg: Base.extend(), | ||
/** | ||
* Initializes a newly created hasher. | ||
* | ||
* @param {Object} cfg (Optional) The configuration options to use for this hash computation. | ||
* | ||
* @example | ||
* | ||
* var hasher = CryptoJS.algo.SHA256.create(); | ||
*/ | ||
init: function (cfg) { | ||
// Apply config defaults | ||
this.cfg = this.cfg.extend(cfg); | ||
// Set initial values | ||
this.reset(); | ||
}, | ||
/** | ||
* Resets this hasher to its initial state. | ||
* | ||
* @example | ||
* | ||
* hasher.reset(); | ||
*/ | ||
reset: function () { | ||
// Reset data buffer | ||
BufferedBlockAlgorithm.reset.call(this); | ||
// Perform concrete-hasher logic | ||
this._doReset(); | ||
}, | ||
/** | ||
* Updates this hasher with a message. | ||
* | ||
* @param {WordArray|string} messageUpdate The message to append. | ||
* | ||
* @return {Hasher} This hasher. | ||
* | ||
* @example | ||
* | ||
* hasher.update('message'); | ||
* hasher.update(wordArray); | ||
*/ | ||
update: function (messageUpdate) { | ||
// Append | ||
this._append(messageUpdate); | ||
// Update the hash | ||
this._process(); | ||
// Chainable | ||
return this; | ||
}, | ||
/** | ||
* Finalizes the hash computation. | ||
* Note that the finalize operation is effectively a destructive, read-once operation. | ||
* | ||
* @param {WordArray|string} messageUpdate (Optional) A final message update. | ||
* | ||
* @return {WordArray} The hash. | ||
* | ||
* @example | ||
* | ||
* var hash = hasher.finalize(); | ||
* var hash = hasher.finalize('message'); | ||
* var hash = hasher.finalize(wordArray); | ||
*/ | ||
finalize: function (messageUpdate) { | ||
// Final message update | ||
if (messageUpdate) { | ||
this._append(messageUpdate); | ||
} | ||
// Perform concrete-hasher logic | ||
var hash = this._doFinalize(); | ||
return hash; | ||
}, | ||
blockSize: 512/32, | ||
/** | ||
* Creates a shortcut function to a hasher's object interface. | ||
* | ||
* @param {Hasher} hasher The hasher to create a helper for. | ||
* | ||
* @return {Function} The shortcut function. | ||
* | ||
* @static | ||
* | ||
* @example | ||
* | ||
* var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); | ||
*/ | ||
_createHelper: function (hasher) { | ||
return function (message, cfg) { | ||
return new hasher.init(cfg).finalize(message); | ||
}; | ||
}, | ||
/** | ||
* Creates a shortcut function to the HMAC's object interface. | ||
* | ||
* @param {Hasher} hasher The hasher to use in this HMAC helper. | ||
* | ||
* @return {Function} The shortcut function. | ||
* | ||
* @static | ||
* | ||
* @example | ||
* | ||
* var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); | ||
*/ | ||
_createHmacHelper: function (hasher) { | ||
return function (message, key) { | ||
return new C_algo.HMAC.init(hasher, key).finalize(message); | ||
}; | ||
} | ||
}); | ||
/** | ||
* Algorithm namespace. | ||
*/ | ||
var C_algo = C.algo = {}; | ||
return C; | ||
}(Math)); | ||
return CryptoJS; | ||
})); | ||
}(core)); | ||
(function (module, exports) { | ||
(function (root, factory) { | ||
{ | ||
// CommonJS | ||
module.exports = factory(core.exports); | ||
} | ||
}(this, function (CryptoJS) { | ||
(function (Math) { | ||
// Shortcuts | ||
var C = CryptoJS; | ||
var C_lib = C.lib; | ||
var WordArray = C_lib.WordArray; | ||
var Hasher = C_lib.Hasher; | ||
var C_algo = C.algo; | ||
// Initialization and round constants tables | ||
var H = []; | ||
var K = []; | ||
// Compute constants | ||
(function () { | ||
function isPrime(n) { | ||
var sqrtN = Math.sqrt(n); | ||
for (var factor = 2; factor <= sqrtN; factor++) { | ||
if (!(n % factor)) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
function getFractionalBits(n) { | ||
return ((n - (n | 0)) * 0x100000000) | 0; | ||
} | ||
var n = 2; | ||
var nPrime = 0; | ||
while (nPrime < 64) { | ||
if (isPrime(n)) { | ||
if (nPrime < 8) { | ||
H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2)); | ||
} | ||
K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3)); | ||
nPrime++; | ||
} | ||
n++; | ||
} | ||
}()); | ||
// Reusable object | ||
var W = []; | ||
/** | ||
* SHA-256 hash algorithm. | ||
*/ | ||
var SHA256 = C_algo.SHA256 = Hasher.extend({ | ||
_doReset: function () { | ||
this._hash = new WordArray.init(H.slice(0)); | ||
}, | ||
_doProcessBlock: function (M, offset) { | ||
// Shortcut | ||
var H = this._hash.words; | ||
// Working variables | ||
var a = H[0]; | ||
var b = H[1]; | ||
var c = H[2]; | ||
var d = H[3]; | ||
var e = H[4]; | ||
var f = H[5]; | ||
var g = H[6]; | ||
var h = H[7]; | ||
// Computation | ||
for (var i = 0; i < 64; i++) { | ||
if (i < 16) { | ||
W[i] = M[offset + i] | 0; | ||
} else { | ||
var gamma0x = W[i - 15]; | ||
var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^ | ||
((gamma0x << 14) | (gamma0x >>> 18)) ^ | ||
(gamma0x >>> 3); | ||
var gamma1x = W[i - 2]; | ||
var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^ | ||
((gamma1x << 13) | (gamma1x >>> 19)) ^ | ||
(gamma1x >>> 10); | ||
W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; | ||
} | ||
var ch = (e & f) ^ (~e & g); | ||
var maj = (a & b) ^ (a & c) ^ (b & c); | ||
var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22)); | ||
var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25)); | ||
var t1 = h + sigma1 + ch + K[i] + W[i]; | ||
var t2 = sigma0 + maj; | ||
h = g; | ||
g = f; | ||
f = e; | ||
e = (d + t1) | 0; | ||
d = c; | ||
c = b; | ||
b = a; | ||
a = (t1 + t2) | 0; | ||
} | ||
// Intermediate hash value | ||
H[0] = (H[0] + a) | 0; | ||
H[1] = (H[1] + b) | 0; | ||
H[2] = (H[2] + c) | 0; | ||
H[3] = (H[3] + d) | 0; | ||
H[4] = (H[4] + e) | 0; | ||
H[5] = (H[5] + f) | 0; | ||
H[6] = (H[6] + g) | 0; | ||
H[7] = (H[7] + h) | 0; | ||
}, | ||
_doFinalize: function () { | ||
// Shortcuts | ||
var data = this._data; | ||
var dataWords = data.words; | ||
var nBitsTotal = this._nDataBytes * 8; | ||
var nBitsLeft = data.sigBytes * 8; | ||
// Add padding | ||
dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); | ||
dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); | ||
dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; | ||
data.sigBytes = dataWords.length * 4; | ||
// Hash final blocks | ||
this._process(); | ||
// Return final computed hash | ||
return this._hash; | ||
}, | ||
clone: function () { | ||
var clone = Hasher.clone.call(this); | ||
clone._hash = this._hash.clone(); | ||
return clone; | ||
} | ||
}); | ||
/** | ||
* Shortcut function to the hasher's object interface. | ||
* | ||
* @param {WordArray|string} message The message to hash. | ||
* | ||
* @return {WordArray} The hash. | ||
* | ||
* @static | ||
* | ||
* @example | ||
* | ||
* var hash = CryptoJS.SHA256('message'); | ||
* var hash = CryptoJS.SHA256(wordArray); | ||
*/ | ||
C.SHA256 = Hasher._createHelper(SHA256); | ||
/** | ||
* Shortcut function to the HMAC's object interface. | ||
* | ||
* @param {WordArray|string} message The message to hash. | ||
* @param {WordArray|string} key The secret key. | ||
* | ||
* @return {WordArray} The HMAC. | ||
* | ||
* @static | ||
* | ||
* @example | ||
* | ||
* var hmac = CryptoJS.HmacSHA256(message, key); | ||
*/ | ||
C.HmacSHA256 = Hasher._createHmacHelper(SHA256); | ||
}(Math)); | ||
return CryptoJS.SHA256; | ||
})); | ||
}(sha256)); | ||
var SHA256 = sha256.exports; | ||
var optionsDefault$5 = { | ||
serialize: true, | ||
withPrefix: true | ||
}; | ||
var hash = function hash(value_) { | ||
var options_ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : optionsDefault$5; | ||
var options = merge$1(options_, optionsDefault$5); | ||
var value = value_; | ||
if (options.serialize) value = serialize$1(value); | ||
value = SHA256(value).toString(); | ||
return options.withPrefix ? "0x".concat(value) : value; | ||
}; | ||
var hash$1 = hash; | ||
var optionsDefault$4 = { | ||
filters: [',', '.', '-', '_', '\s+'], | ||
replaceWith: ' ', | ||
trim: true | ||
}; | ||
var AmauiCache = /*#__PURE__*/function () { | ||
function AmauiCache() { | ||
_classCallCheck(this, AmauiCache); | ||
} | ||
_createClass(AmauiCache, null, [{ | ||
key: "add", | ||
value: function add(value) { | ||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
var key = hash$1(args); | ||
if (!this.caches[key]) this.caches[key] = value; | ||
} | ||
}, { | ||
key: "get", | ||
value: function get() { | ||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
args[_key2] = arguments[_key2]; | ||
} | ||
var key = hash$1(args); | ||
return this.caches[key]; | ||
} | ||
}, { | ||
key: "has", | ||
value: function has() { | ||
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { | ||
args[_key3] = arguments[_key3]; | ||
} | ||
var key = hash$1(args); | ||
return this.caches.hasOwnProperty(key); | ||
} | ||
}]); | ||
return AmauiCache; | ||
}(); | ||
AmauiCache.caches = {}; | ||
var cleanValue = function cleanValue(value_) { | ||
var options_ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : optionsDefault$4; | ||
try { | ||
var options = merge$1(options_, optionsDefault$4); | ||
if (AmauiCache.has(value_, options)) return AmauiCache.get(value_, options); // Few predefined options | ||
// for className cammel case to regular | ||
// css property names convert | ||
if (options.className) { | ||
options.replaceWith = '-'; | ||
options.cammelCaseTransform = true; | ||
options.lowercase = true; | ||
} | ||
var saveToCache = function saveToCache(value) { | ||
return AmauiCache.add(value, value_, options_); | ||
}; | ||
if (is('string', value_)) { | ||
var value = value_; | ||
if (options.url) { | ||
var parts = value.split('?').filter(Boolean); | ||
var path = parts[0]; | ||
var query = parts[1]; | ||
if (path.slice(-1) === '/') path = path.slice(0, -1); | ||
value = query ? [path, query].join('?') : path; // Save to cache | ||
saveToCache(value); | ||
return value; | ||
} | ||
if (options.cammelCaseTransform) value = value.split(/(?=[A-Z])/g).join(options.replaceWith || ' '); | ||
options.filters.forEach(function (filter) { | ||
var expression = "\\".concat(filter); | ||
var regexp = new RegExp(expression, 'g'); | ||
value = value.replace(regexp, options.replaceWith || ' '); | ||
}); | ||
if (options.trim) value = value.trim(); | ||
if (options.capitalize) value = capitalize$1(value); | ||
if (options.lowercase) value = value.toLocaleLowerCase(); // Save to cache | ||
saveToCache(value); | ||
return value; | ||
} // Save to cache | ||
saveToCache(value_); | ||
return value_; | ||
} catch (error) {} | ||
return value_; | ||
}; | ||
var cleanValue$1 = cleanValue; | ||
var optionsDefault$3 = { | ||
valueOverride: false | ||
}; | ||
var setObjectValue = function setObjectValue(object) { | ||
var keys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; | ||
var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; | ||
var options_ = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : optionsDefault$3; | ||
var options = merge$1(options_, optionsDefault$3); | ||
if (!(object || keys)) return object; | ||
if (is('string', keys)) { | ||
var keys_ = keys.split('.').filter(Boolean).map(function (key) { | ||
return castParam$1(key); | ||
}); | ||
return setObjectValue(object, keys_, value, options); | ||
} | ||
if (is('array', keys)) { | ||
var key = keys[0]; | ||
var keyClean = cleanValue$1(String(key), { | ||
filters: ['.', ','], | ||
replaceWith: '' | ||
}); | ||
if (keys.length === 1 && value !== undefined) { | ||
if (is('array', object) && is('number', key) || is('object', object) && is('string', key)) { | ||
object[is('string', key) ? keyClean : key] = value; | ||
} | ||
} else { | ||
// Add array or object as a value of the key, if that key doesn't exist atm | ||
if (!object.hasOwnProperty(key) || options.valueOverride) object[keyClean] = is('number', keys[1]) ? [] : {}; | ||
var value_ = object[keyClean]; // If we are trying to set a deeply nested value on a | ||
// simple value type, meaning if it's not an array or an object, | ||
// To override existing value use valueOverride: true option | ||
if (!(is('object', value_) || is('array', value_))) return object; | ||
return setObjectValue(object[key], keys.slice(1), value, options); | ||
} | ||
} | ||
return object; | ||
}; | ||
var setObjectValue$1 = setObjectValue; | ||
var getEnvironment = function getEnvironment() { | ||
if (typeof self !== 'undefined') return self; | ||
if (typeof window !== 'undefined') return window; | ||
if (typeof global$1 !== 'undefined') return global$1; | ||
}; | ||
var getEnvironment$1 = getEnvironment; | ||
var optionsDefault$2 = { | ||
returnSame: true | ||
}; | ||
var parse = function parse(value) { | ||
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'JSON'; | ||
var options_ = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : optionsDefault$2; | ||
var options = merge$1(options_, optionsDefault$2); | ||
switch (type) { | ||
case 'JSON': | ||
try { | ||
return JSON.parse(value); | ||
} catch (error) { | ||
if (options.log) { | ||
var _env$AMAUI; | ||
console.error('Parse JSON: ', error); | ||
var env = getEnvironment$1(); | ||
if (((_env$AMAUI = env.AMAUI) === null || _env$AMAUI === void 0 ? void 0 : _env$AMAUI.env) === 'test') { | ||
var _env$AMAUI2, _env$AMAUI2$test, _env$AMAUI2$test$pars; | ||
if (!((_env$AMAUI2 = env.AMAUI) !== null && _env$AMAUI2 !== void 0 && (_env$AMAUI2$test = _env$AMAUI2.test) !== null && _env$AMAUI2$test !== void 0 && (_env$AMAUI2$test$pars = _env$AMAUI2$test.parse) !== null && _env$AMAUI2$test$pars !== void 0 && _env$AMAUI2$test$pars.logs)) setObjectValue$1(env, 'AMAUI.test.parse.logs', []); | ||
env.AMAUI.test.parse.logs.push(error); | ||
} | ||
} | ||
} | ||
break; | ||
} | ||
if (options.returnSame) return value; | ||
}; | ||
var parse$1 = parse; | ||
var optionsDefault$1 = {}; | ||
@@ -566,3 +1791,3 @@ var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; | ||
var parts = cookie.split('='); | ||
items[this.propertyOriginal(parts[0])] = castParam$1(parts.slice(1).join('=')); | ||
items[this.propertyOriginal(parts[0])] = parse$1(parts.slice(1).join('=')); | ||
} | ||
@@ -569,0 +1794,0 @@ } catch (err) { |
@@ -1,2 +0,2 @@ | ||
/** @license AmauiCookie v1.0.112 | ||
/** @license AmauiCookie v1.0.113 | ||
* | ||
@@ -6,2 +6,2 @@ * This source code is licensed under the MIT license found in the | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).AmauiCookie=t()}(this,(function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var r="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}var a={elementIsObject:!1},u=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,u=i({},a,r);switch(t){case"string":return"string"==typeof n;case"number":return"number"==typeof n&&!Number.isNaN(n);case"boolean":return"boolean"==typeof n;case"array":return Array.isArray(n);case"object":var c="object"===o(n)&&!!n&&n.constructor===Object,l=e("element",n,u);return c&&(!l||u.elementIsObject);case"object-like":return"object"===o(n)&&(null===n||n.constructor!==Object);case"class":return("object"===o(n)||"function"==typeof n)&&(/class/gi.test(String(n))||/class/gi.test(String(null==n?void 0:n.constructor)));case"function":return!!(n&&n instanceof Function);case"async":return!(!e("function",n)||!(s("browser")?"AsyncFunction"===n.constructor.name:n()instanceof Promise));case"date":return!!(n&&n instanceof Date);case"element":return!(!n||!n.elementType&&!n.hasOwnProperty("$$typeof"));case"simple":return e("string",n,u)||e("number",n,u)||e("boolean",n,u)||e("element",n,u)&&!u.elementIsObject||[void 0,null].indexOf(n)>-1;case"not-array-object":return!e("array",n,u)&&!e("object",n,u);case"array-buffer":return"[object ArrayBuffer]"===String(n);case"blob":return s("browser")&&n instanceof Blob;case"buffer":return!!(s("nodejs")&&n&&null!==n.constructor&&"function"==typeof n.constructor.isBuffer&&n.constructor.isBuffer(n));default:return!1}},s=function e(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;switch(t){case"browser":return"undefined"!=typeof window&&void 0!==window.document;case"worker":return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope;case"nodejs":return!(void 0===r||"undefined"==typeof module||!module.exports);case"localhost":return n=void 0!==o?o:e("browser")&&window.location.hostname,u("string",n)&&["localhost","127.0.0.1"].some((function(e){return n.indexOf(e)>-1}));default:return!1}},c=function e(t){if(u("array",t))return t.map((function(t){return e(t)}));if(u("object",t)){var n={};return Object.keys(t).forEach((function(r){return n[r]=e(t[r])})),n}return t},l={copy:!1,merge:{array:!1}},f=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l,o=i({},l,r);if(o.merge.array&&u("array",t)&&u("array",n))for(var a=Math.max(t.length,n.length),s=0;s<a;s++)void 0===t[s]&&(t[s]=n[s]),(u("object",t[s])&&u("object",n[s])||u("array",t[s])&&u("array",n[s]))&&(t[s]=e(t[s],n[s],o));return u("object",t)&&u("object",n)&&Object.keys(n).forEach((function(r){t.hasOwnProperty(r)?u("object",t[r])&&u("object",n[r])&&(t[r]=e(t[r],n[r],o)):t[r]=o.copy?c(n[r]):n[r]})),t},h={decode:!0,decodeMethod:decodeURIComponent},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h,n=f(t,h),r=e;u("string",e)&&n.decode&&u("function",n.decodeMethod)&&(r=n.decodeMethod(e));try{if(u("string",r)){if("undefined"===r)return;return"NaN"===r?NaN:JSON.parse(r)}return r}catch(e){}return r},y=function e(t){return u("object",t)?"{".concat(Object.keys(t).sort().map((function(n){return'"'.concat(n,'":').concat(e(t[n]))})).join(","),"}"):u("array",t)?"[".concat(t.map((function(t){return e(t)})).join(","),"]"):u("string",t)?'"'.concat(t,'"'):function(e){return u("string",e)?e.replace(/(\s|\r|\n)+/," "):e}(JSON.stringify(function(e){return void 0===e?"undefined":e instanceof Function||e instanceof Object?e.toString():e}(t)))},v={},p=["January","February","March","April","May","June","July","August","September","October","November","December"],g=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],m=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],b=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function w(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k.amauidate;if(n&&n.valid)switch(t){case"millisecond":return new k(n.value.setMilliseconds(n.millisecond+e));case"second":return new k(n.value.setSeconds(n.second+e));case"minute":return new k(n.value.setMinutes(n.minute+e));case"hour":return new k(n.value.setHours(n.hour+e));case"day":return new k(n.value.setDate(n.day+e));case"week":return new k(n.value.setDate(n.day+7*e));case"month":return new k(n.value.setMonth(n.month-1+e));case"year":return new k(n.value.setFullYear(n.year+e))}}var k=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;e(this,t),this.value_=n,this.options=r,this.value=void 0,this.millisecond=void 0,this.milliseconds=void 0,this.second=void 0,this.minute=void 0,this.hour=void 0,this.day=void 0,this.dayWeek=void 0,this.dayYear=void 0,this.week=void 0,this.month=void 0,this.year=void 0,this.init()}return n(t,[{key:"init",value:function(){this.options=f(this.options,v),u("number",this.value_)&&10===String(this.value_).length&&(this.value_*=1e3),this.value=new Date(this.value_ instanceof t?this.value_.value:this.value_),this.valid&&(this.millisecond=this.value[this.options.utc?"getUTCMilliseconds":"getMilliseconds"](),this.milliseconds=this.value.getTime(),this.second=this.value[this.options.utc?"getUTCSeconds":"getSeconds"](),this.minute=this.value[this.options.utc?"getUTCMinutes":"getMinutes"](),this.hour=this.value[this.options.utc?"getUTCHours":"getHours"](),this.day=this.value[this.options.utc?"getUTCDate":"getDate"](),this.dayWeek=this.value[this.options.utc?"getUTCDay":"getDay"](),this.month=this.value[this.options.utc?"getUTCMonth":"getMonth"]()+1,this.year=this.value[this.options.utc?"getUTCFullYear":"getFullYear"](),this.dayYear=Math.floor((this.milliseconds-Number(new Date(this.year,0,0)))/1e3/60/60/24),this.weekValue())}},{key:"weekValue",value:function(){var e=new Date(this.year,0,1);return e.setDate(e.getDate()+(1-e.getDay()%7)),this.week=Math.round((Number(this.value)-Number(e))/6048e5)+1,this.week}},{key:"months",get:function(){var e;return(null===(e=this.options.overrides)||void 0===e?void 0:e.months)||p}},{key:"monthsAbr",get:function(){var e;return(null===(e=this.options.overrides)||void 0===e?void 0:e.monthsAbr)||g}},{key:"daysWeek",get:function(){var e;return(null===(e=this.options.overrides)||void 0===e?void 0:e.daysWeek)||m}},{key:"daysWeekAbr",get:function(){var e;return(null===(e=this.options.overrides)||void 0===e?void 0:e.daysWeekAbr)||b}},{key:"valid",get:function(){return void 0===this.value_||this.value_ instanceof Date||this.value_ instanceof t||(e=new Date(this.value_).getTime(),Number.isInteger(e)&&String(e).length>=10&&(new Date(e).getTime()>0||new Date(1e3*e).getTime()>0));var e}},{key:"local",get:function(){if(this.valid)return new t(new Date(this.value.toLocaleString("en-us")))}},{key:"utc",get:function(){return new t(this.value,{utc:!0})}},{key:"iso",get:function(){if(this.valid)return this.value.toISOString()}},{key:"daysInMonth",get:function(){return new Date(this.year,this.month,0).getDate()}},{key:"weeksInYear",get:function(){var e=new Date(this.year,0,1),t=1===new Date(this.year,1,29).getMonth();return 4===e.getDay()||t&&3===e.getDay()?53:52}},{key:"valueOf",get:function(){return this.milliseconds}},{key:"unix",get:function(){if(this.valid)return Math.floor(this.value.getTime()/1e3)}},{key:"timezone",value:function(e){if(this.valid&&e)return new t(this.value.toLocaleString("en-us",{timeZone:e}))}}],[{key:"utc",get:function(){return new t(new Date,{utc:!0})}},{key:"daysInMonth",get:function(){return(new t).daysInMonth}},{key:"valueOf",get:function(){return(new t).valueOf}},{key:"unix",get:function(){return(new t).unix}},{key:"milliseconds",get:function(){return(new t).milliseconds}},{key:"iso",get:function(){return(new t).iso}},{key:"amauidate",get:function(){return new t}},{key:"local",get:function(){return(new t).local}}]),t}();function j(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return O(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var S={namespace:"AMAUI",namespace_separator:"_"},D=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:S;e(this,t),this.options=void 0,this.removeNotAllowed=[],this.options=f(n,S)}return n(t,[{key:"namespace",get:function(){return"".concat(this.options.namespace).concat(this.options.namespace_separator)}},{key:"properties",get:function(){return Object.keys(this.items)}},{key:"values",get:function(){var e=this.items;return Object.keys(e).map((function(t){return e[t]}))}},{key:"items",get:function(){var e=this;if(s("browser")){var n,r={},o=j(t.cookie.split("; ").filter((function(t){return 0===t.indexOf(e.namespace)})));try{for(o.s();!(n=o.n()).done;){var i=n.value.split("=");r[this.propertyOriginal(i[0])]=d(i.slice(1).join("="))}}catch(e){o.e(e)}finally{o.f()}return r}}},{key:"clear",get:function(){var e=this;return this.properties.filter((function(t){return-1===e.removeNotAllowed.indexOf(t)||-1===e.removeNotAllowed.indexOf(e.propertyOriginal(t))})).forEach((function(t){return e.remove(t)}))}},{key:"get",value:function(e){if(s("browser"))return this.items[e]}},{key:"has",value:function(e){if(s("browser"))return this.items.hasOwnProperty(e)}},{key:"add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:364,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"/";if(s("browser")){var o=this.property(e),i=u("string",t)?t:y(t),a=w(n,"day").utc;document.cookie="".concat(o,"=").concat(i,"; expires=").concat(a,"; path=").concat(r)}}},{key:"update",value:function(){return this.add.apply(this,arguments)}},{key:"remove",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";if(s("browser")){var n=this.items;n.hasOwnProperty(e)&&(document.cookie="".concat(this.property(e),"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=").concat(t))}}},{key:"property",value:function(e){return"".concat(this.namespace).concat(e)}},{key:"propertyOriginal",value:function(e){return 0===e.indexOf(this.namespace)?e.slice(this.namespace.length):e}}],[{key:"cookie",get:function(){return s("browser")&&window.document.cookie||""}},{key:"clear",get:function(){return t.cookie.split("; ").map((function(e){return e.split("=")[0]})).forEach((function(e){return document.cookie="".concat(e,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/")}))}}]),t}();return D})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).AmauiCookie=t()}(this,(function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var r="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(){return o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}var a={elementIsObject:!1},s=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,s=o({},a,r);switch(t){case"string":return"string"==typeof n;case"number":return"number"==typeof n&&!Number.isNaN(n);case"boolean":return"boolean"==typeof n;case"array":return Array.isArray(n);case"object":var c="object"===i(n)&&!!n&&n.constructor===Object,l=e("element",n,s);return c&&(!l||s.elementIsObject);case"object-like":return"object"===i(n)&&(null===n||n.constructor!==Object);case"class":return("object"===i(n)||"function"==typeof n)&&(/class/gi.test(String(n))||/class/gi.test(String(null==n?void 0:n.constructor)));case"function":return!!(n&&n instanceof Function);case"async":return!(!e("function",n)||!(u("browser")?"AsyncFunction"===n.constructor.name:n()instanceof Promise));case"date":return!!(n&&n instanceof Date);case"element":return!(!n||!n.elementType&&!n.hasOwnProperty("$$typeof"));case"simple":return e("string",n,s)||e("number",n,s)||e("boolean",n,s)||e("element",n,s)&&!s.elementIsObject||[void 0,null].indexOf(n)>-1;case"not-array-object":return!e("array",n,s)&&!e("object",n,s);case"array-buffer":return"[object ArrayBuffer]"===String(n);case"blob":return u("browser")&&n instanceof Blob;case"buffer":return!!(u("nodejs")&&n&&null!==n.constructor&&"function"==typeof n.constructor.isBuffer&&n.constructor.isBuffer(n));default:return!1}},u=function e(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;switch(t){case"browser":return"undefined"!=typeof window&&void 0!==window.document;case"worker":return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope;case"nodejs":return!(void 0===r||"undefined"==typeof module||!module.exports);case"localhost":return n=void 0!==i?i:e("browser")&&window.location.hostname,s("string",n)&&["localhost","127.0.0.1"].some((function(e){return n.indexOf(e)>-1}));default:return!1}},c=function e(t){if(s("array",t))return t.map((function(t){return e(t)}));if(s("object",t)){var n={};return Object.keys(t).forEach((function(r){return n[r]=e(t[r])})),n}return t},l={copy:!1,merge:{array:!1}},f=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l,i=o({},l,r);if(i.merge.array&&s("array",t)&&s("array",n))for(var a=Math.max(t.length,n.length),u=0;u<a;u++)void 0===t[u]&&(t[u]=n[u]),(s("object",t[u])&&s("object",n[u])||s("array",t[u])&&s("array",n[u]))&&(t[u]=e(t[u],n[u],i));return s("object",t)&&s("object",n)&&Object.keys(n).forEach((function(r){t.hasOwnProperty(r)?s("object",t[r])&&s("object",n[r])&&(t[r]=e(t[r],n[r],i)):t[r]=i.copy?c(n[r]):n[r]})),t},h={decode:!0,decodeMethod:decodeURIComponent},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h,n=f(t,h),r=e;s("string",e)&&n.decode&&s("function",n.decodeMethod)&&(r=n.decodeMethod(e));try{if(s("string",r)){if("undefined"===r)return;return"NaN"===r?NaN:JSON.parse(r)}return r}catch(e){}return r},y=function e(t){return s("object",t)?"{".concat(Object.keys(t).sort().map((function(n){return'"'.concat(n,'":').concat(e(t[n]))})).join(","),"}"):s("array",t)?"[".concat(t.map((function(t){return e(t)})).join(","),"]"):s("string",t)?'"'.concat(t,'"'):function(e){return s("string",e)?e.replace(/(\s|\r|\n)+/," "):e}(JSON.stringify(function(e){return void 0===e?"undefined":e instanceof Function||e instanceof Object?e.toString():e}(t)))},v=function(e){return s("string",e)?"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1)):e};var p={exports:{}},g={exports:{}};!function(e,t){var n;e.exports=(n=n||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==r&&r.crypto&&(n=r.crypto),!n)try{n=require("crypto")}catch(e){}var i=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),a={},s=a.lib={},u=s.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=s.WordArray=u.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var a=n[o>>>2]>>>24-o%4*8&255;t[r+o>>>2]|=a<<24-(r+o)%4*8}else for(var s=0;s<i;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=u.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(i());return new c.init(t,e)}}),l=a.enc={},f=l.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new c.init(n,t/2)}},h=l.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new c.init(n,t)}},d=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},y=s.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,o=r.sigBytes,a=this.blockSize,s=o/(4*a),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,l=e.min(4*u,o);if(u){for(var f=0;f<u;f+=a)this._doProcessBlock(i,f);n=i.splice(0,u),r.sigBytes-=l}return new c.init(n,l)},clone:function(){var e=u.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});s.Hasher=y.extend({cfg:u.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){y.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new v.HMAC.init(e,n).finalize(t)}}});var v=a.algo={};return a}(Math),n)}(g),function(e,t){var n;e.exports=(n=g.exports,function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,a=t.algo,s=[],u=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)t(r)&&(i<8&&(s[i]=n(e.pow(r,.5))),u[i]=n(e.pow(r,1/3)),i++),r++}();var c=[],l=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],f=n[6],h=n[7],d=0;d<64;d++){if(d<16)c[d]=0|e[t+d];else{var y=c[d-15],v=(y<<25|y>>>7)^(y<<14|y>>>18)^y>>>3,p=c[d-2],g=(p<<15|p>>>17)^(p<<13|p>>>19)^p>>>10;c[d]=v+c[d-7]+g+c[d-16]}var m=r&i^r&o^i&o,w=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),b=h+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&f)+u[d]+c[d];h=f,f=l,l=s,s=a+b|0,a=o,o=i,i=r,r=b+(w+m)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+f|0,n[7]=n[7]+h|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(l),t.HmacSHA256=o._createHmacHelper(l)}(Math),n.SHA256)}(p);var m=p.exports,w={serialize:!0,withPrefix:!0},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:w,n=f(t,w),r=e;return n.serialize&&(r=y(r)),r=m(r).toString(),n.withPrefix?"0x".concat(r):r},k={filters:[",",".","-","_","s+"],replaceWith:" ",trim:!0},S=function(){function t(){e(this,t)}return n(t,null,[{key:"add",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=b(n);this.caches[i]||(this.caches[i]=e)}},{key:"get",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=b(t);return this.caches[r]}},{key:"has",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=b(t);return this.caches.hasOwnProperty(r)}}]),t}();S.caches={};var O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k;try{var n=f(t,k);if(S.has(e,n))return S.get(e,n);n.className&&(n.replaceWith="-",n.cammelCaseTransform=!0,n.lowercase=!0);var r=function(n){return S.add(n,e,t)};if(s("string",e)){var i=e;if(n.url){var o=i.split("?").filter(Boolean),a=o[0],u=o[1];return"/"===a.slice(-1)&&(a=a.slice(0,-1)),r(i=u?[a,u].join("?"):a),i}return n.cammelCaseTransform&&(i=i.split(/(?=[A-Z])/g).join(n.replaceWith||" ")),n.filters.forEach((function(e){var t="\\".concat(e),r=new RegExp(t,"g");i=i.replace(r,n.replaceWith||" ")})),n.trim&&(i=i.trim()),n.capitalize&&(i=v(i)),n.lowercase&&(i=i.toLocaleLowerCase()),r(i),i}return r(e),e}catch(e){}return e},j={valueOverride:!1},A=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:j,o=f(i,j);if(!t&&!n)return t;if(s("string",n)){var a=n.split(".").filter(Boolean).map((function(e){return d(e)}));return e(t,a,r,o)}if(s("array",n)){var u=n[0],c=O(String(u),{filters:[".",","],replaceWith:""});if(1!==n.length||void 0===r){t.hasOwnProperty(u)&&!o.valueOverride||(t[c]=s("number",n[1])?[]:{});var l=t[c];return s("object",l)||s("array",l)?e(t[u],n.slice(1),r,o):t}(s("array",t)&&s("number",u)||s("object",t)&&s("string",u))&&(t[s("string",u)?c:u]=r)}return t},_=function(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r?r:void 0},x={returnSame:!0},M=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"JSON",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:x,r=f(n,x);if("JSON"===t)try{return JSON.parse(e)}catch(e){if(r.log){var i;console.error("Parse JSON: ",e);var o,a,s,u=_();if("test"===(null===(i=u.AMAUI)||void 0===i?void 0:i.env))null!==(o=u.AMAUI)&&void 0!==o&&null!==(a=o.test)&&void 0!==a&&null!==(s=a.parse)&&void 0!==s&&s.logs||A(u,"AMAUI.test.parse.logs",[]),u.AMAUI.test.parse.logs.push(e)}}if(r.returnSame)return e},T={},D=["January","February","March","April","May","June","July","August","September","October","November","December"],B=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],C=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],I=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function N(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:U.amauidate;if(n&&n.valid)switch(t){case"millisecond":return new U(n.value.setMilliseconds(n.millisecond+e));case"second":return new U(n.value.setSeconds(n.second+e));case"minute":return new U(n.value.setMinutes(n.minute+e));case"hour":return new U(n.value.setHours(n.hour+e));case"day":return new U(n.value.setDate(n.day+e));case"week":return new U(n.value.setDate(n.day+7*e));case"month":return new U(n.value.setMonth(n.month-1+e));case"year":return new U(n.value.setFullYear(n.year+e))}}var U=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:T;e(this,t),this.value_=n,this.options=r,this.value=void 0,this.millisecond=void 0,this.milliseconds=void 0,this.second=void 0,this.minute=void 0,this.hour=void 0,this.day=void 0,this.dayWeek=void 0,this.dayYear=void 0,this.week=void 0,this.month=void 0,this.year=void 0,this.init()}return n(t,[{key:"init",value:function(){this.options=f(this.options,T),s("number",this.value_)&&10===String(this.value_).length&&(this.value_*=1e3),this.value=new Date(this.value_ instanceof t?this.value_.value:this.value_),this.valid&&(this.millisecond=this.value[this.options.utc?"getUTCMilliseconds":"getMilliseconds"](),this.milliseconds=this.value.getTime(),this.second=this.value[this.options.utc?"getUTCSeconds":"getSeconds"](),this.minute=this.value[this.options.utc?"getUTCMinutes":"getMinutes"](),this.hour=this.value[this.options.utc?"getUTCHours":"getHours"](),this.day=this.value[this.options.utc?"getUTCDate":"getDate"](),this.dayWeek=this.value[this.options.utc?"getUTCDay":"getDay"](),this.month=this.value[this.options.utc?"getUTCMonth":"getMonth"]()+1,this.year=this.value[this.options.utc?"getUTCFullYear":"getFullYear"](),this.dayYear=Math.floor((this.milliseconds-Number(new Date(this.year,0,0)))/1e3/60/60/24),this.weekValue())}},{key:"weekValue",value:function(){var e=new Date(this.year,0,1);return e.setDate(e.getDate()+(1-e.getDay()%7)),this.week=Math.round((Number(this.value)-Number(e))/6048e5)+1,this.week}},{key:"months",get:function(){var e;return(null===(e=this.options.overrides)||void 0===e?void 0:e.months)||D}},{key:"monthsAbr",get:function(){var e;return(null===(e=this.options.overrides)||void 0===e?void 0:e.monthsAbr)||B}},{key:"daysWeek",get:function(){var e;return(null===(e=this.options.overrides)||void 0===e?void 0:e.daysWeek)||C}},{key:"daysWeekAbr",get:function(){var e;return(null===(e=this.options.overrides)||void 0===e?void 0:e.daysWeekAbr)||I}},{key:"valid",get:function(){return void 0===this.value_||this.value_ instanceof Date||this.value_ instanceof t||(e=new Date(this.value_).getTime(),Number.isInteger(e)&&String(e).length>=10&&(new Date(e).getTime()>0||new Date(1e3*e).getTime()>0));var e}},{key:"local",get:function(){if(this.valid)return new t(new Date(this.value.toLocaleString("en-us")))}},{key:"utc",get:function(){return new t(this.value,{utc:!0})}},{key:"iso",get:function(){if(this.valid)return this.value.toISOString()}},{key:"daysInMonth",get:function(){return new Date(this.year,this.month,0).getDate()}},{key:"weeksInYear",get:function(){var e=new Date(this.year,0,1),t=1===new Date(this.year,1,29).getMonth();return 4===e.getDay()||t&&3===e.getDay()?53:52}},{key:"valueOf",get:function(){return this.milliseconds}},{key:"unix",get:function(){if(this.valid)return Math.floor(this.value.getTime()/1e3)}},{key:"timezone",value:function(e){if(this.valid&&e)return new t(this.value.toLocaleString("en-us",{timeZone:e}))}}],[{key:"utc",get:function(){return new t(new Date,{utc:!0})}},{key:"daysInMonth",get:function(){return(new t).daysInMonth}},{key:"valueOf",get:function(){return(new t).valueOf}},{key:"unix",get:function(){return(new t).unix}},{key:"milliseconds",get:function(){return(new t).milliseconds}},{key:"iso",get:function(){return(new t).iso}},{key:"amauidate",get:function(){return new t}},{key:"local",get:function(){return(new t).local}}]),t}();function H(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return P(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return P(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var W={namespace:"AMAUI",namespace_separator:"_"},J=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:W;e(this,t),this.options=void 0,this.removeNotAllowed=[],this.options=f(n,W)}return n(t,[{key:"namespace",get:function(){return"".concat(this.options.namespace).concat(this.options.namespace_separator)}},{key:"properties",get:function(){return Object.keys(this.items)}},{key:"values",get:function(){var e=this.items;return Object.keys(e).map((function(t){return e[t]}))}},{key:"items",get:function(){var e=this;if(u("browser")){var n,r={},i=H(t.cookie.split("; ").filter((function(t){return 0===t.indexOf(e.namespace)})));try{for(i.s();!(n=i.n()).done;){var o=n.value.split("=");r[this.propertyOriginal(o[0])]=M(o.slice(1).join("="))}}catch(e){i.e(e)}finally{i.f()}return r}}},{key:"clear",get:function(){var e=this;return this.properties.filter((function(t){return-1===e.removeNotAllowed.indexOf(t)||-1===e.removeNotAllowed.indexOf(e.propertyOriginal(t))})).forEach((function(t){return e.remove(t)}))}},{key:"get",value:function(e){if(u("browser"))return this.items[e]}},{key:"has",value:function(e){if(u("browser"))return this.items.hasOwnProperty(e)}},{key:"add",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:364,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"/";if(u("browser")){var i=this.property(e),o=s("string",t)?t:y(t),a=N(n,"day").utc;document.cookie="".concat(i,"=").concat(o,"; expires=").concat(a,"; path=").concat(r)}}},{key:"update",value:function(){return this.add.apply(this,arguments)}},{key:"remove",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";if(u("browser")){var n=this.items;n.hasOwnProperty(e)&&(document.cookie="".concat(this.property(e),"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=").concat(t))}}},{key:"property",value:function(e){return"".concat(this.namespace).concat(e)}},{key:"propertyOriginal",value:function(e){return 0===e.indexOf(this.namespace)?e.slice(this.namespace.length):e}}],[{key:"cookie",get:function(){return u("browser")&&window.document.cookie||""}},{key:"clear",get:function(){return t.cookie.split("; ").map((function(e){return e.split("=")[0]})).forEach((function(e){return document.cookie="".concat(e,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/")}))}}]),t}();return J})); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
105535
2208
2