1 line
51 KiB
JavaScript
1 line
51 KiB
JavaScript
["^ ","~:resource-id",["~:shadow.build.classpath/resource","goog/structs/map.js"],"~:js","goog.provide(\"goog.structs.Map\");\ngoog.require(\"goog.collections.iters\");\ngoog.require(\"goog.iter\");\ngoog.require(\"goog.iter.Iterator\");\ngoog.require(\"goog.iter.es6\");\ngoog.structs.Map = function(opt_map, var_args) {\n this.map_ = {};\n this.keys_ = [];\n this.size = 0;\n this.version_ = 0;\n var argLength = arguments.length;\n if (argLength > 1) {\n if (argLength % 2) {\n throw new Error(\"Uneven number of arguments\");\n }\n for (var i = 0; i < argLength; i += 2) {\n this.set(arguments[i], arguments[i + 1]);\n }\n } else if (opt_map) {\n this.addAll(opt_map);\n }\n};\ngoog.structs.Map.prototype.getCount = function() {\n return this.size;\n};\ngoog.structs.Map.prototype.getValues = function() {\n this.cleanupKeysArray_();\n var rv = [];\n for (var i = 0; i < this.keys_.length; i++) {\n var key = this.keys_[i];\n rv.push(this.map_[key]);\n }\n return rv;\n};\ngoog.structs.Map.prototype.getKeys = function() {\n this.cleanupKeysArray_();\n return this.keys_.concat();\n};\ngoog.structs.Map.prototype.containsKey = function(key) {\n return this.has(key);\n};\ngoog.structs.Map.prototype.has = function(key) {\n return goog.structs.Map.hasKey_(this.map_, key);\n};\ngoog.structs.Map.prototype.containsValue = function(val) {\n for (var i = 0; i < this.keys_.length; i++) {\n var key = this.keys_[i];\n if (goog.structs.Map.hasKey_(this.map_, key) && this.map_[key] == val) {\n return true;\n }\n }\n return false;\n};\ngoog.structs.Map.prototype.equals = function(otherMap, opt_equalityFn) {\n if (this === otherMap) {\n return true;\n }\n if (this.size != otherMap.getCount()) {\n return false;\n }\n var equalityFn = opt_equalityFn || goog.structs.Map.defaultEquals;\n this.cleanupKeysArray_();\n for (var key, i = 0; key = this.keys_[i]; i++) {\n if (!equalityFn(this.get(key), otherMap.get(key))) {\n return false;\n }\n }\n return true;\n};\ngoog.structs.Map.defaultEquals = function(a, b) {\n return a === b;\n};\ngoog.structs.Map.prototype.isEmpty = function() {\n return this.size == 0;\n};\ngoog.structs.Map.prototype.clear = function() {\n this.map_ = {};\n this.keys_.length = 0;\n this.setSizeInternal_(0);\n this.version_ = 0;\n};\ngoog.structs.Map.prototype.remove = function(key) {\n return this.delete(key);\n};\ngoog.structs.Map.prototype.delete = function(key) {\n if (goog.structs.Map.hasKey_(this.map_, key)) {\n delete this.map_[key];\n this.setSizeInternal_(this.size - 1);\n this.version_++;\n if (this.keys_.length > 2 * this.size) {\n this.cleanupKeysArray_();\n }\n return true;\n }\n return false;\n};\ngoog.structs.Map.prototype.cleanupKeysArray_ = function() {\n if (this.size != this.keys_.length) {\n var srcIndex = 0;\n var destIndex = 0;\n while (srcIndex < this.keys_.length) {\n var key = this.keys_[srcIndex];\n if (goog.structs.Map.hasKey_(this.map_, key)) {\n this.keys_[destIndex++] = key;\n }\n srcIndex++;\n }\n this.keys_.length = destIndex;\n }\n if (this.size != this.keys_.length) {\n var seen = {};\n var srcIndex = 0;\n var destIndex = 0;\n while (srcIndex < this.keys_.length) {\n var key = this.keys_[srcIndex];\n if (!goog.structs.Map.hasKey_(seen, key)) {\n this.keys_[destIndex++] = key;\n seen[key] = 1;\n }\n srcIndex++;\n }\n this.keys_.length = destIndex;\n }\n};\ngoog.structs.Map.prototype.get = function(key, opt_val) {\n if (goog.structs.Map.hasKey_(this.map_, key)) {\n return this.map_[key];\n }\n return opt_val;\n};\ngoog.structs.Map.prototype.set = function(key, value) {\n if (!goog.structs.Map.hasKey_(this.map_, key)) {\n this.setSizeInternal_(this.size + 1);\n this.keys_.push(key);\n this.version_++;\n }\n this.map_[key] = value;\n};\ngoog.structs.Map.prototype.addAll = function(map) {\n if (map instanceof goog.structs.Map) {\n var keys = map.getKeys();\n for (var i = 0; i < keys.length; i++) {\n this.set(keys[i], map.get(keys[i]));\n }\n } else {\n for (var key in map) {\n this.set(key, map[key]);\n }\n }\n};\ngoog.structs.Map.prototype.forEach = function(f, opt_obj) {\n var keys = this.getKeys();\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = this.get(key);\n f.call(opt_obj, value, key, this);\n }\n};\ngoog.structs.Map.prototype.clone = function() {\n return new goog.structs.Map(this);\n};\ngoog.structs.Map.prototype.transpose = function() {\n var transposed = new goog.structs.Map();\n for (var i = 0; i < this.keys_.length; i++) {\n var key = this.keys_[i];\n var value = this.map_[key];\n transposed.set(value, key);\n }\n return transposed;\n};\ngoog.structs.Map.prototype.toObject = function() {\n this.cleanupKeysArray_();\n var obj = {};\n for (var i = 0; i < this.keys_.length; i++) {\n var key = this.keys_[i];\n obj[key] = this.map_[key];\n }\n return obj;\n};\ngoog.structs.Map.prototype.getKeyIterator = function() {\n return this.__iterator__(true);\n};\ngoog.structs.Map.prototype.keys = function() {\n return goog.iter.es6.ShimIterable.of(this.getKeyIterator()).toEs6();\n};\ngoog.structs.Map.prototype.getValueIterator = function() {\n return this.__iterator__(false);\n};\ngoog.structs.Map.prototype.values = function() {\n return goog.iter.es6.ShimIterable.of(this.getValueIterator()).toEs6();\n};\ngoog.structs.Map.prototype.entries = function() {\n const self = this;\n return goog.collections.iters.map(this.keys(), function(key) {\n return [key, self.get(key)];\n });\n};\ngoog.structs.Map.prototype.__iterator__ = function(opt_keys) {\n this.cleanupKeysArray_();\n var i = 0;\n var version = this.version_;\n var selfObj = this;\n var newIter = new goog.iter.Iterator();\n newIter.next = function() {\n if (version != selfObj.version_) {\n throw new Error(\"The map has changed since the iterator was created\");\n }\n if (i >= selfObj.keys_.length) {\n return goog.iter.ES6_ITERATOR_DONE;\n }\n var key = selfObj.keys_[i++];\n return goog.iter.createEs6IteratorYield(opt_keys ? key : selfObj.map_[key]);\n };\n return newIter;\n};\ngoog.structs.Map.prototype.setSizeInternal_ = function(newSize) {\n this.size = newSize;\n};\ngoog.structs.Map.hasKey_ = function(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n};\n","~:source","/**\n * @license\n * Copyright The Closure Library Authors.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Datastructure: Hash Map.\n *\n *\n * This file contains an implementation of a Map structure. It implements a lot\n * of the methods used in goog.structs so those functions work on hashes. This\n * is best suited for complex key types. For simple keys such as numbers and\n * strings consider using the lighter-weight utilities in goog.object.\n * @deprecated goog.structs.Map is deprecated in favour of ES6 Maps.\n */\n\n\ngoog.provide('goog.structs.Map');\n\ngoog.require('goog.collections.iters');\ngoog.require('goog.iter');\ngoog.require('goog.iter.Iterator');\ngoog.require('goog.iter.es6');\n\n\n\n/**\n * Class for Hash Map datastructure.\n * @param {*=} opt_map Map or Object to initialize the map with.\n * @param {...*} var_args If 2 or more arguments are present then they\n * will be used as key-value pairs.\n * @constructor\n * @final\n * @template K, V\n * @deprecated This type is misleading: use ES6 Map instead.\n */\ngoog.structs.Map = function(opt_map, var_args) {\n 'use strict';\n /**\n * Underlying JS object used to implement the map.\n * @private {!Object}\n */\n this.map_ = {};\n\n /**\n * An array of keys. This is necessary for two reasons:\n * 1. Iterating the keys using for (var key in this.map_) allocates an\n * object for every key in IE which is really bad for IE6 GC perf.\n * 2. Without a side data structure, we would need to escape all the keys\n * as that would be the only way we could tell during iteration if the\n * key was an internal key or a property of the object.\n *\n * This array can contain deleted keys so it's necessary to check the map\n * as well to see if the key is still in the map (this doesn't require a\n * memory allocation in IE).\n * @private {!Array<string>}\n */\n this.keys_ = [];\n\n /**\n * The number of key value pairs in the map.\n * @const {number}\n */\n this.size = 0;\n\n /**\n * Version used to detect changes while iterating.\n * @private {number}\n */\n this.version_ = 0;\n\n var argLength = arguments.length;\n\n if (argLength > 1) {\n if (argLength % 2) {\n throw new Error('Uneven number of arguments');\n }\n for (var i = 0; i < argLength; i += 2) {\n this.set(arguments[i], arguments[i + 1]);\n }\n } else if (opt_map) {\n this.addAll(/** @type {!Object} */ (opt_map));\n }\n};\n\n\n/**\n * @return {number} The number of key-value pairs in the map.\n * @deprecated Use the `size` property instead, for alignment with ES6 Map.\n */\ngoog.structs.Map.prototype.getCount = function() {\n 'use strict';\n return this.size;\n};\n\n\n/**\n * Returns the values of the map.\n * @return {!Array<V>} The values in the map.\n * @deprecated Use `Array.from(map.values())` instead, for alignment with ES6\n * Map.\n */\ngoog.structs.Map.prototype.getValues = function() {\n 'use strict';\n this.cleanupKeysArray_();\n\n var rv = [];\n for (var i = 0; i < this.keys_.length; i++) {\n var key = this.keys_[i];\n rv.push(this.map_[key]);\n }\n return rv;\n};\n\n\n/**\n * Returns the keys of the map.\n * @return {!Array<string>} Array of string values.\n * @deprecated Use `Array.from(map.keys())` instead, for alignment with ES6 Map.\n */\ngoog.structs.Map.prototype.getKeys = function() {\n 'use strict';\n this.cleanupKeysArray_();\n return /** @type {!Array<string>} */ (this.keys_.concat());\n};\n\n\n/**\n * Whether the map contains the given key.\n * @param {*} key The key to check for.\n * @return {boolean} Whether the map contains the key.\n * @deprecated Use `has` instead, for alignment with ES6 Map.\n */\ngoog.structs.Map.prototype.containsKey = function(key) {\n 'use strict';\n return this.has(key);\n};\n\n/**\n * Whether the map contains the given key.\n * @param {*} key The key to check for.\n * @return {boolean} Whether the map contains the key.\n */\ngoog.structs.Map.prototype.has = function(key) {\n 'use strict';\n return goog.structs.Map.hasKey_(this.map_, key);\n};\n\n\n/**\n * Whether the map contains the given value. This is O(n).\n * @param {V} val The value to check for.\n * @return {boolean} Whether the map contains the value.\n */\ngoog.structs.Map.prototype.containsValue = function(val) {\n 'use strict';\n for (var i = 0; i < this.keys_.length; i++) {\n var key = this.keys_[i];\n if (goog.structs.Map.hasKey_(this.map_, key) && this.map_[key] == val) {\n return true;\n }\n }\n return false;\n};\n\n\n/**\n * Whether this map is equal to the argument map.\n * @param {goog.structs.Map} otherMap The map against which to test equality.\n * @param {function(V, V): boolean=} opt_equalityFn Optional equality function\n * to test equality of values. If not specified, this will test whether\n * the values contained in each map are identical objects.\n * @return {boolean} Whether the maps are equal.\n * @deprecated Use goog.collections.maps.equals(thisMap, otherMap,\n * opt_equalityFn) instead, for alignment with ES6 Map.\n */\ngoog.structs.Map.prototype.equals = function(otherMap, opt_equalityFn) {\n 'use strict';\n if (this === otherMap) {\n return true;\n }\n\n if (this.size != otherMap.getCount()) {\n return false;\n }\n\n var equalityFn = opt_equalityFn || goog.structs.Map.defaultEquals;\n\n this.cleanupKeysArray_();\n for (var key, i = 0; key = this.keys_[i]; i++) {\n if (!equalityFn(this.get(key), otherMap.get(key))) {\n return false;\n }\n }\n\n return true;\n};\n\n\n/**\n * Default equality test for values.\n * @param {*} a The first value.\n * @param {*} b The second value.\n * @return {boolean} Whether a and b reference the same object.\n */\ngoog.structs.Map.defaultEquals = function(a, b) {\n 'use strict';\n return a === b;\n};\n\n\n/**\n * @return {boolean} Whether the map is empty.\n * @deprecated Use the size property and compare against 0, for alignment with\n * ES6 Map.\n */\ngoog.structs.Map.prototype.isEmpty = function() {\n 'use strict';\n return this.size == 0;\n};\n\n\n/**\n * Removes all key-value pairs from the map.\n */\ngoog.structs.Map.prototype.clear = function() {\n 'use strict';\n this.map_ = {};\n this.keys_.length = 0;\n this.setSizeInternal_(0);\n this.version_ = 0;\n};\n\n\n\n/**\n * Removes a key-value pair based on the key. This is O(logN) amortized due to\n * updating the keys array whenever the count becomes half the size of the keys\n * in the keys array.\n * @param {*} key The key to remove.\n * @return {boolean} Whether object was removed.\n * @deprecated Use `delete` instead, for alignment with ES6 Map.\n */\ngoog.structs.Map.prototype.remove = function(key) {\n return this.delete(key);\n};\n\n/**\n * Removes a key-value pair based on the key. This is O(logN) amortized due\n * to updating the keys array whenever the count becomes half the size of\n * the keys in the keys array.\n * @param {*} key The key to remove.\n * @return {boolean} Whether object was removed.\n */\ngoog.structs.Map.prototype.delete = function(key) {\n 'use strict';\n if (goog.structs.Map.hasKey_(this.map_, key)) {\n delete this.map_[key];\n this.setSizeInternal_(this.size - 1);\n this.version_++;\n\n // clean up the keys array if the threshold is hit\n if (this.keys_.length > 2 * this.size) {\n this.cleanupKeysArray_();\n }\n\n return true;\n }\n return false;\n};\n\n\n/**\n * Cleans up the temp keys array by removing entries that are no longer in the\n * map.\n * @private\n */\ngoog.structs.Map.prototype.cleanupKeysArray_ = function() {\n 'use strict';\n if (this.size != this.keys_.length) {\n // First remove keys that are no longer in the map.\n var srcIndex = 0;\n var destIndex = 0;\n while (srcIndex < this.keys_.length) {\n var key = this.keys_[srcIndex];\n if (goog.structs.Map.hasKey_(this.map_, key)) {\n this.keys_[destIndex++] = key;\n }\n srcIndex++;\n }\n this.keys_.length = destIndex;\n }\n\n if (this.size != this.keys_.length) {\n // If the count still isn't correct, that means we have duplicates. This can\n // happen when the same key is added and removed multiple times. Now we have\n // to allocate one extra Object to remove the duplicates. This could have\n // been done in the first pass, but in the common case, we can avoid\n // allocating an extra object by only doing this when necessary.\n var seen = {};\n var srcIndex = 0;\n var destIndex = 0;\n while (srcIndex < this.keys_.length) {\n var key = this.keys_[srcIndex];\n if (!(goog.structs.Map.hasKey_(seen, key))) {\n this.keys_[destIndex++] = key;\n seen[key] = 1;\n }\n srcIndex++;\n }\n this.keys_.length = destIndex;\n }\n};\n\n\n/**\n * Returns the value for the given key. If the key is not found and the default\n * value is not given this will return `undefined`.\n * @param {*} key The key to get the value for.\n * @param {DEFAULT=} opt_val The value to return if no item is found for the\n * given key, defaults to undefined.\n * @return {V|DEFAULT} The value for the given key.\n * @template DEFAULT\n */\ngoog.structs.Map.prototype.get = function(key, opt_val) {\n 'use strict';\n if (goog.structs.Map.hasKey_(this.map_, key)) {\n return this.map_[key];\n }\n return opt_val;\n};\n\n\n/**\n * Adds a key-value pair to the map.\n * @param {*} key The key.\n * @param {V} value The value to add.\n */\ngoog.structs.Map.prototype.set = function(key, value) {\n 'use strict';\n if (!(goog.structs.Map.hasKey_(this.map_, key))) {\n this.setSizeInternal_(this.size + 1);\n // TODO(johnlenz): This class lies, it claims to return an array of string\n // keys, but instead returns the original object used.\n this.keys_.push(/** @type {?} */ (key));\n // Only change the version if we add a new key.\n this.version_++;\n }\n this.map_[key] = value;\n};\n\n\n/**\n * Adds multiple key-value pairs from another goog.structs.Map or Object.\n * @param {?Object} map Object containing the data to add.\n * @deprecated Use goog.collections.maps.setAll(thisMap, map.entries()) if map\n * is an ES6 or goog.structs Map, or\n * goog.collections.maps.setAll(thisMap, Object.entries(map)) otherwise.\n */\ngoog.structs.Map.prototype.addAll = function(map) {\n 'use strict';\n if (map instanceof goog.structs.Map) {\n var keys = map.getKeys();\n for (var i = 0; i < keys.length; i++) {\n this.set(keys[i], map.get(keys[i]));\n }\n } else {\n for (var key in map) {\n this.set(key, map[key]);\n }\n }\n};\n\n\n/**\n * Calls the given function on each entry in the map.\n * @param {function(this:T, V, K, goog.structs.Map<K,V>)} f\n * @param {T=} opt_obj The value of \"this\" inside f.\n * @template T\n * @deprecated Use ES6 Iteration instead.\n */\ngoog.structs.Map.prototype.forEach = function(f, opt_obj) {\n 'use strict';\n var keys = this.getKeys();\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = this.get(key);\n f.call(opt_obj, value, key, this);\n }\n};\n\n\n/**\n * Clones a map and returns a new map.\n * @return {!goog.structs.Map} A new map with the same key-value pairs.\n * @deprecated Use `new Map(thisMap.entries())` instead, for alignment with\n * ES6 Map.\n */\ngoog.structs.Map.prototype.clone = function() {\n 'use strict';\n return new goog.structs.Map(this);\n};\n\n\n/**\n * Returns a new map in which all the keys and values are interchanged\n * (keys become values and values become keys). If multiple keys map to the\n * same value, the chosen transposed value is implementation-dependent.\n *\n * It acts very similarly to {goog.object.transpose(Object)}.\n *\n * @return {!goog.structs.Map} The transposed map.\n * @deprecated Use goog.collections.maps.transpose instead, for alignment with\n * ES6 Maps.\n */\ngoog.structs.Map.prototype.transpose = function() {\n 'use strict';\n var transposed = new goog.structs.Map();\n for (var i = 0; i < this.keys_.length; i++) {\n var key = this.keys_[i];\n var value = this.map_[key];\n transposed.set(value, key);\n }\n\n return transposed;\n};\n\n\n/**\n * @return {!Object} Object representation of the map.\n * @deprecated Use goog.collections.maps.toObject(thisMap) instead, for aligment\n * with ES6 Maps.\n */\ngoog.structs.Map.prototype.toObject = function() {\n 'use strict';\n this.cleanupKeysArray_();\n var obj = {};\n for (var i = 0; i < this.keys_.length; i++) {\n var key = this.keys_[i];\n obj[key] = this.map_[key];\n }\n return obj;\n};\n\n\n/**\n * Returns an iterator that iterates over the keys in the map. Removal of keys\n * while iterating might have undesired side effects.\n * @return {!goog.iter.Iterator} An iterator over the keys in the map.\n * @deprecated Use `keys()` with native iteration protocols, for alignment\n * with ES6 Map.\n */\ngoog.structs.Map.prototype.getKeyIterator = function() {\n 'use strict';\n return this.__iterator__(true);\n};\n\n/**\n * @return {!IteratorIterable<K>} An ES6 Iterator that iterates over the maps\n * keys.\n */\ngoog.structs.Map.prototype.keys = function() {\n 'use strict';\n return goog.iter.es6.ShimIterable.of(this.getKeyIterator()).toEs6();\n};\n\n\n/**\n * Returns an iterator that iterates over the values in the map. Removal of\n * keys while iterating might have undesired side effects.\n * @return {!goog.iter.Iterator} An iterator over the values in the map.\n * @deprecated Use `values()` with native iteration protocols, for alignment\n * with ES6 Map.\n */\ngoog.structs.Map.prototype.getValueIterator = function() {\n 'use strict';\n return this.__iterator__(false);\n};\n\n/**\n * @return {!IteratorIterable<V>} An ES6 Iterator that iterates over the maps\n * values.\n */\ngoog.structs.Map.prototype.values = function() {\n 'use strict';\n return goog.iter.es6.ShimIterable.of(this.getValueIterator()).toEs6();\n};\n\n/**\n * @return {!IteratorIterable<!Array<K|V>>} An iterator of entries in this map.\n * The type is actually Array<[K,V]> but this is not representable in the\n * Closure Type System.\n */\ngoog.structs.Map.prototype.entries = function() {\n const self = this;\n return goog.collections.iters.map(this.keys(), function(key) {\n return [key, self.get(key)];\n });\n};\n\n/**\n * Returns an iterator that iterates over the values or the keys in the map.\n * This throws an exception if the map was mutated since the iterator was\n * created.\n * @param {boolean=} opt_keys True to iterate over the keys. False to iterate\n * over the values. The default value is false.\n * @return {!goog.iter.Iterator} An iterator over the values or keys in the map.\n * @deprecated Call either `keys` or `values` and use native iteration, for\n * alignment with ES6 Map.\n */\ngoog.structs.Map.prototype.__iterator__ = function(opt_keys) {\n 'use strict';\n // Clean up keys to minimize the risk of iterating over dead keys.\n this.cleanupKeysArray_();\n\n var i = 0;\n var version = this.version_;\n var selfObj = this;\n\n var newIter = new goog.iter.Iterator;\n /**\n * @return {!IIterableResult<K|V>}\n * @override\n */\n newIter.next = function() {\n 'use strict';\n if (version != selfObj.version_) {\n throw new Error('The map has changed since the iterator was created');\n }\n if (i >= selfObj.keys_.length) {\n return goog.iter.ES6_ITERATOR_DONE;\n }\n var key = selfObj.keys_[i++];\n return goog.iter.createEs6IteratorYield(opt_keys ? key : selfObj.map_[key]);\n };\n\n return newIter;\n};\n\n\n/**\n * Assigns to the size property to isolate supressions of const assignment to\n * only where they are needed.\n * @param {number} newSize The size to update to.\n * @private\n */\ngoog.structs.Map.prototype.setSizeInternal_ = function(newSize) {\n /** @suppress {const} */\n this.size = newSize;\n};\n\n\n/**\n * Safe way to test for hasOwnProperty. It even allows testing for\n * 'hasOwnProperty'.\n * @param {!Object} obj The object to test for presence of the given key.\n * @param {*} key The key to check for.\n * @return {boolean} Whether the object has the key.\n * @private\n */\ngoog.structs.Map.hasKey_ = function(obj, key) {\n 'use strict';\n return Object.prototype.hasOwnProperty.call(obj, key);\n};\n","~:compiled-at",1684858198031,"~:source-map-json","{\n\"version\":3,\n\"file\":\"goog.structs.map.js\",\n\"lineCount\":222,\n\"mappings\":\"AAkBAA,IAAKC,CAAAA,OAAL,CAAa,kBAAb,CAAA;AAEAD,IAAKE,CAAAA,OAAL,CAAa,wBAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,WAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,oBAAb,CAAA;AACAF,IAAKE,CAAAA,OAAL,CAAa,eAAb,CAAA;AAcAF,IAAKG,CAAAA,OAAQC,CAAAA,GAAb,GAAmBC,QAAQ,CAACC,OAAD,EAAUC,QAAV,CAAoB;AAM7C,MAAKC,C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ACC,OAAD,CAAU;AAE9D,MAAKrG,CAAAA,IAAL,GAAYqG,OAAZ;AAF8D,CAAhE;AAcA/G,IAAKG,CAAAA,OAAQC,CAAAA,GAAI+B,CAAAA,OAAjB,GAA2B6E,QAAQ,CAAC/B,GAAD,EAAMvD,GAAN,CAAW;AAE5C,SAAOuF,MAAO9F,CAAAA,SAAU+F,CAAAA,cAAezC,CAAAA,IAAhC,CAAqCQ,GAArC,EAA0CvD,GAA1C,CAAP;AAF4C,CAA9C;;\",\n\"sources\":[\"goog/structs/map.js\"],\n\"sourcesContent\":[\"/**\\n * @license\\n * Copyright The Closure Library Authors.\\n * SPDX-License-Identifier: Apache-2.0\\n */\\n\\n/**\\n * @fileoverview Datastructure: Hash Map.\\n *\\n *\\n * This file contains an implementation of a Map structure. It implements a lot\\n * of the methods used in goog.structs so those functions work on hashes. This\\n * is best suited for complex key types. For simple keys such as numbers and\\n * strings consider using the lighter-weight utilities in goog.object.\\n * @deprecated goog.structs.Map is deprecated in favour of ES6 Maps.\\n */\\n\\n\\ngoog.provide('goog.structs.Map');\\n\\ngoog.require('goog.collections.iters');\\ngoog.require('goog.iter');\\ngoog.require('goog.iter.Iterator');\\ngoog.require('goog.iter.es6');\\n\\n\\n\\n/**\\n * Class for Hash Map datastructure.\\n * @param {*=} opt_map Map or Object to initialize the map with.\\n * @param {...*} var_args If 2 or more arguments are present then they\\n * will be used as key-value pairs.\\n * @constructor\\n * @final\\n * @template K, V\\n * @deprecated This type is misleading: use ES6 Map instead.\\n */\\ngoog.structs.Map = function(opt_map, var_args) {\\n 'use strict';\\n /**\\n * Underlying JS object used to implement the map.\\n * @private {!Object}\\n */\\n this.map_ = {};\\n\\n /**\\n * An array of keys. This is necessary for two reasons:\\n * 1. Iterating the keys using for (var key in this.map_) allocates an\\n * object for every key in IE which is really bad for IE6 GC perf.\\n * 2. Without a side data structure, we would need to escape all the keys\\n * as that would be the only way we could tell during iteration if the\\n * key was an internal key or a property of the object.\\n *\\n * This array can contain deleted keys so it's necessary to check the map\\n * as well to see if the key is still in the map (this doesn't require a\\n * memory allocation in IE).\\n * @private {!Array<string>}\\n */\\n this.keys_ = [];\\n\\n /**\\n * The number of key value pairs in the map.\\n * @const {number}\\n */\\n this.size = 0;\\n\\n /**\\n * Version used to detect changes while iterating.\\n * @private {number}\\n */\\n this.version_ = 0;\\n\\n var argLength = arguments.length;\\n\\n if (argLength > 1) {\\n if (argLength % 2) {\\n throw new Error('Uneven number of arguments');\\n }\\n for (var i = 0; i < argLength; i += 2) {\\n this.set(arguments[i], arguments[i + 1]);\\n }\\n } else if (opt_map) {\\n this.addAll(/** @type {!Object} */ (opt_map));\\n }\\n};\\n\\n\\n/**\\n * @return {number} The number of key-value pairs in the map.\\n * @deprecated Use the `size` property instead, for alignment with ES6 Map.\\n */\\ngoog.structs.Map.prototype.getCount = function() {\\n 'use strict';\\n return this.size;\\n};\\n\\n\\n/**\\n * Returns the values of the map.\\n * @return {!Array<V>} The values in the map.\\n * @deprecated Use `Array.from(map.values())` instead, for alignment with ES6\\n * Map.\\n */\\ngoog.structs.Map.prototype.getValues = function() {\\n 'use strict';\\n this.cleanupKeysArray_();\\n\\n var rv = [];\\n for (var i = 0; i < this.keys_.length; i++) {\\n var key = this.keys_[i];\\n rv.push(this.map_[key]);\\n }\\n return rv;\\n};\\n\\n\\n/**\\n * Returns the keys of the map.\\n * @return {!Array<string>} Array of string values.\\n * @deprecated Use `Array.from(map.keys())` instead, for alignment with ES6 Map.\\n */\\ngoog.structs.Map.prototype.getKeys = function() {\\n 'use strict';\\n this.cleanupKeysArray_();\\n return /** @type {!Array<string>} */ (this.keys_.concat());\\n};\\n\\n\\n/**\\n * Whether the map contains the given key.\\n * @param {*} key The key to check for.\\n * @return {boolean} Whether the map contains the key.\\n * @deprecated Use `has` instead, for alignment with ES6 Map.\\n */\\ngoog.structs.Map.prototype.containsKey = function(key) {\\n 'use strict';\\n return this.has(key);\\n};\\n\\n/**\\n * Whether the map contains the given key.\\n * @param {*} key The key to check for.\\n * @return {boolean} Whether the map contains the key.\\n */\\ngoog.structs.Map.prototype.has = function(key) {\\n 'use strict';\\n return goog.structs.Map.hasKey_(this.map_, key);\\n};\\n\\n\\n/**\\n * Whether the map contains the given value. This is O(n).\\n * @param {V} val The value to check for.\\n * @return {boolean} Whether the map contains the value.\\n */\\ngoog.structs.Map.prototype.containsValue = function(val) {\\n 'use strict';\\n for (var i = 0; i < this.keys_.length; i++) {\\n var key = this.keys_[i];\\n if (goog.structs.Map.hasKey_(this.map_, key) && this.map_[key] == val) {\\n return true;\\n }\\n }\\n return false;\\n};\\n\\n\\n/**\\n * Whether this map is equal to the argument map.\\n * @param {goog.structs.Map} otherMap The map against which to test equality.\\n * @param {function(V, V): boolean=} opt_equalityFn Optional equality function\\n * to test equality of values. If not specified, this will test whether\\n * the values contained in each map are identical objects.\\n * @return {boolean} Whether the maps are equal.\\n * @deprecated Use goog.collections.maps.equals(thisMap, otherMap,\\n * opt_equalityFn) instead, for alignment with ES6 Map.\\n */\\ngoog.structs.Map.prototype.equals = function(otherMap, opt_equalityFn) {\\n 'use strict';\\n if (this === otherMap) {\\n return true;\\n }\\n\\n if (this.size != otherMap.getCount()) {\\n return false;\\n }\\n\\n var equalityFn = opt_equalityFn || goog.structs.Map.defaultEquals;\\n\\n this.cleanupKeysArray_();\\n for (var key, i = 0; key = this.keys_[i]; i++) {\\n if (!equalityFn(this.get(key), otherMap.get(key))) {\\n return false;\\n }\\n }\\n\\n return true;\\n};\\n\\n\\n/**\\n * Default equality test for values.\\n * @param {*} a The first value.\\n * @param {*} b The second value.\\n * @return {boolean} Whether a and b reference the same object.\\n */\\ngoog.structs.Map.defaultEquals = function(a, b) {\\n 'use strict';\\n return a === b;\\n};\\n\\n\\n/**\\n * @return {boolean} Whether the map is empty.\\n * @deprecated Use the size property and compare against 0, for alignment with\\n * ES6 Map.\\n */\\ngoog.structs.Map.prototype.isEmpty = function() {\\n 'use strict';\\n return this.size == 0;\\n};\\n\\n\\n/**\\n * Removes all key-value pairs from the map.\\n */\\ngoog.structs.Map.prototype.clear = function() {\\n 'use strict';\\n this.map_ = {};\\n this.keys_.length = 0;\\n this.setSizeInternal_(0);\\n this.version_ = 0;\\n};\\n\\n\\n\\n/**\\n * Removes a key-value pair based on the key. This is O(logN) amortized due to\\n * updating the keys array whenever the count becomes half the size of the keys\\n * in the keys array.\\n * @param {*} key The key to remove.\\n * @return {boolean} Whether object was removed.\\n * @deprecated Use `delete` instead, for alignment with ES6 Map.\\n */\\ngoog.structs.Map.prototype.remove = function(key) {\\n return this.delete(key);\\n};\\n\\n/**\\n * Removes a key-value pair based on the key. This is O(logN) amortized due\\n * to updating the keys array whenever the count becomes half the size of\\n * the keys in the keys array.\\n * @param {*} key The key to remove.\\n * @return {boolean} Whether object was removed.\\n */\\ngoog.structs.Map.prototype.delete = function(key) {\\n 'use strict';\\n if (goog.structs.Map.hasKey_(this.map_, key)) {\\n delete this.map_[key];\\n this.setSizeInternal_(this.size - 1);\\n this.version_++;\\n\\n // clean up the keys array if the threshold is hit\\n if (this.keys_.length > 2 * this.size) {\\n this.cleanupKeysArray_();\\n }\\n\\n return true;\\n }\\n return false;\\n};\\n\\n\\n/**\\n * Cleans up the temp keys array by removing entries that are no longer in the\\n * map.\\n * @private\\n */\\ngoog.structs.Map.prototype.cleanupKeysArray_ = function() {\\n 'use strict';\\n if (this.size != this.keys_.length) {\\n // First remove keys that are no longer in the map.\\n var srcIndex = 0;\\n var destIndex = 0;\\n while (srcIndex < this.keys_.length) {\\n var key = this.keys_[srcIndex];\\n if (goog.structs.Map.hasKey_(this.map_, key)) {\\n this.keys_[destIndex++] = key;\\n }\\n srcIndex++;\\n }\\n this.keys_.length = destIndex;\\n }\\n\\n if (this.size != this.keys_.length) {\\n // If the count still isn't correct, that means we have duplicates. This can\\n // happen when the same key is added and removed multiple times. Now we have\\n // to allocate one extra Object to remove the duplicates. This could have\\n // been done in the first pass, but in the common case, we can avoid\\n // allocating an extra object by only doing this when necessary.\\n var seen = {};\\n var srcIndex = 0;\\n var destIndex = 0;\\n while (srcIndex < this.keys_.length) {\\n var key = this.keys_[srcIndex];\\n if (!(goog.structs.Map.hasKey_(seen, key))) {\\n this.keys_[destIndex++] = key;\\n seen[key] = 1;\\n }\\n srcIndex++;\\n }\\n this.keys_.length = destIndex;\\n }\\n};\\n\\n\\n/**\\n * Returns the value for the given key. If the key is not found and the default\\n * value is not given this will return `undefined`.\\n * @param {*} key The key to get the value for.\\n * @param {DEFAULT=} opt_val The value to return if no item is found for the\\n * given key, defaults to undefined.\\n * @return {V|DEFAULT} The value for the given key.\\n * @template DEFAULT\\n */\\ngoog.structs.Map.prototype.get = function(key, opt_val) {\\n 'use strict';\\n if (goog.structs.Map.hasKey_(this.map_, key)) {\\n return this.map_[key];\\n }\\n return opt_val;\\n};\\n\\n\\n/**\\n * Adds a key-value pair to the map.\\n * @param {*} key The key.\\n * @param {V} value The value to add.\\n */\\ngoog.structs.Map.prototype.set = function(key, value) {\\n 'use strict';\\n if (!(goog.structs.Map.hasKey_(this.map_, key))) {\\n this.setSizeInternal_(this.size + 1);\\n // TODO(johnlenz): This class lies, it claims to return an array of string\\n // keys, but instead returns the original object used.\\n this.keys_.push(/** @type {?} */ (key));\\n // Only change the version if we add a new key.\\n this.version_++;\\n }\\n this.map_[key] = value;\\n};\\n\\n\\n/**\\n * Adds multiple key-value pairs from another goog.structs.Map or Object.\\n * @param {?Object} map Object containing the data to add.\\n * @deprecated Use goog.collections.maps.setAll(thisMap, map.entries()) if map\\n * is an ES6 or goog.structs Map, or\\n * goog.collections.maps.setAll(thisMap, Object.entries(map)) otherwise.\\n */\\ngoog.structs.Map.prototype.addAll = function(map) {\\n 'use strict';\\n if (map instanceof goog.structs.Map) {\\n var keys = map.getKeys();\\n for (var i = 0; i < keys.length; i++) {\\n this.set(keys[i], map.get(keys[i]));\\n }\\n } else {\\n for (var key in map) {\\n this.set(key, map[key]);\\n }\\n }\\n};\\n\\n\\n/**\\n * Calls the given function on each entry in the map.\\n * @param {function(this:T, V, K, goog.structs.Map<K,V>)} f\\n * @param {T=} opt_obj The value of \\\"this\\\" inside f.\\n * @template T\\n * @deprecated Use ES6 Iteration instead.\\n */\\ngoog.structs.Map.prototype.forEach = function(f, opt_obj) {\\n 'use strict';\\n var keys = this.getKeys();\\n for (var i = 0; i < keys.length; i++) {\\n var key = keys[i];\\n var value = this.get(key);\\n f.call(opt_obj, value, key, this);\\n }\\n};\\n\\n\\n/**\\n * Clones a map and returns a new map.\\n * @return {!goog.structs.Map} A new map with the same key-value pairs.\\n * @deprecated Use `new Map(thisMap.entries())` instead, for alignment with\\n * ES6 Map.\\n */\\ngoog.structs.Map.prototype.clone = function() {\\n 'use strict';\\n return new goog.structs.Map(this);\\n};\\n\\n\\n/**\\n * Returns a new map in which all the keys and values are interchanged\\n * (keys become values and values become keys). If multiple keys map to the\\n * same value, the chosen transposed value is implementation-dependent.\\n *\\n * It acts very similarly to {goog.object.transpose(Object)}.\\n *\\n * @return {!goog.structs.Map} The transposed map.\\n * @deprecated Use goog.collections.maps.transpose instead, for alignment with\\n * ES6 Maps.\\n */\\ngoog.structs.Map.prototype.transpose = function() {\\n 'use strict';\\n var transposed = new goog.structs.Map();\\n for (var i = 0; i < this.keys_.length; i++) {\\n var key = this.keys_[i];\\n var value = this.map_[key];\\n transposed.set(value, key);\\n }\\n\\n return transposed;\\n};\\n\\n\\n/**\\n * @return {!Object} Object representation of the map.\\n * @deprecated Use goog.collections.maps.toObject(thisMap) instead, for aligment\\n * with ES6 Maps.\\n */\\ngoog.structs.Map.prototype.toObject = function() {\\n 'use strict';\\n this.cleanupKeysArray_();\\n var obj = {};\\n for (var i = 0; i < this.keys_.length; i++) {\\n var key = this.keys_[i];\\n obj[key] = this.map_[key];\\n }\\n return obj;\\n};\\n\\n\\n/**\\n * Returns an iterator that iterates over the keys in the map. Removal of keys\\n * while iterating might have undesired side effects.\\n * @return {!goog.iter.Iterator} An iterator over the keys in the map.\\n * @deprecated Use `keys()` with native iteration protocols, for alignment\\n * with ES6 Map.\\n */\\ngoog.structs.Map.prototype.getKeyIterator = function() {\\n 'use strict';\\n return this.__iterator__(true);\\n};\\n\\n/**\\n * @return {!IteratorIterable<K>} An ES6 Iterator that iterates over the maps\\n * keys.\\n */\\ngoog.structs.Map.prototype.keys = function() {\\n 'use strict';\\n return goog.iter.es6.ShimIterable.of(this.getKeyIterator()).toEs6();\\n};\\n\\n\\n/**\\n * Returns an iterator that iterates over the values in the map. Removal of\\n * keys while iterating might have undesired side effects.\\n * @return {!goog.iter.Iterator} An iterator over the values in the map.\\n * @deprecated Use `values()` with native iteration protocols, for alignment\\n * with ES6 Map.\\n */\\ngoog.structs.Map.prototype.getValueIterator = function() {\\n 'use strict';\\n return this.__iterator__(false);\\n};\\n\\n/**\\n * @return {!IteratorIterable<V>} An ES6 Iterator that iterates over the maps\\n * values.\\n */\\ngoog.structs.Map.prototype.values = function() {\\n 'use strict';\\n return goog.iter.es6.ShimIterable.of(this.getValueIterator()).toEs6();\\n};\\n\\n/**\\n * @return {!IteratorIterable<!Array<K|V>>} An iterator of entries in this map.\\n * The type is actually Array<[K,V]> but this is not representable in the\\n * Closure Type System.\\n */\\ngoog.structs.Map.prototype.entries = function() {\\n const self = this;\\n return goog.collections.iters.map(this.keys(), function(key) {\\n return [key, self.get(key)];\\n });\\n};\\n\\n/**\\n * Returns an iterator that iterates over the values or the keys in the map.\\n * This throws an exception if the map was mutated since the iterator was\\n * created.\\n * @param {boolean=} opt_keys True to iterate over the keys. False to iterate\\n * over the values. The default value is false.\\n * @return {!goog.iter.Iterator} An iterator over the values or keys in the map.\\n * @deprecated Call either `keys` or `values` and use native iteration, for\\n * alignment with ES6 Map.\\n */\\ngoog.structs.Map.prototype.__iterator__ = function(opt_keys) {\\n 'use strict';\\n // Clean up keys to minimize the risk of iterating over dead keys.\\n this.cleanupKeysArray_();\\n\\n var i = 0;\\n var version = this.version_;\\n var selfObj = this;\\n\\n var newIter = new goog.iter.Iterator;\\n /**\\n * @return {!IIterableResult<K|V>}\\n * @override\\n */\\n newIter.next = function() {\\n 'use strict';\\n if (version != selfObj.version_) {\\n throw new Error('The map has changed since the iterator was created');\\n }\\n if (i >= selfObj.keys_.length) {\\n return goog.iter.ES6_ITERATOR_DONE;\\n }\\n var key = selfObj.keys_[i++];\\n return goog.iter.createEs6IteratorYield(opt_keys ? key : selfObj.map_[key]);\\n };\\n\\n return newIter;\\n};\\n\\n\\n/**\\n * Assigns to the size property to isolate supressions of const assignment to\\n * only where they are needed.\\n * @param {number} newSize The size to update to.\\n * @private\\n */\\ngoog.structs.Map.prototype.setSizeInternal_ = function(newSize) {\\n /** @suppress {const} */\\n this.size = newSize;\\n};\\n\\n\\n/**\\n * Safe way to test for hasOwnProperty. It even allows testing for\\n * 'hasOwnProperty'.\\n * @param {!Object} obj The object to test for presence of the given key.\\n * @param {*} key The key to check for.\\n * @return {boolean} Whether the object has the key.\\n * @private\\n */\\ngoog.structs.Map.hasKey_ = function(obj, key) {\\n 'use strict';\\n return Object.prototype.hasOwnProperty.call(obj, key);\\n};\\n\"],\n\"names\":[\"goog\",\"provide\",\"require\",\"structs\",\"Map\",\"goog.structs.Map\",\"opt_map\",\"var_args\",\"map_\",\"keys_\",\"size\",\"version_\",\"argLength\",\"arguments\",\"length\",\"Error\",\"i\",\"set\",\"addAll\",\"prototype\",\"getCount\",\"goog.structs.Map.prototype.getCount\",\"getValues\",\"goog.structs.Map.prototype.getValues\",\"cleanupKeysArray_\",\"rv\",\"key\",\"push\",\"getKeys\",\"goog.structs.Map.prototype.getKeys\",\"concat\",\"containsKey\",\"goog.structs.Map.prototype.containsKey\",\"has\",\"goog.structs.Map.prototype.has\",\"hasKey_\",\"containsValue\",\"goog.structs.Map.prototype.containsValue\",\"val\",\"equals\",\"goog.structs.Map.prototype.equals\",\"otherMap\",\"opt_equalityFn\",\"equalityFn\",\"defaultEquals\",\"get\",\"goog.structs.Map.defaultEquals\",\"a\",\"b\",\"isEmpty\",\"goog.structs.Map.prototype.isEmpty\",\"clear\",\"goog.structs.Map.prototype.clear\",\"setSizeInternal_\",\"remove\",\"goog.structs.Map.prototype.remove\",\"delete\",\"goog.structs.Map.prototype.delete\",\"goog.structs.Map.prototype.cleanupKeysArray_\",\"srcIndex\",\"destIndex\",\"seen\",\"goog.structs.Map.prototype.get\",\"opt_val\",\"goog.structs.Map.prototype.set\",\"value\",\"goog.structs.Map.prototype.addAll\",\"map\",\"keys\",\"forEach\",\"goog.structs.Map.prototype.forEach\",\"f\",\"opt_obj\",\"call\",\"clone\",\"goog.structs.Map.prototype.clone\",\"transpose\",\"goog.structs.Map.prototype.transpose\",\"transposed\",\"toObject\",\"goog.structs.Map.prototype.toObject\",\"obj\",\"getKeyIterator\",\"goog.structs.Map.prototype.getKeyIterator\",\"__iterator__\",\"goog.structs.Map.prototype.keys\",\"iter\",\"es6\",\"ShimIterable\",\"of\",\"toEs6\",\"getValueIterator\",\"goog.structs.Map.prototype.getValueIterator\",\"values\",\"goog.structs.Map.prototype.values\",\"entries\",\"goog.structs.Map.prototype.entries\",\"self\",\"collections\",\"iters\",\"goog.structs.Map.prototype.__iterator__\",\"opt_keys\",\"version\",\"selfObj\",\"newIter\",\"Iterator\",\"next\",\"newIter.next\",\"ES6_ITERATOR_DONE\",\"createEs6IteratorYield\",\"goog.structs.Map.prototype.setSizeInternal_\",\"newSize\",\"goog.structs.Map.hasKey_\",\"Object\",\"hasOwnProperty\"]\n}\n"] |