` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `
` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: _propTypes.default.any,\n\n /**\n * A set of `
` components, that are toggled `in` and out as they\n * leave. the `` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `` as\n * with our `` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: _propTypes.default.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: _propTypes.default.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: _propTypes.default.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: _propTypes.default.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: _propTypes.default.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\n\nvar _default = (0, _reactLifecyclesCompat.polyfill)(TransitionGroup);\n\nexports.default = _default;\nmodule.exports = exports[\"default\"];","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || from);\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || from);\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","/**\n * Cannot do Math.log(x) / Math.log(10) bc if IEEE floating point issue\n * @param x number\n */\nexport function getMagnitude(x) {\n // Cannot count string length via Number.toString because it may use scientific notation\n // for very small or very large numbers.\n return Math.floor(Math.log(x) * Math.LOG10E);\n}\nexport function repeat(s, times) {\n if (typeof s.repeat === 'function') {\n return s.repeat(times);\n }\n var arr = new Array(times);\n for (var i = 0; i < arr.length; i++) {\n arr[i] = s;\n }\n return arr.join('');\n}\nexport function setInternalSlot(map, pl, field, value) {\n if (!map.get(pl)) {\n map.set(pl, Object.create(null));\n }\n var slots = map.get(pl);\n slots[field] = value;\n}\nexport function setMultiInternalSlots(map, pl, props) {\n for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {\n var k = _a[_i];\n setInternalSlot(map, pl, k, props[k]);\n }\n}\nexport function getInternalSlot(map, pl, field) {\n return getMultiInternalSlots(map, pl, field)[field];\n}\nexport function getMultiInternalSlots(map, pl) {\n var fields = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n fields[_i - 2] = arguments[_i];\n }\n var slots = map.get(pl);\n if (!slots) {\n throw new TypeError(pl + \" InternalSlot has not been initialized\");\n }\n return fields.reduce(function (all, f) {\n all[f] = slots[f];\n return all;\n }, Object.create(null));\n}\nexport function isLiteralPart(patternPart) {\n return patternPart.type === 'literal';\n}\n/*\n 17 ECMAScript Standard Built-in Objects:\n Every built-in Function object, including constructors, that is not\n identified as an anonymous function has a name property whose value\n is a String.\n\n Unless otherwise specified, the name property of a built-in Function\n object, if it exists, has the attributes { [[Writable]]: false,\n [[Enumerable]]: false, [[Configurable]]: true }.\n*/\nexport function defineProperty(target, name, _a) {\n var value = _a.value;\n Object.defineProperty(target, name, {\n configurable: true,\n enumerable: false,\n writable: true,\n value: value,\n });\n}\nexport var UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;\nexport function invariant(condition, message, Err) {\n if (Err === void 0) { Err = Error; }\n if (!condition) {\n throw new Err(message);\n }\n}\n","export var DATE_TIME_PROPS = [\n 'weekday',\n 'era',\n 'year',\n 'month',\n 'day',\n 'hour',\n 'minute',\n 'second',\n 'timeZoneName',\n];\nexport var removalPenalty = 120;\nexport var additionPenalty = 20;\nexport var differentNumericTypePenalty = 15;\nexport var longLessPenalty = 8;\nexport var longMorePenalty = 6;\nexport var shortLessPenalty = 6;\nexport var shortMorePenalty = 3;\n","import { __assign } from \"tslib\";\n/**\n * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js\n * with some tweaks\n */\nvar DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;\n// trim patterns after transformations\nvar expPatternTrimmer = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g;\nfunction matchSkeletonPattern(match, result) {\n var len = match.length;\n switch (match[0]) {\n // Era\n case 'G':\n result.era = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n return '{era}';\n // Year\n case 'y':\n case 'Y':\n case 'u':\n case 'U':\n case 'r':\n result.year = len === 2 ? '2-digit' : 'numeric';\n return '{year}';\n // Quarter\n case 'q':\n case 'Q':\n throw new RangeError('`w/Q` (quarter) patterns are not supported');\n // Month\n case 'M':\n case 'L':\n result.month = ['numeric', '2-digit', 'short', 'long', 'narrow'][len - 1];\n return '{month}';\n // Week\n case 'w':\n case 'W':\n throw new RangeError('`w/W` (week of year) patterns are not supported');\n case 'd':\n result.day = ['numeric', '2-digit'][len - 1];\n return '{day}';\n case 'D':\n case 'F':\n case 'g':\n result.day = 'numeric';\n return '{day}';\n // Weekday\n case 'E':\n result.weekday = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n return '{weekday}';\n case 'e':\n result.weekday = [\n 'numeric',\n '2-digit',\n 'short',\n 'long',\n 'narrow',\n 'short',\n ][len - 1];\n return '{weekday}';\n case 'c':\n result.weekday = [\n 'numeric',\n undefined,\n 'short',\n 'long',\n 'narrow',\n 'short',\n ][len - 1];\n return '{weekday}';\n // Period\n case 'a': // AM, PM\n case 'b': // am, pm, noon, midnight\n case 'B': // flexible day periods\n result.hour12 = true;\n return '{ampm}';\n // Hour\n case 'h':\n result.hour = ['numeric', '2-digit'][len - 1];\n result.hour12 = true;\n return '{hour}';\n case 'H':\n result.hour = ['numeric', '2-digit'][len - 1];\n return '{hour}';\n case 'K':\n result.hour = ['numeric', '2-digit'][len - 1];\n result.hour12 = true;\n return '{hour}';\n case 'k':\n result.hour = ['numeric', '2-digit'][len - 1];\n return '{hour}';\n case 'j':\n case 'J':\n case 'C':\n throw new RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead');\n // Minute\n case 'm':\n result.minute = ['numeric', '2-digit'][len - 1];\n return '{minute}';\n // Second\n case 's':\n result.second = ['numeric', '2-digit'][len - 1];\n return '{second}';\n case 'S':\n case 'A':\n result.second = 'numeric';\n return '{second}';\n // Zone\n case 'z': // 1..3, 4: specific non-location format\n case 'Z': // 1..3, 4, 5: The ISO8601 varios formats\n case 'O': // 1, 4: miliseconds in day short, long\n case 'v': // 1, 4: generic non-location format\n case 'V': // 1, 2, 3, 4: time zone ID or city\n case 'X': // 1, 2, 3, 4: The ISO8601 varios formats\n case 'x': // 1, 2, 3, 4: The ISO8601 varios formats\n result.timeZoneName = len < 4 ? 'short' : 'long';\n return '{timeZoneName}';\n }\n return '';\n}\nfunction skeletonTokenToTable2(c) {\n switch (c) {\n // Era\n case 'G':\n return 'era';\n // Year\n case 'y':\n case 'Y':\n case 'u':\n case 'U':\n case 'r':\n return 'year';\n // Month\n case 'M':\n case 'L':\n return 'month';\n // Day\n case 'd':\n case 'D':\n case 'F':\n case 'g':\n return 'day';\n // Period\n case 'a': // AM, PM\n case 'b': // am, pm, noon, midnight\n case 'B': // flexible day periods\n return 'ampm';\n // Hour\n case 'h':\n case 'H':\n case 'K':\n case 'k':\n return 'hour';\n // Minute\n case 'm':\n return 'minute';\n // Second\n case 's':\n case 'S':\n case 'A':\n return 'second';\n default:\n throw new RangeError('Invalid range pattern token');\n }\n}\nexport function processDateTimePattern(pattern, result) {\n var literals = [];\n // Use skeleton to populate result, but use mapped pattern to populate pattern\n var pattern12 = pattern\n // Double apostrophe\n .replace(/'{2}/g, '{apostrophe}')\n // Apostrophe-escaped\n .replace(/'(.*?)'/g, function (_, literal) {\n literals.push(literal);\n return \"$$\" + (literals.length - 1) + \"$$\";\n })\n .replace(DATE_TIME_REGEX, function (m) { return matchSkeletonPattern(m, result || {}); });\n //Restore literals\n if (literals.length) {\n pattern12 = pattern12\n .replace(/\\$\\$(\\d+)\\$\\$/g, function (_, i) {\n return literals[+i];\n })\n .replace(/\\{apostrophe\\}/g, \"'\");\n }\n // Handle apostrophe-escaped things\n return [\n pattern12\n .replace(/([\\s\\uFEFF\\xA0])\\{ampm\\}([\\s\\uFEFF\\xA0])/, '$1')\n .replace('{ampm}', '')\n .replace(expPatternTrimmer, ''),\n pattern12,\n ];\n}\n/**\n * Parse Date time skeleton into Intl.DateTimeFormatOptions\n * Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * @public\n * @param skeleton skeleton string\n */\nexport function parseDateTimeSkeleton(skeleton, rawPattern, rangePatterns, intervalFormatFallback) {\n if (rawPattern === void 0) { rawPattern = skeleton; }\n var result = {\n pattern: '',\n pattern12: '',\n skeleton: skeleton,\n rawPattern: rawPattern,\n rangePatterns: {},\n rangePatterns12: {},\n };\n if (rangePatterns) {\n for (var k in rangePatterns) {\n var key = skeletonTokenToTable2(k);\n var rawPattern_1 = rangePatterns[k];\n var intervalResult = {\n patternParts: [],\n };\n var _a = processDateTimePattern(rawPattern_1, intervalResult), pattern_1 = _a[0], pattern12_1 = _a[1];\n result.rangePatterns[key] = __assign(__assign({}, intervalResult), { patternParts: splitRangePattern(pattern_1) });\n result.rangePatterns12[key] = __assign(__assign({}, intervalResult), { patternParts: splitRangePattern(pattern12_1) });\n }\n }\n else if (intervalFormatFallback) {\n var patternParts = splitFallbackRangePattern(intervalFormatFallback);\n result.rangePatterns.default = {\n patternParts: patternParts,\n };\n result.rangePatterns12.default = {\n patternParts: patternParts,\n };\n }\n // Process skeleton\n skeleton.replace(DATE_TIME_REGEX, function (m) { return matchSkeletonPattern(m, result); });\n var _b = processDateTimePattern(rawPattern), pattern = _b[0], pattern12 = _b[1];\n result.pattern = pattern;\n result.pattern12 = pattern12;\n return result;\n}\nexport function splitFallbackRangePattern(pattern) {\n var parts = pattern.split(/(\\{[0|1]\\})/g).filter(Boolean);\n return parts.map(function (pattern) {\n switch (pattern) {\n case '{0}':\n return {\n source: \"startRange\" /* startRange */,\n pattern: pattern,\n };\n case '{1}':\n return {\n source: \"endRange\" /* endRange */,\n pattern: pattern,\n };\n default:\n return {\n source: \"shared\" /* shared */,\n pattern: pattern,\n };\n }\n });\n}\nexport function splitRangePattern(pattern) {\n var PART_REGEX = /\\{(.*?)\\}/g;\n // Map of part and index within the string\n var parts = {};\n var match;\n var splitIndex = 0;\n while ((match = PART_REGEX.exec(pattern))) {\n if (!(match[0] in parts)) {\n parts[match[0]] = match.index;\n }\n else {\n splitIndex = match.index;\n break;\n }\n }\n if (!splitIndex) {\n return [\n {\n source: \"startRange\" /* startRange */,\n pattern: pattern,\n },\n ];\n }\n return [\n {\n source: \"startRange\" /* startRange */,\n pattern: pattern.slice(0, splitIndex),\n },\n {\n source: \"endRange\" /* endRange */,\n pattern: pattern.slice(splitIndex),\n },\n ];\n}\n","import { __assign } from \"tslib\";\nimport { invariant } from '../utils';\nimport { DATE_TIME_PROPS, removalPenalty, additionPenalty, differentNumericTypePenalty, longMorePenalty, shortMorePenalty, shortLessPenalty, longLessPenalty, } from './utils';\nimport { processDateTimePattern } from './skeleton';\nfunction isNumericType(t) {\n return t === 'numeric' || t === '2-digit';\n}\n/**\n * Credit: https://github.com/andyearnshaw/Intl.js/blob/0958dc1ad8153f1056653ea22b8208f0df289a4e/src/12.datetimeformat.js#L611\n * with some modifications\n * @param options\n * @param format\n */\nexport function bestFitFormatMatcherScore(options, format) {\n var score = 0;\n if (options.hour12 && !format.hour12) {\n score -= removalPenalty;\n }\n else if (!options.hour12 && format.hour12) {\n score -= additionPenalty;\n }\n for (var _i = 0, DATE_TIME_PROPS_1 = DATE_TIME_PROPS; _i < DATE_TIME_PROPS_1.length; _i++) {\n var prop = DATE_TIME_PROPS_1[_i];\n var optionsProp = options[prop];\n var formatProp = format[prop];\n if (optionsProp === undefined && formatProp !== undefined) {\n score -= additionPenalty;\n }\n else if (optionsProp !== undefined && formatProp === undefined) {\n score -= removalPenalty;\n }\n else if (optionsProp !== formatProp) {\n // extra penalty for numeric vs non-numeric\n if (isNumericType(optionsProp) !==\n isNumericType(formatProp)) {\n score -= differentNumericTypePenalty;\n }\n else {\n var values = ['2-digit', 'numeric', 'narrow', 'short', 'long'];\n var optionsPropIndex = values.indexOf(optionsProp);\n var formatPropIndex = values.indexOf(formatProp);\n var delta = Math.max(-2, Math.min(formatPropIndex - optionsPropIndex, 2));\n if (delta === 2) {\n score -= longMorePenalty;\n }\n else if (delta === 1) {\n score -= shortMorePenalty;\n }\n else if (delta === -1) {\n score -= shortLessPenalty;\n }\n else if (delta === -2) {\n score -= longLessPenalty;\n }\n }\n }\n }\n return score;\n}\n/**\n * https://tc39.es/ecma402/#sec-bestfitformatmatcher\n * Just alias to basic for now\n * @param options\n * @param formats\n * @param implDetails Implementation details\n */\nexport function BestFitFormatMatcher(options, formats) {\n var bestScore = -Infinity;\n var bestFormat = formats[0];\n invariant(Array.isArray(formats), 'formats should be a list of things');\n for (var _i = 0, formats_1 = formats; _i < formats_1.length; _i++) {\n var format = formats_1[_i];\n var score = bestFitFormatMatcherScore(options, format);\n if (score > bestScore) {\n bestScore = score;\n bestFormat = format;\n }\n }\n var skeletonFormat = __assign({}, bestFormat);\n var patternFormat = { rawPattern: bestFormat.rawPattern };\n processDateTimePattern(bestFormat.rawPattern, patternFormat);\n // Kinda following https://github.com/unicode-org/icu/blob/dd50e38f459d84e9bf1b0c618be8483d318458ad/icu4j/main/classes/core/src/com/ibm/icu/text/DateTimePatternGenerator.java\n // Method adjustFieldTypes\n for (var prop in skeletonFormat) {\n var skeletonValue = skeletonFormat[prop];\n var patternValue = patternFormat[prop];\n var requestedValue = options[prop];\n // Don't mess with minute/second or we can get in the situation of\n // 7:0:0 which is weird\n if (prop === 'minute' || prop === 'second') {\n continue;\n }\n // Nothing to do here\n if (!requestedValue) {\n continue;\n }\n // https://unicode.org/reports/tr35/tr35-dates.html#Matching_Skeletons\n // Looks like we should not convert numeric to alphabetic but the other way\n // around is ok\n if (isNumericType(patternValue) &&\n !isNumericType(requestedValue)) {\n continue;\n }\n if (skeletonValue === requestedValue) {\n continue;\n }\n patternFormat[prop] = requestedValue;\n }\n // Copy those over\n patternFormat.pattern = skeletonFormat.pattern;\n patternFormat.pattern12 = skeletonFormat.pattern12;\n patternFormat.skeleton = skeletonFormat.skeleton;\n patternFormat.rangePatterns = skeletonFormat.rangePatterns;\n patternFormat.rangePatterns12 = skeletonFormat.rangePatterns12;\n return patternFormat;\n}\n","/**\n * http://ecma-international.org/ecma-402/7.0/index.html#sec-canonicalizelocalelist\n * @param locales\n */\nexport function CanonicalizeLocaleList(locales) {\n // TODO\n return Intl.getCanonicalLocales(locales);\n}\n","/**\n * https://tc39.es/ecma402/#sec-canonicalizetimezonename\n * @param tz\n */\nexport function CanonicalizeTimeZoneName(tz, _a) {\n var tzData = _a.tzData, uppercaseLinks = _a.uppercaseLinks;\n var uppercasedTz = tz.toUpperCase();\n var uppercasedZones = Object.keys(tzData).reduce(function (all, z) {\n all[z.toUpperCase()] = z;\n return all;\n }, {});\n var ianaTimeZone = uppercaseLinks[uppercasedTz] || uppercasedZones[uppercasedTz];\n if (ianaTimeZone === 'Etc/UTC' || ianaTimeZone === 'Etc/GMT') {\n return 'UTC';\n }\n return ianaTimeZone;\n}\n","import { __assign } from \"tslib\";\nimport { invariant } from '../utils';\nimport { DATE_TIME_PROPS, additionPenalty, removalPenalty, longMorePenalty, shortMorePenalty, shortLessPenalty, longLessPenalty, } from './utils';\n/**\n * https://tc39.es/ecma402/#sec-basicformatmatcher\n * @param options\n * @param formats\n */\nexport function BasicFormatMatcher(options, formats) {\n var bestScore = -Infinity;\n var bestFormat = formats[0];\n invariant(Array.isArray(formats), 'formats should be a list of things');\n for (var _i = 0, formats_1 = formats; _i < formats_1.length; _i++) {\n var format = formats_1[_i];\n var score = 0;\n for (var _a = 0, DATE_TIME_PROPS_1 = DATE_TIME_PROPS; _a < DATE_TIME_PROPS_1.length; _a++) {\n var prop = DATE_TIME_PROPS_1[_a];\n var optionsProp = options[prop];\n var formatProp = format[prop];\n if (optionsProp === undefined && formatProp !== undefined) {\n score -= additionPenalty;\n }\n else if (optionsProp !== undefined && formatProp === undefined) {\n score -= removalPenalty;\n }\n else if (optionsProp !== formatProp) {\n var values = ['2-digit', 'numeric', 'narrow', 'short', 'long'];\n var optionsPropIndex = values.indexOf(optionsProp);\n var formatPropIndex = values.indexOf(formatProp);\n var delta = Math.max(-2, Math.min(formatPropIndex - optionsPropIndex, 2));\n if (delta === 2) {\n score -= longMorePenalty;\n }\n else if (delta === 1) {\n score -= shortMorePenalty;\n }\n else if (delta === -1) {\n score -= shortLessPenalty;\n }\n else if (delta === -2) {\n score -= longLessPenalty;\n }\n }\n }\n if (score > bestScore) {\n bestScore = score;\n bestFormat = format;\n }\n }\n return __assign({}, bestFormat);\n}\n","import { invariant } from '../utils';\nexport function DateTimeStyleFormat(dateStyle, timeStyle, dataLocaleData) {\n var dateFormat, timeFormat;\n if (timeStyle !== undefined) {\n invariant(timeStyle === 'full' ||\n timeStyle === 'long' ||\n timeStyle === 'medium' ||\n timeStyle === 'short', 'invalid timeStyle');\n timeFormat = dataLocaleData.timeFormat[timeStyle];\n }\n if (dateStyle !== undefined) {\n invariant(dateStyle === 'full' ||\n dateStyle === 'long' ||\n dateStyle === 'medium' ||\n dateStyle === 'short', 'invalid dateStyle');\n dateFormat = dataLocaleData.dateFormat[dateStyle];\n }\n if (dateStyle !== undefined && timeStyle !== undefined) {\n var format = {};\n for (var field in dateFormat) {\n if (field !== 'pattern') {\n // @ts-ignore\n format[field] = dateFormat[field];\n }\n }\n for (var field in timeFormat) {\n if (field !== 'pattern' && field !== 'pattern12') {\n // @ts-ignore\n format[field] = timeFormat[field];\n }\n }\n var connector = dataLocaleData.dateTimeFormat[dateStyle];\n var pattern = connector\n .replace('{0}', timeFormat.pattern)\n .replace('{1}', dateFormat.pattern);\n format.pattern = pattern;\n if ('pattern12' in timeFormat) {\n var pattern12 = connector\n .replace('{0}', timeFormat.pattern12)\n .replace('{1}', dateFormat.pattern);\n format.pattern12 = pattern12;\n }\n return format;\n }\n if (timeStyle !== undefined) {\n return timeFormat;\n }\n invariant(dateStyle !== undefined, 'dateStyle should not be undefined');\n return dateFormat;\n}\n","/**\n * https://tc39.es/ecma262/#sec-tostring\n */\nexport function ToString(o) {\n // Only symbol is irregular...\n if (typeof o === 'symbol') {\n throw TypeError('Cannot convert a Symbol value to a string');\n }\n return String(o);\n}\n/**\n * https://tc39.es/ecma262/#sec-tonumber\n * @param val\n */\nexport function ToNumber(val) {\n if (val === undefined) {\n return NaN;\n }\n if (val === null) {\n return +0;\n }\n if (typeof val === 'boolean') {\n return val ? 1 : +0;\n }\n if (typeof val === 'number') {\n return val;\n }\n if (typeof val === 'symbol' || typeof val === 'bigint') {\n throw new TypeError('Cannot convert symbol/bigint to number');\n }\n return Number(val);\n}\n/**\n * https://tc39.es/ecma262/#sec-tointeger\n * @param n\n */\nfunction ToInteger(n) {\n var number = ToNumber(n);\n if (isNaN(number) || SameValue(number, -0)) {\n return 0;\n }\n if (isFinite(number)) {\n return number;\n }\n var integer = Math.floor(Math.abs(number));\n if (number < 0) {\n integer = -integer;\n }\n if (SameValue(integer, -0)) {\n return 0;\n }\n return integer;\n}\n/**\n * https://tc39.es/ecma262/#sec-timeclip\n * @param time\n */\nexport function TimeClip(time) {\n if (!isFinite(time)) {\n return NaN;\n }\n if (Math.abs(time) > 8.64 * 1e16) {\n return NaN;\n }\n return ToInteger(time);\n}\n/**\n * https://tc39.es/ecma262/#sec-toobject\n * @param arg\n */\nexport function ToObject(arg) {\n if (arg == null) {\n throw new TypeError('undefined/null cannot be converted to object');\n }\n return Object(arg);\n}\n/**\n * https://www.ecma-international.org/ecma-262/11.0/index.html#sec-samevalue\n * @param x\n * @param y\n */\nexport function SameValue(x, y) {\n if (Object.is) {\n return Object.is(x, y);\n }\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n }\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n}\n/**\n * https://www.ecma-international.org/ecma-262/11.0/index.html#sec-arraycreate\n * @param len\n */\nexport function ArrayCreate(len) {\n return new Array(len);\n}\n/**\n * https://www.ecma-international.org/ecma-262/11.0/index.html#sec-hasownproperty\n * @param o\n * @param prop\n */\nexport function HasOwnProperty(o, prop) {\n return Object.prototype.hasOwnProperty.call(o, prop);\n}\n/**\n * https://www.ecma-international.org/ecma-262/11.0/index.html#sec-type\n * @param x\n */\nexport function Type(x) {\n if (x === null) {\n return 'Null';\n }\n if (typeof x === 'undefined') {\n return 'Undefined';\n }\n if (typeof x === 'function' || typeof x === 'object') {\n return 'Object';\n }\n if (typeof x === 'number') {\n return 'Number';\n }\n if (typeof x === 'boolean') {\n return 'Boolean';\n }\n if (typeof x === 'string') {\n return 'String';\n }\n if (typeof x === 'symbol') {\n return 'Symbol';\n }\n if (typeof x === 'bigint') {\n return 'BigInt';\n }\n}\nvar MS_PER_DAY = 86400000;\n/**\n * https://www.ecma-international.org/ecma-262/11.0/index.html#eqn-modulo\n * @param x\n * @param y\n * @return k of the same sign as y\n */\nfunction mod(x, y) {\n return x - Math.floor(x / y) * y;\n}\n/**\n * https://tc39.es/ecma262/#eqn-Day\n * @param t\n */\nexport function Day(t) {\n return Math.floor(t / MS_PER_DAY);\n}\n/**\n * https://tc39.es/ecma262/#sec-week-day\n * @param t\n */\nexport function WeekDay(t) {\n return mod(Day(t) + 4, 7);\n}\n/**\n * https://tc39.es/ecma262/#sec-year-number\n * @param y\n */\nexport function DayFromYear(y) {\n return (365 * (y - 1970) +\n Math.floor((y - 1969) / 4) -\n Math.floor((y - 1901) / 100) +\n Math.floor((y - 1601) / 400));\n}\n/**\n * https://tc39.es/ecma262/#sec-year-number\n * @param y\n */\nexport function TimeFromYear(y) {\n return MS_PER_DAY * DayFromYear(y);\n}\n/**\n * https://tc39.es/ecma262/#sec-year-number\n * @param t\n */\nexport function YearFromTime(t) {\n var min = Math.ceil(t / MS_PER_DAY / 366);\n var y = min;\n while (TimeFromYear(y) <= t) {\n y++;\n }\n return y - 1;\n}\nexport function DaysInYear(y) {\n if (y % 4 !== 0) {\n return 365;\n }\n if (y % 100 !== 0) {\n return 366;\n }\n if (y % 400 !== 0) {\n return 365;\n }\n return 366;\n}\nexport function DayWithinYear(t) {\n return Day(t) - DayFromYear(YearFromTime(t));\n}\nexport function InLeapYear(t) {\n return DaysInYear(YearFromTime(t)) === 365 ? 0 : 1;\n}\n/**\n * https://tc39.es/ecma262/#sec-month-number\n * @param t\n */\nexport function MonthFromTime(t) {\n var dwy = DayWithinYear(t);\n var leap = InLeapYear(t);\n if (dwy >= 0 && dwy < 31) {\n return 0;\n }\n if (dwy < 59 + leap) {\n return 1;\n }\n if (dwy < 90 + leap) {\n return 2;\n }\n if (dwy < 120 + leap) {\n return 3;\n }\n if (dwy < 151 + leap) {\n return 4;\n }\n if (dwy < 181 + leap) {\n return 5;\n }\n if (dwy < 212 + leap) {\n return 6;\n }\n if (dwy < 243 + leap) {\n return 7;\n }\n if (dwy < 273 + leap) {\n return 8;\n }\n if (dwy < 304 + leap) {\n return 9;\n }\n if (dwy < 334 + leap) {\n return 10;\n }\n if (dwy < 365 + leap) {\n return 11;\n }\n throw new Error('Invalid time');\n}\nexport function DateFromTime(t) {\n var dwy = DayWithinYear(t);\n var mft = MonthFromTime(t);\n var leap = InLeapYear(t);\n if (mft === 0) {\n return dwy + 1;\n }\n if (mft === 1) {\n return dwy - 30;\n }\n if (mft === 2) {\n return dwy - 58 - leap;\n }\n if (mft === 3) {\n return dwy - 89 - leap;\n }\n if (mft === 4) {\n return dwy - 119 - leap;\n }\n if (mft === 5) {\n return dwy - 150 - leap;\n }\n if (mft === 6) {\n return dwy - 180 - leap;\n }\n if (mft === 7) {\n return dwy - 211 - leap;\n }\n if (mft === 8) {\n return dwy - 242 - leap;\n }\n if (mft === 9) {\n return dwy - 272 - leap;\n }\n if (mft === 10) {\n return dwy - 303 - leap;\n }\n if (mft === 11) {\n return dwy - 333 - leap;\n }\n throw new Error('Invalid time');\n}\nvar HOURS_PER_DAY = 24;\nvar MINUTES_PER_HOUR = 60;\nvar SECONDS_PER_MINUTE = 60;\nvar MS_PER_SECOND = 1e3;\nvar MS_PER_MINUTE = MS_PER_SECOND * SECONDS_PER_MINUTE;\nvar MS_PER_HOUR = MS_PER_MINUTE * MINUTES_PER_HOUR;\nexport function HourFromTime(t) {\n return mod(Math.floor(t / MS_PER_HOUR), HOURS_PER_DAY);\n}\nexport function MinFromTime(t) {\n return mod(Math.floor(t / MS_PER_MINUTE), MINUTES_PER_HOUR);\n}\nexport function SecFromTime(t) {\n return mod(Math.floor(t / MS_PER_SECOND), SECONDS_PER_MINUTE);\n}\n","import { invariant } from '../utils';\nimport { Type, YearFromTime, WeekDay, MonthFromTime, DateFromTime, HourFromTime, MinFromTime, SecFromTime, } from '../262';\nfunction getApplicableZoneData(t, timeZone, tzData) {\n var _a;\n var zoneData = tzData[timeZone];\n // We don't have data for this so just say it's UTC\n if (!zoneData) {\n return [0, false];\n }\n var i = 0;\n var offset = 0;\n var dst = false;\n for (; i <= zoneData.length; i++) {\n if (i === zoneData.length || zoneData[i][0] * 1e3 > t) {\n _a = zoneData[i - 1], offset = _a[2], dst = _a[3];\n break;\n }\n }\n return [offset * 1e3, dst];\n}\n/**\n * https://tc39.es/ecma402/#sec-tolocaltime\n * @param t\n * @param calendar\n * @param timeZone\n */\nexport function ToLocalTime(t, calendar, timeZone, _a) {\n var tzData = _a.tzData;\n invariant(Type(t) === 'Number', 'invalid time');\n invariant(calendar === 'gregory', 'We only support Gregory calendar right now');\n var _b = getApplicableZoneData(t, timeZone, tzData), timeZoneOffset = _b[0], inDST = _b[1];\n var tz = t + timeZoneOffset;\n var year = YearFromTime(tz);\n return {\n weekday: WeekDay(tz),\n era: year < 0 ? 'BC' : 'AD',\n year: year,\n relatedYear: undefined,\n yearName: undefined,\n month: MonthFromTime(tz),\n day: DateFromTime(tz),\n hour: HourFromTime(tz),\n minute: MinFromTime(tz),\n second: SecFromTime(tz),\n inDST: inDST,\n // IMPORTANT: Not in spec\n timeZoneOffset: timeZoneOffset,\n };\n}\n","import { DATE_TIME_PROPS } from './utils';\nimport { ToLocalTime } from './ToLocalTime';\nimport { TimeClip } from '../262';\nfunction pad(n) {\n if (n < 10) {\n return \"0\" + n;\n }\n return String(n);\n}\nfunction offsetToGmtString(gmtFormat, hourFormat, offsetInMs, style) {\n var offsetInMinutes = Math.floor(offsetInMs / 60000);\n var mins = Math.abs(offsetInMinutes) % 60;\n var hours = Math.floor(Math.abs(offsetInMinutes) / 60);\n var _a = hourFormat.split(';'), positivePattern = _a[0], negativePattern = _a[1];\n var offsetStr = '';\n var pattern = offsetInMs < 0 ? negativePattern : positivePattern;\n if (style === 'long') {\n offsetStr = pattern\n .replace('HH', pad(hours))\n .replace('H', String(hours))\n .replace('mm', pad(mins))\n .replace('m', String(mins));\n }\n else if (mins || hours) {\n if (!mins) {\n pattern = pattern.replace(/:?m+/, '');\n }\n offsetStr = pattern\n .replace(/H+/, String(hours))\n .replace(/m+/, String(mins));\n }\n return gmtFormat.replace('{0}', offsetStr);\n}\n/**\n * https://tc39.es/ecma402/#sec-partitiondatetimepattern\n * @param dtf\n * @param x\n */\nexport function FormatDateTimePattern(dtf, patternParts, x, _a) {\n var getInternalSlots = _a.getInternalSlots, localeData = _a.localeData, getDefaultTimeZone = _a.getDefaultTimeZone, tzData = _a.tzData;\n x = TimeClip(x);\n /** IMPL START */\n var internalSlots = getInternalSlots(dtf);\n var dataLocale = internalSlots.dataLocale;\n var dataLocaleData = localeData[dataLocale];\n /** IMPL END */\n var locale = internalSlots.locale;\n var nfOptions = Object.create(null);\n nfOptions.useGrouping = false;\n var nf = new Intl.NumberFormat(locale, nfOptions);\n var nf2Options = Object.create(null);\n nf2Options.minimumIntegerDigits = 2;\n nf2Options.useGrouping = false;\n var nf2 = new Intl.NumberFormat(locale, nf2Options);\n var tm = ToLocalTime(x, \n // @ts-ignore\n internalSlots.calendar, internalSlots.timeZone, { tzData: tzData });\n var result = [];\n for (var _i = 0, patternParts_1 = patternParts; _i < patternParts_1.length; _i++) {\n var patternPart = patternParts_1[_i];\n var p = patternPart.type;\n if (p === 'literal') {\n result.push({\n type: 'literal',\n value: patternPart.value,\n });\n }\n else if (DATE_TIME_PROPS.indexOf(p) > -1) {\n var fv = '';\n var f = internalSlots[p];\n // @ts-ignore\n var v = tm[p];\n if (p === 'year' && v <= 0) {\n v = 1 - v;\n }\n if (p === 'month') {\n v++;\n }\n var hourCycle = internalSlots.hourCycle;\n if (p === 'hour' && (hourCycle === 'h11' || hourCycle === 'h12')) {\n v = v % 12;\n if (v === 0 && hourCycle === 'h12') {\n v = 12;\n }\n }\n if (p === 'hour' && hourCycle === 'h24') {\n if (v === 0) {\n v = 24;\n }\n }\n if (f === 'numeric') {\n fv = nf.format(v);\n }\n else if (f === '2-digit') {\n fv = nf2.format(v);\n if (fv.length > 2) {\n fv = fv.slice(fv.length - 2, fv.length);\n }\n }\n else if (f === 'narrow' || f === 'short' || f === 'long') {\n if (p === 'era') {\n fv = dataLocaleData[p][f][v];\n }\n else if (p === 'timeZoneName') {\n var timeZoneName = dataLocaleData.timeZoneName, gmtFormat = dataLocaleData.gmtFormat, hourFormat = dataLocaleData.hourFormat;\n var timeZone = internalSlots.timeZone || getDefaultTimeZone();\n var timeZoneData = timeZoneName[timeZone];\n if (timeZoneData && timeZoneData[f]) {\n fv = timeZoneData[f][+tm.inDST];\n }\n else {\n // Fallback to gmtFormat\n fv = offsetToGmtString(gmtFormat, hourFormat, tm.timeZoneOffset, f);\n }\n }\n else if (p === 'month') {\n fv = dataLocaleData.month[f][v - 1];\n }\n else {\n fv = dataLocaleData[p][f][v];\n }\n }\n result.push({\n type: p,\n value: fv,\n });\n }\n else if (p === 'ampm') {\n var v = tm.hour;\n var fv = void 0;\n if (v > 11) {\n fv = dataLocaleData.pm;\n }\n else {\n fv = dataLocaleData.am;\n }\n result.push({\n type: 'dayPeriod',\n value: fv,\n });\n }\n else if (p === 'relatedYear') {\n var v = tm.relatedYear;\n // @ts-ignore\n var fv = nf.format(v);\n result.push({\n // @ts-ignore TODO: Fix TS type\n type: 'relatedYear',\n value: fv,\n });\n }\n else if (p === 'yearName') {\n var v = tm.yearName;\n // @ts-ignore\n var fv = nf.format(v);\n result.push({\n // @ts-ignore TODO: Fix TS type\n type: 'yearName',\n value: fv,\n });\n }\n }\n return result;\n}\n","import { invariant } from './utils';\n/**\n * https://tc39.es/ecma402/#sec-partitionpattern\n * @param pattern\n */\nexport function PartitionPattern(pattern) {\n var result = [];\n var beginIndex = pattern.indexOf('{');\n var endIndex = 0;\n var nextIndex = 0;\n var length = pattern.length;\n while (beginIndex < pattern.length && beginIndex > -1) {\n endIndex = pattern.indexOf('}', beginIndex);\n invariant(endIndex > beginIndex, \"Invalid pattern \" + pattern);\n if (beginIndex > nextIndex) {\n result.push({\n type: 'literal',\n value: pattern.substring(nextIndex, beginIndex),\n });\n }\n result.push({\n type: pattern.substring(beginIndex + 1, endIndex),\n value: undefined,\n });\n nextIndex = endIndex + 1;\n beginIndex = pattern.indexOf('{', nextIndex);\n }\n if (nextIndex < length) {\n result.push({\n type: 'literal',\n value: pattern.substring(nextIndex, length),\n });\n }\n return result;\n}\n","import { TimeClip } from '../262';\nimport { FormatDateTimePattern, } from './FormatDateTimePattern';\nimport { PartitionPattern } from '../PartitionPattern';\n/**\n * https://tc39.es/ecma402/#sec-partitiondatetimepattern\n * @param dtf\n * @param x\n */\nexport function PartitionDateTimePattern(dtf, x, implDetails) {\n x = TimeClip(x);\n if (isNaN(x)) {\n throw new RangeError('invalid time');\n }\n /** IMPL START */\n var getInternalSlots = implDetails.getInternalSlots;\n var internalSlots = getInternalSlots(dtf);\n /** IMPL END */\n var pattern = internalSlots.pattern;\n return FormatDateTimePattern(dtf, PartitionPattern(pattern), x, implDetails);\n}\n","import { PartitionDateTimePattern } from './PartitionDateTimePattern';\n/**\n * https://tc39.es/ecma402/#sec-formatdatetime\n * @param dtf DateTimeFormat\n * @param x\n */\nexport function FormatDateTime(dtf, x, implDetails) {\n var parts = PartitionDateTimePattern(dtf, x, implDetails);\n var result = '';\n for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {\n var part = parts_1[_i];\n result += part.value;\n }\n return result;\n}\n","import { SameValue, TimeClip } from '../262';\nimport { ToLocalTime } from './ToLocalTime';\nimport { FormatDateTimePattern, } from './FormatDateTimePattern';\nimport { PartitionPattern } from '../PartitionPattern';\nvar TABLE_2_FIELDS = [\n 'era',\n 'year',\n 'month',\n 'day',\n 'ampm',\n 'hour',\n 'minute',\n 'second',\n];\nexport function PartitionDateTimeRangePattern(dtf, x, y, implDetails) {\n x = TimeClip(x);\n if (isNaN(x)) {\n throw new RangeError('Invalid start time');\n }\n y = TimeClip(y);\n if (isNaN(y)) {\n throw new RangeError('Invalid end time');\n }\n /** IMPL START */\n var getInternalSlots = implDetails.getInternalSlots, tzData = implDetails.tzData;\n var internalSlots = getInternalSlots(dtf);\n /** IMPL END */\n var tm1 = ToLocalTime(x, \n // @ts-ignore\n internalSlots.calendar, internalSlots.timeZone, { tzData: tzData });\n var tm2 = ToLocalTime(y, \n // @ts-ignore\n internalSlots.calendar, internalSlots.timeZone, { tzData: tzData });\n var pattern = internalSlots.pattern, rangePatterns = internalSlots.rangePatterns;\n var rangePattern;\n var dateFieldsPracticallyEqual = true;\n var patternContainsLargerDateField = false;\n for (var _i = 0, TABLE_2_FIELDS_1 = TABLE_2_FIELDS; _i < TABLE_2_FIELDS_1.length; _i++) {\n var fieldName = TABLE_2_FIELDS_1[_i];\n if (dateFieldsPracticallyEqual && !patternContainsLargerDateField) {\n if (fieldName === 'ampm') {\n var v1 = tm1.hour;\n var v2 = tm2.hour;\n var rp = rangePatterns.ampm;\n if ((v1 > 11 && v2 < 11) || (v1 < 11 && v2 > 11)) {\n dateFieldsPracticallyEqual = false;\n }\n if (rangePattern !== undefined && rp === undefined) {\n patternContainsLargerDateField = true;\n }\n rangePattern = rp;\n }\n else {\n var v1 = tm1[fieldName];\n var v2 = tm2[fieldName];\n var rp = rangePatterns[fieldName];\n if (!SameValue(v1, v2)) {\n dateFieldsPracticallyEqual = false;\n }\n if (rangePattern !== undefined && rp === undefined) {\n patternContainsLargerDateField = true;\n }\n rangePattern = rp;\n }\n }\n }\n if (dateFieldsPracticallyEqual) {\n var result_2 = FormatDateTimePattern(dtf, PartitionPattern(pattern), x, implDetails);\n for (var _a = 0, result_1 = result_2; _a < result_1.length; _a++) {\n var r = result_1[_a];\n r.source = \"shared\" /* shared */;\n }\n return result_2;\n }\n var result = [];\n if (rangePattern === undefined) {\n rangePattern = rangePatterns.default;\n }\n for (var _b = 0, _c = rangePattern.patternParts; _b < _c.length; _b++) {\n var rangePatternPart = _c[_b];\n var source = rangePatternPart.source, pattern_1 = rangePatternPart.pattern;\n var z = void 0;\n if (source === \"startRange\" /* startRange */ ||\n source === \"shared\" /* shared */) {\n z = x;\n }\n else {\n z = y;\n }\n var patternParts = PartitionPattern(pattern_1);\n var partResult = FormatDateTimePattern(dtf, patternParts, z, implDetails);\n for (var _d = 0, partResult_1 = partResult; _d < partResult_1.length; _d++) {\n var r = partResult_1[_d];\n r.source = source;\n }\n result = result.concat(partResult);\n }\n return result;\n}\n","import { PartitionDateTimeRangePattern } from './PartitionDateTimeRangePattern';\nexport function FormatDateTimeRange(dtf, x, y, implDetails) {\n var parts = PartitionDateTimeRangePattern(dtf, x, y, implDetails);\n var result = '';\n for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {\n var part = parts_1[_i];\n result += part.value;\n }\n return result;\n}\n","import { PartitionDateTimeRangePattern } from './PartitionDateTimeRangePattern';\nexport function FormatDateTimeRangeToParts(dtf, x, y, implDetails) {\n var parts = PartitionDateTimeRangePattern(dtf, x, y, implDetails);\n var result = new Array(0);\n for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {\n var part = parts_1[_i];\n result.push({\n type: part.type,\n value: part.value,\n source: part.source,\n });\n }\n return result;\n}\n","import { PartitionDateTimePattern } from './PartitionDateTimePattern';\nimport { ArrayCreate } from '../262';\n/**\n * https://tc39.es/ecma402/#sec-formatdatetimetoparts\n *\n * @param dtf\n * @param x\n * @param implDetails\n */\nexport function FormatDateTimeToParts(dtf, x, implDetails) {\n var parts = PartitionDateTimePattern(dtf, x, implDetails);\n var result = ArrayCreate(0);\n for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {\n var part = parts_1[_i];\n result.push({\n type: part.type,\n value: part.value,\n });\n }\n return result;\n}\n","import { ToObject } from '../262';\n/**\n * https://tc39.es/ecma402/#sec-todatetimeoptions\n * @param options\n * @param required\n * @param defaults\n */\nexport function ToDateTimeOptions(options, required, defaults) {\n if (options === undefined) {\n options = null;\n }\n else {\n options = ToObject(options);\n }\n options = Object.create(options);\n var needDefaults = true;\n if (required === 'date' || required === 'any') {\n for (var _i = 0, _a = ['weekday', 'year', 'month', 'day']; _i < _a.length; _i++) {\n var prop = _a[_i];\n var value = options[prop];\n if (value !== undefined) {\n needDefaults = false;\n }\n }\n }\n if (required === 'time' || required === 'any') {\n for (var _b = 0, _c = ['hour', 'minute', 'second']; _b < _c.length; _b++) {\n var prop = _c[_b];\n var value = options[prop];\n if (value !== undefined) {\n needDefaults = false;\n }\n }\n }\n if (options.dateStyle !== undefined || options.timeStyle !== undefined) {\n needDefaults = false;\n }\n if (required === 'date' && options.timeStyle) {\n throw new TypeError('Intl.DateTimeFormat date was required but timeStyle was included');\n }\n if (required === 'time' && options.dateStyle) {\n throw new TypeError('Intl.DateTimeFormat time was required but dateStyle was included');\n }\n if (needDefaults && (defaults === 'date' || defaults === 'all')) {\n for (var _d = 0, _e = ['year', 'month', 'day']; _d < _e.length; _d++) {\n var prop = _e[_d];\n options[prop] = 'numeric';\n }\n }\n if (needDefaults && (defaults === 'time' || defaults === 'all')) {\n for (var _f = 0, _g = ['hour', 'minute', 'second']; _f < _g.length; _f++) {\n var prop = _g[_f];\n options[prop] = 'numeric';\n }\n }\n return options;\n}\n","import { ToString } from './262';\n/**\n * https://tc39.es/ecma402/#sec-getoption\n * @param opts\n * @param prop\n * @param type\n * @param values\n * @param fallback\n */\nexport function GetOption(opts, prop, type, values, fallback) {\n // const descriptor = Object.getOwnPropertyDescriptor(opts, prop);\n var value = opts[prop];\n if (value !== undefined) {\n if (type !== 'boolean' && type !== 'string') {\n throw new TypeError('invalid type');\n }\n if (type === 'boolean') {\n value = Boolean(value);\n }\n if (type === 'string') {\n value = ToString(value);\n }\n if (values !== undefined && !values.filter(function (val) { return val == value; }).length) {\n throw new RangeError(value + \" is not within \" + values.join(', '));\n }\n return value;\n }\n return fallback;\n}\n","/**\n * https://tc39.es/ecma402/#sec-bestavailablelocale\n * @param availableLocales\n * @param locale\n */\nexport function BestAvailableLocale(availableLocales, locale) {\n var candidate = locale;\n while (true) {\n if (~availableLocales.indexOf(candidate)) {\n return candidate;\n }\n var pos = candidate.lastIndexOf('-');\n if (!~pos) {\n return undefined;\n }\n if (pos >= 2 && candidate[pos - 2] === '-') {\n pos -= 2;\n }\n candidate = candidate.slice(0, pos);\n }\n}\n","import { invariant } from './utils';\n/**\n * https://tc39.es/ecma402/#sec-unicodeextensionvalue\n * @param extension\n * @param key\n */\nexport function UnicodeExtensionValue(extension, key) {\n invariant(key.length === 2, 'key must have 2 elements');\n var size = extension.length;\n var searchValue = \"-\" + key + \"-\";\n var pos = extension.indexOf(searchValue);\n if (pos !== -1) {\n var start = pos + 4;\n var end = start;\n var k = start;\n var done = false;\n while (!done) {\n var e = extension.indexOf('-', k);\n var len = void 0;\n if (e === -1) {\n len = size - k;\n }\n else {\n len = e - k;\n }\n if (len === 2) {\n done = true;\n }\n else if (e === -1) {\n end = size;\n done = true;\n }\n else {\n end = e;\n k = e + 1;\n }\n }\n return extension.slice(start, end);\n }\n searchValue = \"-\" + key;\n pos = extension.indexOf(searchValue);\n if (pos !== -1 && pos + 3 === size) {\n return '';\n }\n return undefined;\n}\n","import { LookupMatcher } from './LookupMatcher';\nimport { BestFitMatcher } from './BestFitMatcher';\nimport { invariant } from './utils';\nimport { UnicodeExtensionValue } from './UnicodeExtensionValue';\n/**\n * https://tc39.es/ecma402/#sec-resolvelocale\n */\nexport function ResolveLocale(availableLocales, requestedLocales, options, relevantExtensionKeys, localeData, getDefaultLocale) {\n var matcher = options.localeMatcher;\n var r;\n if (matcher === 'lookup') {\n r = LookupMatcher(availableLocales, requestedLocales, getDefaultLocale);\n }\n else {\n r = BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale);\n }\n var foundLocale = r.locale;\n var result = { locale: '', dataLocale: foundLocale };\n var supportedExtension = '-u';\n for (var _i = 0, relevantExtensionKeys_1 = relevantExtensionKeys; _i < relevantExtensionKeys_1.length; _i++) {\n var key = relevantExtensionKeys_1[_i];\n invariant(foundLocale in localeData, \"Missing locale data for \" + foundLocale);\n var foundLocaleData = localeData[foundLocale];\n invariant(typeof foundLocaleData === 'object' && foundLocaleData !== null, \"locale data \" + key + \" must be an object\");\n var keyLocaleData = foundLocaleData[key];\n invariant(Array.isArray(keyLocaleData), \"keyLocaleData for \" + key + \" must be an array\");\n var value = keyLocaleData[0];\n invariant(typeof value === 'string' || value === null, \"value must be string or null but got \" + typeof value + \" in key \" + key);\n var supportedExtensionAddition = '';\n if (r.extension) {\n var requestedValue = UnicodeExtensionValue(r.extension, key);\n if (requestedValue !== undefined) {\n if (requestedValue !== '') {\n if (~keyLocaleData.indexOf(requestedValue)) {\n value = requestedValue;\n supportedExtensionAddition = \"-\" + key + \"-\" + value;\n }\n }\n else if (~requestedValue.indexOf('true')) {\n value = 'true';\n supportedExtensionAddition = \"-\" + key;\n }\n }\n }\n if (key in options) {\n var optionsValue = options[key];\n invariant(typeof optionsValue === 'string' ||\n typeof optionsValue === 'undefined' ||\n optionsValue === null, 'optionsValue must be String, Undefined or Null');\n if (~keyLocaleData.indexOf(optionsValue)) {\n if (optionsValue !== value) {\n value = optionsValue;\n supportedExtensionAddition = '';\n }\n }\n }\n result[key] = value;\n supportedExtension += supportedExtensionAddition;\n }\n if (supportedExtension.length > 2) {\n var privateIndex = foundLocale.indexOf('-x-');\n if (privateIndex === -1) {\n foundLocale = foundLocale + supportedExtension;\n }\n else {\n var preExtension = foundLocale.slice(0, privateIndex);\n var postExtension = foundLocale.slice(privateIndex, foundLocale.length);\n foundLocale = preExtension + supportedExtension + postExtension;\n }\n foundLocale = Intl.getCanonicalLocales(foundLocale)[0];\n }\n result.locale = foundLocale;\n return result;\n}\n","import { UNICODE_EXTENSION_SEQUENCE_REGEX } from './utils';\nimport { BestAvailableLocale } from './BestAvailableLocale';\n/**\n * https://tc39.es/ecma402/#sec-lookupmatcher\n * @param availableLocales\n * @param requestedLocales\n * @param getDefaultLocale\n */\nexport function LookupMatcher(availableLocales, requestedLocales, getDefaultLocale) {\n var result = { locale: '' };\n for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {\n var locale = requestedLocales_1[_i];\n var noExtensionLocale = locale.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, '');\n var availableLocale = BestAvailableLocale(availableLocales, noExtensionLocale);\n if (availableLocale) {\n result.locale = availableLocale;\n if (locale !== noExtensionLocale) {\n result.extension = locale.slice(noExtensionLocale.length + 1, locale.length);\n }\n return result;\n }\n }\n result.locale = getDefaultLocale();\n return result;\n}\n","import { BestAvailableLocale } from './BestAvailableLocale';\nimport { UNICODE_EXTENSION_SEQUENCE_REGEX } from './utils';\n/**\n * https://tc39.es/ecma402/#sec-bestfitmatcher\n * @param availableLocales\n * @param requestedLocales\n * @param getDefaultLocale\n */\nexport function BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale) {\n var result = { locale: '' };\n for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {\n var locale = requestedLocales_1[_i];\n var noExtensionLocale = locale.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, '');\n var availableLocale = BestAvailableLocale(availableLocales, noExtensionLocale);\n if (availableLocale) {\n result.locale = availableLocale;\n if (locale !== noExtensionLocale) {\n result.extension = locale.slice(noExtensionLocale.length + 1, locale.length);\n }\n return result;\n }\n }\n result.locale = getDefaultLocale();\n return result;\n}\n","/**\n * https://tc39.es/ecma402/#sec-isvalidtimezonename\n * @param tz\n * @param implDetails implementation details\n */\nexport function IsValidTimeZoneName(tz, _a) {\n var tzData = _a.tzData, uppercaseLinks = _a.uppercaseLinks;\n var uppercasedTz = tz.toUpperCase();\n var zoneNames = new Set(Object.keys(tzData).map(function (z) { return z.toUpperCase(); }));\n return zoneNames.has(uppercasedTz) || uppercasedTz in uppercaseLinks;\n}\n","import { CanonicalizeLocaleList } from '../CanonicalizeLocaleList';\nimport { ToDateTimeOptions } from './ToDateTimeOptions';\nimport { GetOption } from '../GetOption';\nimport { ResolveLocale } from '../ResolveLocale';\nimport { IsValidTimeZoneName } from '../IsValidTimeZoneName';\nimport { CanonicalizeTimeZoneName } from '../CanonicalizeTimeZoneName';\nimport { BasicFormatMatcher } from './BasicFormatMatcher';\nimport { BestFitFormatMatcher } from './BestFitFormatMatcher';\nimport { invariant } from '../utils';\nimport { DATE_TIME_PROPS } from './utils';\nimport { DateTimeStyleFormat } from './DateTimeStyleFormat';\nfunction isTimeRelated(opt) {\n for (var _i = 0, _a = ['hour', 'minute', 'second']; _i < _a.length; _i++) {\n var prop = _a[_i];\n var value = opt[prop];\n if (value !== undefined) {\n return true;\n }\n }\n return false;\n}\nfunction resolveHourCycle(hc, hcDefault, hour12) {\n if (hc == null) {\n hc = hcDefault;\n }\n if (hour12 !== undefined) {\n if (hour12) {\n if (hcDefault === 'h11' || hcDefault === 'h23') {\n hc = 'h11';\n }\n else {\n hc = 'h12';\n }\n }\n else {\n invariant(!hour12, 'hour12 must not be set');\n if (hcDefault === 'h11' || hcDefault === 'h23') {\n hc = 'h23';\n }\n else {\n hc = 'h24';\n }\n }\n }\n return hc;\n}\nvar TYPE_REGEX = /^[a-z0-9]{3,8}$/i;\n/**\n * https://tc39.es/ecma402/#sec-initializedatetimeformat\n * @param dtf DateTimeFormat\n * @param locales locales\n * @param opts options\n */\nexport function InitializeDateTimeFormat(dtf, locales, opts, _a) {\n var getInternalSlots = _a.getInternalSlots, availableLocales = _a.availableLocales, localeData = _a.localeData, getDefaultLocale = _a.getDefaultLocale, getDefaultTimeZone = _a.getDefaultTimeZone, relevantExtensionKeys = _a.relevantExtensionKeys, tzData = _a.tzData, uppercaseLinks = _a.uppercaseLinks;\n // @ts-ignore\n var requestedLocales = CanonicalizeLocaleList(locales);\n var options = ToDateTimeOptions(opts, 'any', 'date');\n var opt = Object.create(null);\n var matcher = GetOption(options, 'localeMatcher', 'string', ['lookup', 'best fit'], 'best fit');\n opt.localeMatcher = matcher;\n var calendar = GetOption(options, 'calendar', 'string', undefined, undefined);\n if (calendar !== undefined && !TYPE_REGEX.test(calendar)) {\n throw new RangeError('Malformed calendar');\n }\n var internalSlots = getInternalSlots(dtf);\n opt.ca = calendar;\n var numberingSystem = GetOption(options, 'numberingSystem', 'string', undefined, undefined);\n if (numberingSystem !== undefined && !TYPE_REGEX.test(numberingSystem)) {\n throw new RangeError('Malformed numbering system');\n }\n opt.nu = numberingSystem;\n var hour12 = GetOption(options, 'hour12', 'boolean', undefined, undefined);\n var hourCycle = GetOption(options, 'hourCycle', 'string', ['h11', 'h12', 'h23', 'h24'], undefined);\n if (hour12 !== undefined) {\n // @ts-ignore\n hourCycle = null;\n }\n opt.hc = hourCycle;\n var r = ResolveLocale(availableLocales, requestedLocales, opt, relevantExtensionKeys, localeData, getDefaultLocale);\n internalSlots.locale = r.locale;\n calendar = r.ca;\n internalSlots.calendar = calendar;\n internalSlots.hourCycle = r.hc;\n internalSlots.numberingSystem = r.nu;\n var dataLocale = r.dataLocale;\n internalSlots.dataLocale = dataLocale;\n var timeZone = options.timeZone;\n if (timeZone !== undefined) {\n timeZone = String(timeZone);\n if (!IsValidTimeZoneName(timeZone, { tzData: tzData, uppercaseLinks: uppercaseLinks })) {\n throw new RangeError('Invalid timeZoneName');\n }\n timeZone = CanonicalizeTimeZoneName(timeZone, { tzData: tzData, uppercaseLinks: uppercaseLinks });\n }\n else {\n timeZone = getDefaultTimeZone();\n }\n internalSlots.timeZone = timeZone;\n opt = Object.create(null);\n opt.weekday = GetOption(options, 'weekday', 'string', ['narrow', 'short', 'long'], undefined);\n opt.era = GetOption(options, 'era', 'string', ['narrow', 'short', 'long'], undefined);\n opt.year = GetOption(options, 'year', 'string', ['2-digit', 'numeric'], undefined);\n opt.month = GetOption(options, 'month', 'string', ['2-digit', 'numeric', 'narrow', 'short', 'long'], undefined);\n opt.day = GetOption(options, 'day', 'string', ['2-digit', 'numeric'], undefined);\n opt.hour = GetOption(options, 'hour', 'string', ['2-digit', 'numeric'], undefined);\n opt.minute = GetOption(options, 'minute', 'string', ['2-digit', 'numeric'], undefined);\n opt.second = GetOption(options, 'second', 'string', ['2-digit', 'numeric'], undefined);\n opt.timeZoneName = GetOption(options, 'timeZoneName', 'string', ['short', 'long'], undefined);\n var dataLocaleData = localeData[dataLocale];\n invariant(!!dataLocaleData, \"Missing locale data for \" + dataLocale);\n var formats = dataLocaleData.formats[calendar];\n // UNSPECCED: IMPLEMENTATION DETAILS\n if (!formats) {\n throw new RangeError(\"Calendar \\\"\" + calendar + \"\\\" is not supported. Try setting \\\"calendar\\\" to 1 of the following: \" + Object.keys(dataLocaleData.formats).join(', '));\n }\n matcher = GetOption(options, 'formatMatcher', 'string', ['basic', 'best fit'], 'best fit');\n var dateStyle = GetOption(options, 'dateStyle', 'string', ['full', 'long', 'medium', 'short'], undefined);\n internalSlots.dateStyle = dateStyle;\n var timeStyle = GetOption(options, 'timeStyle', 'string', ['full', 'long', 'medium', 'short'], undefined);\n internalSlots.timeStyle = timeStyle;\n var bestFormat;\n if (dateStyle === undefined && timeStyle === undefined) {\n if (matcher === 'basic') {\n bestFormat = BasicFormatMatcher(opt, formats);\n }\n else {\n // IMPL DETAILS START\n if (isTimeRelated(opt)) {\n var hc = resolveHourCycle(internalSlots.hourCycle, dataLocaleData.hourCycle, hour12);\n opt.hour12 = hc === 'h11' || hc === 'h12';\n }\n // IMPL DETAILS END\n bestFormat = BestFitFormatMatcher(opt, formats);\n }\n }\n else {\n for (var _i = 0, DATE_TIME_PROPS_1 = DATE_TIME_PROPS; _i < DATE_TIME_PROPS_1.length; _i++) {\n var prop = DATE_TIME_PROPS_1[_i];\n var p = opt[prop];\n if (p !== undefined) {\n throw new TypeError(\"Intl.DateTimeFormat can't set option \" + prop + \" when \" + (dateStyle ? 'dateStyle' : 'timeStyle') + \" is used\");\n }\n }\n bestFormat = DateTimeStyleFormat(dateStyle, timeStyle, dataLocaleData);\n }\n // IMPL DETAIL START\n // For debugging\n internalSlots.format = bestFormat;\n // IMPL DETAIL END\n for (var prop in opt) {\n var p = bestFormat[prop];\n if (p !== undefined) {\n internalSlots[prop] = p;\n }\n }\n var pattern;\n var rangePatterns;\n if (internalSlots.hour !== undefined) {\n var hc = resolveHourCycle(internalSlots.hourCycle, dataLocaleData.hourCycle, hour12);\n internalSlots.hourCycle = hc;\n if (hc === 'h11' || hc === 'h12') {\n pattern = bestFormat.pattern12;\n rangePatterns = bestFormat.rangePatterns12;\n }\n else {\n pattern = bestFormat.pattern;\n rangePatterns = bestFormat.rangePatterns;\n }\n }\n else {\n // @ts-ignore\n internalSlots.hourCycle = undefined;\n pattern = bestFormat.pattern;\n rangePatterns = bestFormat.rangePatterns;\n }\n internalSlots.pattern = pattern;\n internalSlots.rangePatterns = rangePatterns;\n return dtf;\n}\n","/**\n * This follows https://tc39.es/ecma402/#sec-case-sensitivity-and-case-mapping\n * @param str string to convert\n */\nfunction toUpperCase(str) {\n return str.replace(/([a-z])/g, function (_, c) { return c.toUpperCase(); });\n}\nvar NOT_A_Z_REGEX = /[^A-Z]/;\n/**\n * https://tc39.es/ecma402/#sec-iswellformedcurrencycode\n */\nexport function IsWellFormedCurrencyCode(currency) {\n currency = toUpperCase(currency);\n if (currency.length !== 3) {\n return false;\n }\n if (NOT_A_Z_REGEX.test(currency)) {\n return false;\n }\n return true;\n}\n","import { CanonicalizeLocaleList } from '../CanonicalizeLocaleList';\nimport { invariant } from '../utils';\nimport { IsWellFormedCurrencyCode } from '../IsWellFormedCurrencyCode';\nvar UNICODE_REGION_SUBTAG_REGEX = /^([a-z]{2}|[0-9]{3})$/i;\nvar ALPHA_4 = /^[a-z]{4}$/i;\nfunction isUnicodeRegionSubtag(region) {\n return UNICODE_REGION_SUBTAG_REGEX.test(region);\n}\nfunction isUnicodeScriptSubtag(script) {\n return ALPHA_4.test(script);\n}\nexport function CanonicalCodeForDisplayNames(type, code) {\n if (type === 'language') {\n return CanonicalizeLocaleList([code])[0];\n }\n if (type === 'region') {\n if (!isUnicodeRegionSubtag(code)) {\n throw RangeError('invalid region');\n }\n return code.toUpperCase();\n }\n if (type === 'script') {\n if (!isUnicodeScriptSubtag(code)) {\n throw RangeError('invalid script');\n }\n return \"\" + code[0].toUpperCase() + code.slice(1);\n }\n invariant(type === 'currency', 'invalid type');\n if (!IsWellFormedCurrencyCode(code)) {\n throw RangeError('invalid currency');\n }\n return code.toUpperCase();\n}\n","/**\n * https://tc39.es/ecma402/#sec-defaultnumberoption\n * @param val\n * @param min\n * @param max\n * @param fallback\n */\nexport function DefaultNumberOption(val, min, max, fallback) {\n if (val !== undefined) {\n val = Number(val);\n if (isNaN(val) || val < min || val > max) {\n throw new RangeError(val + \" is outside of range [\" + min + \", \" + max + \"]\");\n }\n return Math.floor(val);\n }\n return fallback;\n}\n","/**\n * https://tc39.es/ecma402/#sec-getnumberoption\n * @param options\n * @param property\n * @param min\n * @param max\n * @param fallback\n */\nimport { DefaultNumberOption } from './DefaultNumberOption';\nexport function GetNumberOption(options, property, minimum, maximum, fallback) {\n var val = options[property];\n return DefaultNumberOption(val, minimum, maximum, fallback);\n}\n","/**\n * https://tc39.es/ecma402/#table-sanctioned-simple-unit-identifiers\n */\nexport var SANCTIONED_UNITS = [\n 'angle-degree',\n 'area-acre',\n 'area-hectare',\n 'concentr-percent',\n 'digital-bit',\n 'digital-byte',\n 'digital-gigabit',\n 'digital-gigabyte',\n 'digital-kilobit',\n 'digital-kilobyte',\n 'digital-megabit',\n 'digital-megabyte',\n 'digital-petabyte',\n 'digital-terabit',\n 'digital-terabyte',\n 'duration-day',\n 'duration-hour',\n 'duration-millisecond',\n 'duration-minute',\n 'duration-month',\n 'duration-second',\n 'duration-week',\n 'duration-year',\n 'length-centimeter',\n 'length-foot',\n 'length-inch',\n 'length-kilometer',\n 'length-meter',\n 'length-mile-scandinavian',\n 'length-mile',\n 'length-millimeter',\n 'length-yard',\n 'mass-gram',\n 'mass-kilogram',\n 'mass-ounce',\n 'mass-pound',\n 'mass-stone',\n 'temperature-celsius',\n 'temperature-fahrenheit',\n 'volume-fluid-ounce',\n 'volume-gallon',\n 'volume-liter',\n 'volume-milliliter',\n];\n// In CLDR, the unit name always follows the form `namespace-unit` pattern.\n// For example: `digital-bit` instead of `bit`. This function removes the namespace prefix.\nexport function removeUnitNamespace(unit) {\n return unit.slice(unit.indexOf('-') + 1);\n}\n/**\n * https://tc39.es/ecma402/#table-sanctioned-simple-unit-identifiers\n */\nexport var SIMPLE_UNITS = SANCTIONED_UNITS.map(removeUnitNamespace);\n/**\n * https://tc39.es/ecma402/#sec-issanctionedsimpleunitidentifier\n */\nexport function IsSanctionedSimpleUnitIdentifier(unitIdentifier) {\n return SIMPLE_UNITS.indexOf(unitIdentifier) > -1;\n}\n","import { IsSanctionedSimpleUnitIdentifier } from './IsSanctionedSimpleUnitIdentifier';\n/**\n * This follows https://tc39.es/ecma402/#sec-case-sensitivity-and-case-mapping\n * @param str string to convert\n */\nfunction toLowerCase(str) {\n return str.replace(/([A-Z])/g, function (_, c) { return c.toLowerCase(); });\n}\n/**\n * https://tc39.es/ecma402/#sec-iswellformedunitidentifier\n * @param unit\n */\nexport function IsWellFormedUnitIdentifier(unit) {\n unit = toLowerCase(unit);\n if (IsSanctionedSimpleUnitIdentifier(unit)) {\n return true;\n }\n var units = unit.split('-per-');\n if (units.length !== 2) {\n return false;\n }\n var numerator = units[0], denominator = units[1];\n if (!IsSanctionedSimpleUnitIdentifier(numerator) ||\n !IsSanctionedSimpleUnitIdentifier(denominator)) {\n return false;\n }\n return true;\n}\n","/**\n * The abstract operation ComputeExponentForMagnitude computes an exponent by which to scale a\n * number of the given magnitude (power of ten of the most significant digit) according to the\n * locale and the desired notation (scientific, engineering, or compact).\n */\nexport function ComputeExponentForMagnitude(numberFormat, magnitude, _a) {\n var getInternalSlots = _a.getInternalSlots;\n var internalSlots = getInternalSlots(numberFormat);\n var notation = internalSlots.notation, dataLocaleData = internalSlots.dataLocaleData, numberingSystem = internalSlots.numberingSystem;\n switch (notation) {\n case 'standard':\n return 0;\n case 'scientific':\n return magnitude;\n case 'engineering':\n return Math.floor(magnitude / 3) * 3;\n default: {\n // Let exponent be an implementation- and locale-dependent (ILD) integer by which to scale a\n // number of the given magnitude in compact notation for the current locale.\n var compactDisplay = internalSlots.compactDisplay, style = internalSlots.style, currencyDisplay = internalSlots.currencyDisplay;\n var thresholdMap = void 0;\n if (style === 'currency' && currencyDisplay !== 'name') {\n var currency = dataLocaleData.numbers.currency[numberingSystem] ||\n dataLocaleData.numbers.currency[dataLocaleData.numbers.nu[0]];\n thresholdMap = currency.short;\n }\n else {\n var decimal = dataLocaleData.numbers.decimal[numberingSystem] ||\n dataLocaleData.numbers.decimal[dataLocaleData.numbers.nu[0]];\n thresholdMap = compactDisplay === 'long' ? decimal.long : decimal.short;\n }\n if (!thresholdMap) {\n return 0;\n }\n var num = String(Math.pow(10, magnitude));\n var thresholds = Object.keys(thresholdMap); // TODO: this can be pre-processed\n if (num < thresholds[0]) {\n return 0;\n }\n if (num > thresholds[thresholds.length - 1]) {\n return thresholds[thresholds.length - 1].length - 1;\n }\n var i = thresholds.indexOf(num);\n if (i === -1) {\n return 0;\n }\n // See https://unicode.org/reports/tr35/tr35-numbers.html#Compact_Number_Formats\n // Special handling if the pattern is precisely `0`.\n var magnitudeKey = thresholds[i];\n // TODO: do we need to handle plural here?\n var compactPattern = thresholdMap[magnitudeKey].other;\n if (compactPattern === '0') {\n return 0;\n }\n // Example: in zh-TW, `10000000` maps to `0000萬`. So we need to return 8 - 4 = 4 here.\n return (magnitudeKey.length -\n thresholdMap[magnitudeKey].other.match(/0+/)[0].length);\n }\n }\n}\n","import { repeat, getMagnitude } from '../utils';\nexport function ToRawPrecision(x, minPrecision, maxPrecision) {\n var p = maxPrecision;\n var m;\n var e;\n var xFinal;\n if (x === 0) {\n m = repeat('0', p);\n e = 0;\n xFinal = 0;\n }\n else {\n var xToString = x.toString();\n // If xToString is formatted as scientific notation, the number is either very small or very\n // large. If the precision of the formatted string is lower that requested max precision, we\n // should still infer them from the formatted string, otherwise the formatted result might have\n // precision loss (e.g. 1e41 will not have 0 in every trailing digits).\n var xToStringExponentIndex = xToString.indexOf('e');\n var _a = xToString.split('e'), xToStringMantissa = _a[0], xToStringExponent = _a[1];\n var xToStringMantissaWithoutDecimalPoint = xToStringMantissa.replace('.', '');\n if (xToStringExponentIndex >= 0 &&\n xToStringMantissaWithoutDecimalPoint.length <= p) {\n e = +xToStringExponent;\n m =\n xToStringMantissaWithoutDecimalPoint +\n repeat('0', p - xToStringMantissaWithoutDecimalPoint.length);\n xFinal = x;\n }\n else {\n e = getMagnitude(x);\n var decimalPlaceOffset = e - p + 1;\n // n is the integer containing the required precision digits. To derive the formatted string,\n // we will adjust its decimal place in the logic below.\n var n = Math.round(adjustDecimalPlace(x, decimalPlaceOffset));\n // The rounding caused the change of magnitude, so we should increment `e` by 1.\n if (adjustDecimalPlace(n, p - 1) >= 10) {\n e = e + 1;\n // Divide n by 10 to swallow one precision.\n n = Math.floor(n / 10);\n }\n m = n.toString();\n // Equivalent of n * 10 ** (e - p + 1)\n xFinal = adjustDecimalPlace(n, p - 1 - e);\n }\n }\n var int;\n if (e >= p - 1) {\n m = m + repeat('0', e - p + 1);\n int = e + 1;\n }\n else if (e >= 0) {\n m = m.slice(0, e + 1) + \".\" + m.slice(e + 1);\n int = e + 1;\n }\n else {\n m = \"0.\" + repeat('0', -e - 1) + m;\n int = 1;\n }\n if (m.indexOf('.') >= 0 && maxPrecision > minPrecision) {\n var cut = maxPrecision - minPrecision;\n while (cut > 0 && m[m.length - 1] === '0') {\n m = m.slice(0, -1);\n cut--;\n }\n if (m[m.length - 1] === '.') {\n m = m.slice(0, -1);\n }\n }\n return { formattedString: m, roundedNumber: xFinal, integerDigitsCount: int };\n // x / (10 ** magnitude), but try to preserve as much floating point precision as possible.\n function adjustDecimalPlace(x, magnitude) {\n return magnitude < 0 ? x * Math.pow(10, -magnitude) : x / Math.pow(10, magnitude);\n }\n}\n","import { repeat } from '../utils';\n/**\n * TODO: dedup with intl-pluralrules and support BigInt\n * https://tc39.es/ecma402/#sec-torawfixed\n * @param x a finite non-negative Number or BigInt\n * @param minFraction and integer between 0 and 20\n * @param maxFraction and integer between 0 and 20\n */\nexport function ToRawFixed(x, minFraction, maxFraction) {\n var f = maxFraction;\n var n = Math.round(x * Math.pow(10, f));\n var xFinal = n / Math.pow(10, f);\n // n is a positive integer, but it is possible to be greater than 1e21.\n // In such case we will go the slow path.\n // See also: https://tc39.es/ecma262/#sec-numeric-types-number-tostring\n var m;\n if (n < 1e21) {\n m = n.toString();\n }\n else {\n m = n.toString();\n var _a = m.split('e'), mantissa = _a[0], exponent = _a[1];\n m = mantissa.replace('.', '');\n m = m + repeat('0', Math.max(+exponent - m.length + 1, 0));\n }\n var int;\n if (f !== 0) {\n var k = m.length;\n if (k <= f) {\n var z = repeat('0', f + 1 - k);\n m = z + m;\n k = f + 1;\n }\n var a = m.slice(0, k - f);\n var b = m.slice(k - f);\n m = a + \".\" + b;\n int = a.length;\n }\n else {\n int = m.length;\n }\n var cut = maxFraction - minFraction;\n while (cut > 0 && m[m.length - 1] === '0') {\n m = m.slice(0, -1);\n cut--;\n }\n if (m[m.length - 1] === '.') {\n m = m.slice(0, -1);\n }\n return { formattedString: m, roundedNumber: xFinal, integerDigitsCount: int };\n}\n","import { SameValue } from '../262';\nimport { ToRawPrecision } from './ToRawPrecision';\nimport { repeat } from '../utils';\nimport { ToRawFixed } from './ToRawFixed';\n/**\n * https://tc39.es/ecma402/#sec-formatnumberstring\n */\nexport function FormatNumericToString(intlObject, x) {\n var isNegative = x < 0 || SameValue(x, -0);\n if (isNegative) {\n x = -x;\n }\n var result;\n var rourndingType = intlObject.roundingType;\n switch (rourndingType) {\n case 'significantDigits':\n result = ToRawPrecision(x, intlObject.minimumSignificantDigits, intlObject.maximumSignificantDigits);\n break;\n case 'fractionDigits':\n result = ToRawFixed(x, intlObject.minimumFractionDigits, intlObject.maximumFractionDigits);\n break;\n default:\n result = ToRawPrecision(x, 1, 2);\n if (result.integerDigitsCount > 1) {\n result = ToRawFixed(x, 0, 0);\n }\n break;\n }\n x = result.roundedNumber;\n var string = result.formattedString;\n var int = result.integerDigitsCount;\n var minInteger = intlObject.minimumIntegerDigits;\n if (int < minInteger) {\n var forwardZeros = repeat('0', minInteger - int);\n string = forwardZeros + string;\n }\n if (isNegative) {\n x = -x;\n }\n return { roundedNumber: x, formattedString: string };\n}\n","import { getMagnitude } from '../utils';\nimport { ComputeExponentForMagnitude } from './ComputeExponentForMagnitude';\nimport { FormatNumericToString } from './FormatNumericToString';\n/**\n * The abstract operation ComputeExponent computes an exponent (power of ten) by which to scale x\n * according to the number formatting settings. It handles cases such as 999 rounding up to 1000,\n * requiring a different exponent.\n *\n * NOT IN SPEC: it returns [exponent, magnitude].\n */\nexport function ComputeExponent(numberFormat, x, _a) {\n var getInternalSlots = _a.getInternalSlots;\n if (x === 0) {\n return [0, 0];\n }\n if (x < 0) {\n x = -x;\n }\n var magnitude = getMagnitude(x);\n var exponent = ComputeExponentForMagnitude(numberFormat, magnitude, {\n getInternalSlots: getInternalSlots,\n });\n // Preserve more precision by doing multiplication when exponent is negative.\n x = exponent < 0 ? x * Math.pow(10, -exponent) : x / Math.pow(10, exponent);\n var formatNumberResult = FormatNumericToString(getInternalSlots(numberFormat), x);\n if (formatNumberResult.roundedNumber === 0) {\n return [exponent, magnitude];\n }\n var newMagnitude = getMagnitude(formatNumberResult.roundedNumber);\n if (newMagnitude === magnitude - exponent) {\n return [exponent, magnitude];\n }\n return [\n ComputeExponentForMagnitude(numberFormat, magnitude + 1, {\n getInternalSlots: getInternalSlots,\n }),\n magnitude + 1,\n ];\n}\n","import { HasOwnProperty } from '../262';\n/**\n * https://tc39.es/ecma402/#sec-currencydigits\n */\nexport function CurrencyDigits(c, _a) {\n var currencyDigitsData = _a.currencyDigitsData;\n return HasOwnProperty(currencyDigitsData, c)\n ? currencyDigitsData[c]\n : 2;\n}\n","import { ToRawFixed } from './ToRawFixed';\nimport * as digitMapping from './digit-mapping.json';\n// This is from: unicode-12.1.0/General_Category/Symbol/regex.js\n// IE11 does not support unicode flag, otherwise this is just /\\p{S}/u.\nvar S_UNICODE_REGEX = /[\\$\\+<->\\^`\\|~\\xA2-\\xA6\\xA8\\xA9\\xAC\\xAE-\\xB1\\xB4\\xB8\\xD7\\xF7\\u02C2-\\u02C5\\u02D2-\\u02DF\\u02E5-\\u02EB\\u02ED\\u02EF-\\u02FF\\u0375\\u0384\\u0385\\u03F6\\u0482\\u058D-\\u058F\\u0606-\\u0608\\u060B\\u060E\\u060F\\u06DE\\u06E9\\u06FD\\u06FE\\u07F6\\u07FE\\u07FF\\u09F2\\u09F3\\u09FA\\u09FB\\u0AF1\\u0B70\\u0BF3-\\u0BFA\\u0C7F\\u0D4F\\u0D79\\u0E3F\\u0F01-\\u0F03\\u0F13\\u0F15-\\u0F17\\u0F1A-\\u0F1F\\u0F34\\u0F36\\u0F38\\u0FBE-\\u0FC5\\u0FC7-\\u0FCC\\u0FCE\\u0FCF\\u0FD5-\\u0FD8\\u109E\\u109F\\u1390-\\u1399\\u166D\\u17DB\\u1940\\u19DE-\\u19FF\\u1B61-\\u1B6A\\u1B74-\\u1B7C\\u1FBD\\u1FBF-\\u1FC1\\u1FCD-\\u1FCF\\u1FDD-\\u1FDF\\u1FED-\\u1FEF\\u1FFD\\u1FFE\\u2044\\u2052\\u207A-\\u207C\\u208A-\\u208C\\u20A0-\\u20BF\\u2100\\u2101\\u2103-\\u2106\\u2108\\u2109\\u2114\\u2116-\\u2118\\u211E-\\u2123\\u2125\\u2127\\u2129\\u212E\\u213A\\u213B\\u2140-\\u2144\\u214A-\\u214D\\u214F\\u218A\\u218B\\u2190-\\u2307\\u230C-\\u2328\\u232B-\\u2426\\u2440-\\u244A\\u249C-\\u24E9\\u2500-\\u2767\\u2794-\\u27C4\\u27C7-\\u27E5\\u27F0-\\u2982\\u2999-\\u29D7\\u29DC-\\u29FB\\u29FE-\\u2B73\\u2B76-\\u2B95\\u2B98-\\u2BFF\\u2CE5-\\u2CEA\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFB\\u3004\\u3012\\u3013\\u3020\\u3036\\u3037\\u303E\\u303F\\u309B\\u309C\\u3190\\u3191\\u3196-\\u319F\\u31C0-\\u31E3\\u3200-\\u321E\\u322A-\\u3247\\u3250\\u3260-\\u327F\\u328A-\\u32B0\\u32C0-\\u33FF\\u4DC0-\\u4DFF\\uA490-\\uA4C6\\uA700-\\uA716\\uA720\\uA721\\uA789\\uA78A\\uA828-\\uA82B\\uA836-\\uA839\\uAA77-\\uAA79\\uAB5B\\uFB29\\uFBB2-\\uFBC1\\uFDFC\\uFDFD\\uFE62\\uFE64-\\uFE66\\uFE69\\uFF04\\uFF0B\\uFF1C-\\uFF1E\\uFF3E\\uFF40\\uFF5C\\uFF5E\\uFFE0-\\uFFE6\\uFFE8-\\uFFEE\\uFFFC\\uFFFD]|\\uD800[\\uDD37-\\uDD3F\\uDD79-\\uDD89\\uDD8C-\\uDD8E\\uDD90-\\uDD9B\\uDDA0\\uDDD0-\\uDDFC]|\\uD802[\\uDC77\\uDC78\\uDEC8]|\\uD805\\uDF3F|\\uD807[\\uDFD5-\\uDFF1]|\\uD81A[\\uDF3C-\\uDF3F\\uDF45]|\\uD82F\\uDC9C|\\uD834[\\uDC00-\\uDCF5\\uDD00-\\uDD26\\uDD29-\\uDD64\\uDD6A-\\uDD6C\\uDD83\\uDD84\\uDD8C-\\uDDA9\\uDDAE-\\uDDE8\\uDE00-\\uDE41\\uDE45\\uDF00-\\uDF56]|\\uD835[\\uDEC1\\uDEDB\\uDEFB\\uDF15\\uDF35\\uDF4F\\uDF6F\\uDF89\\uDFA9\\uDFC3]|\\uD836[\\uDC00-\\uDDFF\\uDE37-\\uDE3A\\uDE6D-\\uDE74\\uDE76-\\uDE83\\uDE85\\uDE86]|\\uD838[\\uDD4F\\uDEFF]|\\uD83B[\\uDCAC\\uDCB0\\uDD2E\\uDEF0\\uDEF1]|\\uD83C[\\uDC00-\\uDC2B\\uDC30-\\uDC93\\uDCA0-\\uDCAE\\uDCB1-\\uDCBF\\uDCC1-\\uDCCF\\uDCD1-\\uDCF5\\uDD10-\\uDD6C\\uDD70-\\uDDAC\\uDDE6-\\uDE02\\uDE10-\\uDE3B\\uDE40-\\uDE48\\uDE50\\uDE51\\uDE60-\\uDE65\\uDF00-\\uDFFF]|\\uD83D[\\uDC00-\\uDED5\\uDEE0-\\uDEEC\\uDEF0-\\uDEFA\\uDF00-\\uDF73\\uDF80-\\uDFD8\\uDFE0-\\uDFEB]|\\uD83E[\\uDC00-\\uDC0B\\uDC10-\\uDC47\\uDC50-\\uDC59\\uDC60-\\uDC87\\uDC90-\\uDCAD\\uDD00-\\uDD0B\\uDD0D-\\uDD71\\uDD73-\\uDD76\\uDD7A-\\uDDA2\\uDDA5-\\uDDAA\\uDDAE-\\uDDCA\\uDDCD-\\uDE53\\uDE60-\\uDE6D\\uDE70-\\uDE73\\uDE78-\\uDE7A\\uDE80-\\uDE82\\uDE90-\\uDE95]/;\n// /^\\p{S}/u\nvar CARET_S_UNICODE_REGEX = new RegExp(\"^\" + S_UNICODE_REGEX.source);\n// /\\p{S}$/u\nvar S_DOLLAR_UNICODE_REGEX = new RegExp(S_UNICODE_REGEX.source + \"$\");\nvar CLDR_NUMBER_PATTERN = /[#0](?:[\\.,][#0]+)*/g;\nexport default function formatToParts(numberResult, data, pl, options) {\n var sign = numberResult.sign, exponent = numberResult.exponent, magnitude = numberResult.magnitude;\n var notation = options.notation, style = options.style, numberingSystem = options.numberingSystem;\n var defaultNumberingSystem = data.numbers.nu[0];\n // #region Part 1: partition and interpolate the CLDR number pattern.\n // ----------------------------------------------------------\n var compactNumberPattern = null;\n if (notation === 'compact' && magnitude) {\n compactNumberPattern = getCompactDisplayPattern(numberResult, pl, data, style, options.compactDisplay, options.currencyDisplay, numberingSystem);\n }\n // This is used multiple times\n var nonNameCurrencyPart;\n if (style === 'currency' && options.currencyDisplay !== 'name') {\n var byCurrencyDisplay = data.currencies[options.currency];\n if (byCurrencyDisplay) {\n switch (options.currencyDisplay) {\n case 'code':\n nonNameCurrencyPart = options.currency;\n break;\n case 'symbol':\n nonNameCurrencyPart = byCurrencyDisplay.symbol;\n break;\n default:\n nonNameCurrencyPart = byCurrencyDisplay.narrow;\n break;\n }\n }\n else {\n // Fallback for unknown currency\n nonNameCurrencyPart = options.currency;\n }\n }\n var numberPattern;\n if (!compactNumberPattern) {\n // Note: if the style is unit, or is currency and the currency display is name,\n // its unit parts will be interpolated in part 2. So here we can fallback to decimal.\n if (style === 'decimal' ||\n style === 'unit' ||\n (style === 'currency' && options.currencyDisplay === 'name')) {\n // Shortcut for decimal\n var decimalData = data.numbers.decimal[numberingSystem] ||\n data.numbers.decimal[defaultNumberingSystem];\n numberPattern = getPatternForSign(decimalData.standard, sign);\n }\n else if (style === 'currency') {\n var currencyData = data.numbers.currency[numberingSystem] ||\n data.numbers.currency[defaultNumberingSystem];\n // We replace number pattern part with `0` for easier postprocessing.\n numberPattern = getPatternForSign(currencyData[options.currencySign], sign);\n }\n else {\n // percent\n var percentPattern = data.numbers.percent[numberingSystem] ||\n data.numbers.percent[defaultNumberingSystem];\n numberPattern = getPatternForSign(percentPattern, sign);\n }\n }\n else {\n numberPattern = compactNumberPattern;\n }\n // Extract the decimal number pattern string. It looks like \"#,##0,00\", which will later be\n // used to infer decimal group sizes.\n var decimalNumberPattern = CLDR_NUMBER_PATTERN.exec(numberPattern)[0];\n // Now we start to substitute patterns\n // 1. replace strings like `0` and `#,##0.00` with `{0}`\n // 2. unquote characters (invariant: the quoted characters does not contain the special tokens)\n numberPattern = numberPattern\n .replace(CLDR_NUMBER_PATTERN, '{0}')\n .replace(/'(.)'/g, '$1');\n // Handle currency spacing (both compact and non-compact).\n if (style === 'currency' && options.currencyDisplay !== 'name') {\n var currencyData = data.numbers.currency[numberingSystem] ||\n data.numbers.currency[defaultNumberingSystem];\n // See `currencySpacing` substitution rule in TR-35.\n // Here we always assume the currencyMatch is \"[:^S:]\" and surroundingMatch is \"[:digit:]\".\n //\n // Example 1: for pattern \"#,##0.00¤\" with symbol \"US$\", we replace \"¤\" with the symbol,\n // but insert an extra non-break space before the symbol, because \"[:^S:]\" matches \"U\" in\n // \"US$\" and \"[:digit:]\" matches the latn numbering system digits.\n //\n // Example 2: for pattern \"¤#,##0.00\" with symbol \"US$\", there is no spacing between symbol\n // and number, because `$` does not match \"[:^S:]\".\n //\n // Implementation note: here we do the best effort to infer the insertion.\n // We also assume that `beforeInsertBetween` and `afterInsertBetween` will never be `;`.\n var afterCurrency = currencyData.currencySpacing.afterInsertBetween;\n if (afterCurrency && !S_DOLLAR_UNICODE_REGEX.test(nonNameCurrencyPart)) {\n numberPattern = numberPattern.replace('¤{0}', \"\\u00A4\" + afterCurrency + \"{0}\");\n }\n var beforeCurrency = currencyData.currencySpacing.beforeInsertBetween;\n if (beforeCurrency && !CARET_S_UNICODE_REGEX.test(nonNameCurrencyPart)) {\n numberPattern = numberPattern.replace('{0}¤', \"{0}\" + beforeCurrency + \"\\u00A4\");\n }\n }\n // The following tokens are special: `{0}`, `¤`, `%`, `-`, `+`, `{c:...}.\n var numberPatternParts = numberPattern.split(/({c:[^}]+}|\\{0\\}|[¤%\\-\\+])/g);\n var numberParts = [];\n var symbols = data.numbers.symbols[numberingSystem] ||\n data.numbers.symbols[defaultNumberingSystem];\n for (var _i = 0, numberPatternParts_1 = numberPatternParts; _i < numberPatternParts_1.length; _i++) {\n var part = numberPatternParts_1[_i];\n if (!part) {\n continue;\n }\n switch (part) {\n case '{0}': {\n // We only need to handle scientific and engineering notation here.\n numberParts.push.apply(numberParts, paritionNumberIntoParts(symbols, numberResult, notation, exponent, numberingSystem, \n // If compact number pattern exists, do not insert group separators.\n !compactNumberPattern && options.useGrouping, decimalNumberPattern));\n break;\n }\n case '-':\n numberParts.push({ type: 'minusSign', value: symbols.minusSign });\n break;\n case '+':\n numberParts.push({ type: 'plusSign', value: symbols.plusSign });\n break;\n case '%':\n numberParts.push({ type: 'percentSign', value: symbols.percentSign });\n break;\n case '¤':\n // Computed above when handling currency spacing.\n numberParts.push({ type: 'currency', value: nonNameCurrencyPart });\n break;\n default:\n if (/^\\{c:/.test(part)) {\n numberParts.push({\n type: 'compact',\n value: part.substring(3, part.length - 1),\n });\n }\n else {\n // literal\n numberParts.push({ type: 'literal', value: part });\n }\n break;\n }\n }\n // #endregion\n // #region Part 2: interpolate unit pattern if necessary.\n // ----------------------------------------------\n switch (style) {\n case 'currency': {\n // `currencyDisplay: 'name'` has similar pattern handling as units.\n if (options.currencyDisplay === 'name') {\n var unitPattern = (data.numbers.currency[numberingSystem] ||\n data.numbers.currency[defaultNumberingSystem]).unitPattern;\n // Select plural\n var unitName = void 0;\n var currencyNameData = data.currencies[options.currency];\n if (currencyNameData) {\n unitName = selectPlural(pl, numberResult.roundedNumber * Math.pow(10, exponent), currencyNameData.displayName);\n }\n else {\n // Fallback for unknown currency\n unitName = options.currency;\n }\n // Do {0} and {1} substitution\n var unitPatternParts = unitPattern.split(/(\\{[01]\\})/g);\n var result = [];\n for (var _a = 0, unitPatternParts_1 = unitPatternParts; _a < unitPatternParts_1.length; _a++) {\n var part = unitPatternParts_1[_a];\n switch (part) {\n case '{0}':\n result.push.apply(result, numberParts);\n break;\n case '{1}':\n result.push({ type: 'currency', value: unitName });\n break;\n default:\n if (part) {\n result.push({ type: 'literal', value: part });\n }\n break;\n }\n }\n return result;\n }\n else {\n return numberParts;\n }\n }\n case 'unit': {\n var unit = options.unit, unitDisplay = options.unitDisplay;\n var unitData = data.units.simple[unit];\n var unitPattern = void 0;\n if (unitData) {\n // Simple unit pattern\n unitPattern = selectPlural(pl, numberResult.roundedNumber * Math.pow(10, exponent), data.units.simple[unit][unitDisplay]);\n }\n else {\n // See: http://unicode.org/reports/tr35/tr35-general.html#perUnitPatterns\n // If cannot find unit in the simple pattern, it must be \"per\" compound pattern.\n // Implementation note: we are not following TR-35 here because we need to format to parts!\n var _b = unit.split('-per-'), numeratorUnit = _b[0], denominatorUnit = _b[1];\n unitData = data.units.simple[numeratorUnit];\n var numeratorUnitPattern = selectPlural(pl, numberResult.roundedNumber * Math.pow(10, exponent), data.units.simple[numeratorUnit][unitDisplay]);\n var perUnitPattern = data.units.simple[denominatorUnit].perUnit[unitDisplay];\n if (perUnitPattern) {\n // perUnitPattern exists, combine it with numeratorUnitPattern\n unitPattern = perUnitPattern.replace('{0}', numeratorUnitPattern);\n }\n else {\n // get compoundUnit pattern (e.g. \"{0} per {1}\"), repalce {0} with numerator pattern and {1} with\n // the denominator pattern in singular form.\n var perPattern = data.units.compound.per[unitDisplay];\n var denominatorPattern = selectPlural(pl, 1, data.units.simple[denominatorUnit][unitDisplay]);\n unitPattern = unitPattern = perPattern\n .replace('{0}', numeratorUnitPattern)\n .replace('{1}', denominatorPattern.replace('{0}', ''));\n }\n }\n var result = [];\n // We need spacing around \"{0}\" because they are not treated as \"unit\" parts, but \"literal\".\n for (var _c = 0, _d = unitPattern.split(/(\\s*\\{0\\}\\s*)/); _c < _d.length; _c++) {\n var part = _d[_c];\n var interpolateMatch = /^(\\s*)\\{0\\}(\\s*)$/.exec(part);\n if (interpolateMatch) {\n // Space before \"{0}\"\n if (interpolateMatch[1]) {\n result.push({ type: 'literal', value: interpolateMatch[1] });\n }\n // \"{0}\" itself\n result.push.apply(result, numberParts);\n // Space after \"{0}\"\n if (interpolateMatch[2]) {\n result.push({ type: 'literal', value: interpolateMatch[2] });\n }\n }\n else if (part) {\n result.push({ type: 'unit', value: part });\n }\n }\n return result;\n }\n default:\n return numberParts;\n }\n // #endregion\n}\n// A subset of https://tc39.es/ecma402/#sec-partitionnotationsubpattern\n// Plus the exponent parts handling.\nfunction paritionNumberIntoParts(symbols, numberResult, notation, exponent, numberingSystem, useGrouping, \n/**\n * This is the decimal number pattern without signs or symbols.\n * It is used to infer the group size when `useGrouping` is true.\n *\n * A typical value looks like \"#,##0.00\" (primary group size is 3).\n * Some locales like Hindi has secondary group size of 2 (e.g. \"#,##,##0.00\").\n */\ndecimalNumberPattern) {\n var result = [];\n // eslint-disable-next-line prefer-const\n var n = numberResult.formattedString, x = numberResult.roundedNumber;\n if (isNaN(x)) {\n return [{ type: 'nan', value: n }];\n }\n else if (!isFinite(x)) {\n return [{ type: 'infinity', value: n }];\n }\n var digitReplacementTable = digitMapping[numberingSystem];\n if (digitReplacementTable) {\n n = n.replace(/\\d/g, function (digit) { return digitReplacementTable[+digit] || digit; });\n }\n // TODO: Else use an implementation dependent algorithm to map n to the appropriate\n // representation of n in the given numbering system.\n var decimalSepIndex = n.indexOf('.');\n var integer;\n var fraction;\n if (decimalSepIndex > 0) {\n integer = n.slice(0, decimalSepIndex);\n fraction = n.slice(decimalSepIndex + 1);\n }\n else {\n integer = n;\n }\n // #region Grouping integer digits\n // The weird compact and x >= 10000 check is to ensure consistency with Node.js and Chrome.\n // Note that `de` does not have compact form for thousands, but Node.js does not insert grouping separator\n // unless the rounded number is greater than 10000:\n // NumberFormat('de', {notation: 'compact', compactDisplay: 'short'}).format(1234) //=> \"1234\"\n // NumberFormat('de').format(1234) //=> \"1.234\"\n if (useGrouping && (notation !== 'compact' || x >= 10000)) {\n var groupSepSymbol = symbols.group;\n var groups = [];\n // > There may be two different grouping sizes: The primary grouping size used for the least\n // > significant integer group, and the secondary grouping size used for more significant groups.\n // > If a pattern contains multiple grouping separators, the interval between the last one and the\n // > end of the integer defines the primary grouping size, and the interval between the last two\n // > defines the secondary grouping size. All others are ignored.\n var integerNumberPattern = decimalNumberPattern.split('.')[0];\n var patternGroups = integerNumberPattern.split(',');\n var primaryGroupingSize = 3;\n var secondaryGroupingSize = 3;\n if (patternGroups.length > 1) {\n primaryGroupingSize = patternGroups[patternGroups.length - 1].length;\n }\n if (patternGroups.length > 2) {\n secondaryGroupingSize = patternGroups[patternGroups.length - 2].length;\n }\n var i = integer.length - primaryGroupingSize;\n if (i > 0) {\n // Slice the least significant integer group\n groups.push(integer.slice(i, i + primaryGroupingSize));\n // Then iteratively push the more signicant groups\n // TODO: handle surrogate pairs in some numbering system digits\n for (i -= secondaryGroupingSize; i > 0; i -= secondaryGroupingSize) {\n groups.push(integer.slice(i, i + secondaryGroupingSize));\n }\n groups.push(integer.slice(0, i + secondaryGroupingSize));\n }\n else {\n groups.push(integer);\n }\n while (groups.length > 0) {\n var integerGroup = groups.pop();\n result.push({ type: 'integer', value: integerGroup });\n if (groups.length > 0) {\n result.push({ type: 'group', value: groupSepSymbol });\n }\n }\n }\n else {\n result.push({ type: 'integer', value: integer });\n }\n // #endregion\n if (fraction !== undefined) {\n result.push({ type: 'decimal', value: symbols.decimal }, { type: 'fraction', value: fraction });\n }\n if ((notation === 'scientific' || notation === 'engineering') &&\n isFinite(x)) {\n result.push({ type: 'exponentSeparator', value: symbols.exponential });\n if (exponent < 0) {\n result.push({ type: 'exponentMinusSign', value: symbols.minusSign });\n exponent = -exponent;\n }\n var exponentResult = ToRawFixed(exponent, 0, 0);\n result.push({\n type: 'exponentInteger',\n value: exponentResult.formattedString,\n });\n }\n return result;\n}\nfunction getPatternForSign(pattern, sign) {\n if (pattern.indexOf(';') < 0) {\n pattern = pattern + \";-\" + pattern;\n }\n var _a = pattern.split(';'), zeroPattern = _a[0], negativePattern = _a[1];\n switch (sign) {\n case 0:\n return zeroPattern;\n case -1:\n return negativePattern;\n default:\n return negativePattern.indexOf('-') >= 0\n ? negativePattern.replace(/-/g, '+')\n : \"+\" + zeroPattern;\n }\n}\n// Find the CLDR pattern for compact notation based on the magnitude of data and style.\n//\n// Example return value: \"¤ {c:laki}000;¤{c:laki} -0\" (`sw` locale):\n// - Notice the `{c:...}` token that wraps the compact literal.\n// - The consecutive zeros are normalized to single zero to match CLDR_NUMBER_PATTERN.\n//\n// Returning null means the compact display pattern cannot be found.\nfunction getCompactDisplayPattern(numberResult, pl, data, style, compactDisplay, currencyDisplay, numberingSystem) {\n var _a;\n var roundedNumber = numberResult.roundedNumber, sign = numberResult.sign, magnitude = numberResult.magnitude;\n var magnitudeKey = String(Math.pow(10, magnitude));\n var defaultNumberingSystem = data.numbers.nu[0];\n var pattern;\n if (style === 'currency' && currencyDisplay !== 'name') {\n var byNumberingSystem = data.numbers.currency;\n var currencyData = byNumberingSystem[numberingSystem] ||\n byNumberingSystem[defaultNumberingSystem];\n // NOTE: compact notation ignores currencySign!\n var compactPluralRules = (_a = currencyData.short) === null || _a === void 0 ? void 0 : _a[magnitudeKey];\n if (!compactPluralRules) {\n return null;\n }\n pattern = selectPlural(pl, roundedNumber, compactPluralRules);\n }\n else {\n var byNumberingSystem = data.numbers.decimal;\n var byCompactDisplay = byNumberingSystem[numberingSystem] ||\n byNumberingSystem[defaultNumberingSystem];\n var compactPlaralRule = byCompactDisplay[compactDisplay][magnitudeKey];\n if (!compactPlaralRule) {\n return null;\n }\n pattern = selectPlural(pl, roundedNumber, compactPlaralRule);\n }\n // See https://unicode.org/reports/tr35/tr35-numbers.html#Compact_Number_Formats\n // > If the value is precisely “0”, either explicit or defaulted, then the normal number format\n // > pattern for that sort of object is supplied.\n if (pattern === '0') {\n return null;\n }\n pattern = getPatternForSign(pattern, sign)\n // Extract compact literal from the pattern\n .replace(/([^\\s;\\-\\+\\d¤]+)/g, '{c:$1}')\n // We replace one or more zeros with a single zero so it matches `CLDR_NUMBER_PATTERN`.\n .replace(/0+/, '0');\n return pattern;\n}\nfunction selectPlural(pl, x, rules) {\n return rules[pl.select(x)] || rules.other;\n}\n","import { FormatNumericToString } from './FormatNumericToString';\nimport { SameValue } from '../262';\nimport { ComputeExponent } from './ComputeExponent';\nimport formatToParts from './format_to_parts';\n/**\n * https://tc39.es/ecma402/#sec-formatnumberstring\n */\nexport function PartitionNumberPattern(numberFormat, x, _a) {\n var _b;\n var getInternalSlots = _a.getInternalSlots;\n var internalSlots = getInternalSlots(numberFormat);\n var pl = internalSlots.pl, dataLocaleData = internalSlots.dataLocaleData, numberingSystem = internalSlots.numberingSystem;\n var symbols = dataLocaleData.numbers.symbols[numberingSystem] ||\n dataLocaleData.numbers.symbols[dataLocaleData.numbers.nu[0]];\n var magnitude = 0;\n var exponent = 0;\n var n;\n if (isNaN(x)) {\n n = symbols.nan;\n }\n else if (!isFinite(x)) {\n n = symbols.infinity;\n }\n else {\n if (internalSlots.style === 'percent') {\n x *= 100;\n }\n _b = ComputeExponent(numberFormat, x, {\n getInternalSlots: getInternalSlots,\n }), exponent = _b[0], magnitude = _b[1];\n // Preserve more precision by doing multiplication when exponent is negative.\n x = exponent < 0 ? x * Math.pow(10, -exponent) : x / Math.pow(10, exponent);\n var formatNumberResult = FormatNumericToString(internalSlots, x);\n n = formatNumberResult.formattedString;\n x = formatNumberResult.roundedNumber;\n }\n // Based on https://tc39.es/ecma402/#sec-getnumberformatpattern\n // We need to do this before `x` is rounded.\n var sign;\n var signDisplay = internalSlots.signDisplay;\n switch (signDisplay) {\n case 'never':\n sign = 0;\n break;\n case 'auto':\n if (SameValue(x, 0) || x > 0 || isNaN(x)) {\n sign = 0;\n }\n else {\n sign = -1;\n }\n break;\n case 'always':\n if (SameValue(x, 0) || x > 0 || isNaN(x)) {\n sign = 1;\n }\n else {\n sign = -1;\n }\n break;\n default:\n // x === 0 -> x is 0 or x is -0\n if (x === 0 || isNaN(x)) {\n sign = 0;\n }\n else if (x > 0) {\n sign = 1;\n }\n else {\n sign = -1;\n }\n }\n return formatToParts({ roundedNumber: x, formattedString: n, exponent: exponent, magnitude: magnitude, sign: sign }, internalSlots.dataLocaleData, pl, internalSlots);\n}\n","import { PartitionNumberPattern } from './PartitionNumberPattern';\nimport { ArrayCreate } from '../262';\nexport function FormatNumericToParts(nf, x, implDetails) {\n var parts = PartitionNumberPattern(nf, x, implDetails);\n var result = ArrayCreate(0);\n for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {\n var part = parts_1[_i];\n result.push({\n type: part.type,\n value: part.value,\n });\n }\n return result;\n}\n","import { GetOption } from '../GetOption';\nimport { IsWellFormedCurrencyCode } from '../IsWellFormedCurrencyCode';\nimport { IsWellFormedUnitIdentifier } from '../IsWellFormedUnitIdentifier';\n/**\n * https://tc39.es/ecma402/#sec-setnumberformatunitoptions\n */\nexport function SetNumberFormatUnitOptions(nf, options, _a) {\n if (options === void 0) { options = Object.create(null); }\n var getInternalSlots = _a.getInternalSlots;\n var internalSlots = getInternalSlots(nf);\n var style = GetOption(options, 'style', 'string', ['decimal', 'percent', 'currency', 'unit'], 'decimal');\n internalSlots.style = style;\n var currency = GetOption(options, 'currency', 'string', undefined, undefined);\n if (currency !== undefined && !IsWellFormedCurrencyCode(currency)) {\n throw RangeError('Malformed currency code');\n }\n if (style === 'currency' && currency === undefined) {\n throw TypeError('currency cannot be undefined');\n }\n var currencyDisplay = GetOption(options, 'currencyDisplay', 'string', ['code', 'symbol', 'narrowSymbol', 'name'], 'symbol');\n var currencySign = GetOption(options, 'currencySign', 'string', ['standard', 'accounting'], 'standard');\n var unit = GetOption(options, 'unit', 'string', undefined, undefined);\n if (unit !== undefined && !IsWellFormedUnitIdentifier(unit)) {\n throw RangeError('Invalid unit argument for Intl.NumberFormat()');\n }\n if (style === 'unit' && unit === undefined) {\n throw TypeError('unit cannot be undefined');\n }\n var unitDisplay = GetOption(options, 'unitDisplay', 'string', ['short', 'narrow', 'long'], 'short');\n if (style === 'currency') {\n internalSlots.currency = currency.toUpperCase();\n internalSlots.currencyDisplay = currencyDisplay;\n internalSlots.currencySign = currencySign;\n }\n if (style === 'unit') {\n internalSlots.unit = unit;\n internalSlots.unitDisplay = unitDisplay;\n }\n}\n","import { GetNumberOption } from '../GetNumberOption';\nimport { DefaultNumberOption } from '../DefaultNumberOption';\n/**\n * https://tc39.es/ecma402/#sec-setnfdigitoptions\n */\nexport function SetNumberFormatDigitOptions(internalSlots, opts, mnfdDefault, mxfdDefault, notation) {\n var mnid = GetNumberOption(opts, 'minimumIntegerDigits', 1, 21, 1);\n var mnfd = opts.minimumFractionDigits;\n var mxfd = opts.maximumFractionDigits;\n var mnsd = opts.minimumSignificantDigits;\n var mxsd = opts.maximumSignificantDigits;\n internalSlots.minimumIntegerDigits = mnid;\n if (mnsd !== undefined || mxsd !== undefined) {\n internalSlots.roundingType = 'significantDigits';\n mnsd = DefaultNumberOption(mnsd, 1, 21, 1);\n mxsd = DefaultNumberOption(mxsd, mnsd, 21, 21);\n internalSlots.minimumSignificantDigits = mnsd;\n internalSlots.maximumSignificantDigits = mxsd;\n }\n else if (mnfd !== undefined || mxfd !== undefined) {\n internalSlots.roundingType = 'fractionDigits';\n mnfd = DefaultNumberOption(mnfd, 0, 20, mnfdDefault);\n var mxfdActualDefault = Math.max(mnfd, mxfdDefault);\n mxfd = DefaultNumberOption(mxfd, mnfd, 20, mxfdActualDefault);\n internalSlots.minimumFractionDigits = mnfd;\n internalSlots.maximumFractionDigits = mxfd;\n }\n else if (notation === 'compact') {\n internalSlots.roundingType = 'compactRounding';\n }\n else {\n internalSlots.roundingType = 'fractionDigits';\n internalSlots.minimumFractionDigits = mnfdDefault;\n internalSlots.maximumFractionDigits = mxfdDefault;\n }\n}\n","import { CanonicalizeLocaleList } from '../CanonicalizeLocaleList';\nimport { ToObject } from '../262';\nimport { GetOption } from '../GetOption';\nimport { ResolveLocale } from '../ResolveLocale';\nimport { SetNumberFormatUnitOptions } from './SetNumberFormatUnitOptions';\nimport { CurrencyDigits } from './CurrencyDigits';\nimport { SetNumberFormatDigitOptions } from './SetNumberFormatDigitOptions';\nimport { invariant } from '../utils';\n/**\n * Chop off the unicode extension from the locale string.\n */\nfunction removeUnicodeExtensionFromLocale(canonicalLocale) {\n var extensionIndex = canonicalLocale.indexOf('-u-');\n return extensionIndex >= 0\n ? canonicalLocale.slice(0, extensionIndex)\n : canonicalLocale;\n}\n/**\n * https://tc39.es/ecma402/#sec-initializenumberformat\n */\nexport function InitializeNumberFormat(nf, locales, opts, _a) {\n var getInternalSlots = _a.getInternalSlots, localeData = _a.localeData, availableLocales = _a.availableLocales, numberingSystemNames = _a.numberingSystemNames, getDefaultLocale = _a.getDefaultLocale, currencyDigitsData = _a.currencyDigitsData;\n // @ts-ignore\n var requestedLocales = CanonicalizeLocaleList(locales);\n var options = opts === undefined ? Object.create(null) : ToObject(opts);\n var opt = Object.create(null);\n var matcher = GetOption(options, 'localeMatcher', 'string', ['lookup', 'best fit'], 'best fit');\n opt.localeMatcher = matcher;\n var numberingSystem = GetOption(options, 'numberingSystem', 'string', undefined, undefined);\n if (numberingSystem !== undefined &&\n numberingSystemNames.indexOf(numberingSystem) < 0) {\n // 8.a. If numberingSystem does not match the Unicode Locale Identifier type nonterminal,\n // throw a RangeError exception.\n throw RangeError(\"Invalid numberingSystems: \" + numberingSystem);\n }\n opt.nu = numberingSystem;\n var r = ResolveLocale(availableLocales, requestedLocales, opt, \n // [[RelevantExtensionKeys]] slot, which is a constant\n ['nu'], localeData, getDefaultLocale);\n var dataLocaleData = localeData[removeUnicodeExtensionFromLocale(r.locale)];\n invariant(!!dataLocaleData, \"Missing locale data for \" + r.locale);\n var internalSlots = getInternalSlots(nf);\n internalSlots.locale = r.locale;\n internalSlots.dataLocale = r.dataLocale;\n internalSlots.numberingSystem = r.nu;\n internalSlots.dataLocaleData = dataLocaleData;\n SetNumberFormatUnitOptions(nf, options, { getInternalSlots: getInternalSlots });\n var style = internalSlots.style;\n var mnfdDefault;\n var mxfdDefault;\n if (style === 'currency') {\n var currency = internalSlots.currency;\n var cDigits = CurrencyDigits(currency, { currencyDigitsData: currencyDigitsData });\n mnfdDefault = cDigits;\n mxfdDefault = cDigits;\n }\n else {\n mnfdDefault = 0;\n mxfdDefault = style === 'percent' ? 0 : 3;\n }\n var notation = GetOption(options, 'notation', 'string', ['standard', 'scientific', 'engineering', 'compact'], 'standard');\n internalSlots.notation = notation;\n SetNumberFormatDigitOptions(internalSlots, options, mnfdDefault, mxfdDefault, notation);\n var compactDisplay = GetOption(options, 'compactDisplay', 'string', ['short', 'long'], 'short');\n if (notation === 'compact') {\n internalSlots.compactDisplay = compactDisplay;\n }\n var useGrouping = GetOption(options, 'useGrouping', 'boolean', undefined, true);\n internalSlots.useGrouping = useGrouping;\n var signDisplay = GetOption(options, 'signDisplay', 'string', ['auto', 'never', 'always', 'exceptZero'], 'auto');\n internalSlots.signDisplay = signDisplay;\n return nf;\n}\n","import { invariant } from '../utils';\nimport { ToNumber } from '../262';\n/**\n * http://ecma-international.org/ecma-402/7.0/index.html#sec-getoperands\n * @param s\n */\nexport function GetOperands(s) {\n invariant(typeof s === 'string', \"GetOperands should have been called with a string\");\n var n = ToNumber(s);\n invariant(isFinite(n), 'n should be finite');\n var dp = s.indexOf('.');\n var iv;\n var f;\n var v;\n var fv = '';\n if (dp === -1) {\n iv = n;\n f = 0;\n v = 0;\n }\n else {\n iv = s.slice(0, dp);\n fv = s.slice(dp, s.length);\n f = ToNumber(fv);\n v = fv.length;\n }\n var i = Math.abs(ToNumber(iv));\n var w;\n var t;\n if (f !== 0) {\n var ft = fv.replace(/0+$/, '');\n w = ft.length;\n t = ToNumber(ft);\n }\n else {\n w = 0;\n t = 0;\n }\n return {\n Number: n,\n IntegerDigits: i,\n NumberOfFractionDigits: v,\n NumberOfFractionDigitsWithoutTrailing: w,\n FractionDigits: f,\n FractionDigitsWithoutTrailing: t,\n };\n}\n","import { CanonicalizeLocaleList } from '../CanonicalizeLocaleList';\nimport { ToObject } from '../262';\nimport { GetOption } from '../GetOption';\nimport { SetNumberFormatDigitOptions } from '../NumberFormat/SetNumberFormatDigitOptions';\nimport { ResolveLocale } from '../ResolveLocale';\nexport function InitializePluralRules(pl, locales, options, _a) {\n var availableLocales = _a.availableLocales, relevantExtensionKeys = _a.relevantExtensionKeys, localeData = _a.localeData, getDefaultLocale = _a.getDefaultLocale, getInternalSlots = _a.getInternalSlots;\n var requestedLocales = CanonicalizeLocaleList(locales);\n var opt = Object.create(null);\n var opts = options === undefined ? Object.create(null) : ToObject(options);\n var internalSlots = getInternalSlots(pl);\n internalSlots.initializedPluralRules = true;\n var matcher = GetOption(opts, 'localeMatcher', 'string', ['best fit', 'lookup'], 'best fit');\n opt.localeMatcher = matcher;\n internalSlots.type = GetOption(opts, 'type', 'string', ['cardinal', 'ordinal'], 'cardinal');\n SetNumberFormatDigitOptions(internalSlots, opts, 0, 3, 'standard');\n var r = ResolveLocale(availableLocales, requestedLocales, opt, relevantExtensionKeys, localeData, getDefaultLocale);\n internalSlots.locale = r.locale;\n return pl;\n}\n","import { invariant } from '../utils';\nimport { Type } from '../262';\nimport { FormatNumericToString } from '../NumberFormat/FormatNumericToString';\nimport { GetOperands } from './GetOperands';\n/**\n * http://ecma-international.org/ecma-402/7.0/index.html#sec-resolveplural\n * @param pl\n * @param n\n * @param PluralRuleSelect Has to pass in bc it's implementation-specific\n */\nexport function ResolvePlural(pl, n, _a) {\n var getInternalSlots = _a.getInternalSlots, PluralRuleSelect = _a.PluralRuleSelect;\n var internalSlots = getInternalSlots(pl);\n invariant(Type(internalSlots) === 'Object', 'pl has to be an object');\n invariant('initializedPluralRules' in internalSlots, 'pluralrules must be initialized');\n invariant(Type(n) === 'Number', 'n must be a number');\n if (!isFinite(n)) {\n return 'other';\n }\n var locale = internalSlots.locale, type = internalSlots.type;\n var res = FormatNumericToString(internalSlots, n);\n var s = res.formattedString;\n var operands = GetOperands(s);\n return PluralRuleSelect(locale, type, n, operands);\n}\n","import { invariant } from '../utils';\nimport { Type } from '../262';\n/**\n * https://tc39.es/proposal-intl-relative-time/#sec-singularrelativetimeunit\n * @param unit\n */\nexport function SingularRelativeTimeUnit(unit) {\n invariant(Type(unit) === 'String', 'unit must be a string');\n if (unit === 'seconds')\n return 'second';\n if (unit === 'minutes')\n return 'minute';\n if (unit === 'hours')\n return 'hour';\n if (unit === 'days')\n return 'day';\n if (unit === 'weeks')\n return 'week';\n if (unit === 'months')\n return 'month';\n if (unit === 'quarters')\n return 'quarter';\n if (unit === 'years')\n return 'year';\n if (unit !== 'second' &&\n unit !== 'minute' &&\n unit !== 'hour' &&\n unit !== 'day' &&\n unit !== 'week' &&\n unit !== 'month' &&\n unit !== 'quarter' &&\n unit !== 'year') {\n throw new RangeError('invalid unit');\n }\n return unit;\n}\n","import { PartitionPattern } from '../PartitionPattern';\nimport { invariant } from '../utils';\nexport function MakePartsList(pattern, unit, parts) {\n var patternParts = PartitionPattern(pattern);\n var result = [];\n for (var _i = 0, patternParts_1 = patternParts; _i < patternParts_1.length; _i++) {\n var patternPart = patternParts_1[_i];\n if (patternPart.type === 'literal') {\n result.push({\n type: 'literal',\n value: patternPart.value,\n });\n }\n else {\n invariant(patternPart.type === '0', \"Malformed pattern \" + pattern);\n for (var _a = 0, parts_1 = parts; _a < parts_1.length; _a++) {\n var part = parts_1[_a];\n result.push({\n type: part.type,\n value: part.value,\n unit: unit,\n });\n }\n }\n }\n return result;\n}\n","import { invariant } from '../utils';\nimport { SingularRelativeTimeUnit } from './SingularRelativeTimeUnit';\nimport { MakePartsList } from './MakePartsList';\nimport { ToString, Type, SameValue } from '../262';\nexport function PartitionRelativeTimePattern(rtf, value, unit, _a) {\n var getInternalSlots = _a.getInternalSlots;\n invariant(Type(value) === 'Number', \"value must be number, instead got \" + typeof value, TypeError);\n invariant(Type(unit) === 'String', \"unit must be number, instead got \" + typeof value, TypeError);\n if (isNaN(value) || !isFinite(value)) {\n throw new RangeError(\"Invalid value \" + value);\n }\n var resolvedUnit = SingularRelativeTimeUnit(unit);\n var _b = getInternalSlots(rtf), fields = _b.fields, style = _b.style, numeric = _b.numeric, pluralRules = _b.pluralRules, numberFormat = _b.numberFormat;\n var entry = resolvedUnit;\n if (style === 'short') {\n entry = resolvedUnit + \"-short\";\n }\n else if (style === 'narrow') {\n entry = resolvedUnit + \"-narrow\";\n }\n if (!(entry in fields)) {\n entry = resolvedUnit;\n }\n var patterns = fields[entry];\n if (numeric === 'auto') {\n if (ToString(value) in patterns) {\n return [\n {\n type: 'literal',\n value: patterns[ToString(value)],\n },\n ];\n }\n }\n var tl = 'future';\n if (SameValue(value, -0) || value < 0) {\n tl = 'past';\n }\n var po = patterns[tl];\n var fv = typeof numberFormat.formatToParts === 'function'\n ? numberFormat.formatToParts(Math.abs(value))\n : // TODO: If formatToParts is not supported, we assume the whole formatted\n // number is a part\n [\n {\n type: 'literal',\n value: numberFormat.format(Math.abs(value)),\n unit: unit,\n },\n ];\n var pr = pluralRules.select(value);\n var pattern = po[pr];\n return MakePartsList(pattern, resolvedUnit, fv);\n}\n","import { PartitionRelativeTimePattern } from './PartitionRelativeTimePattern';\nexport function FormatRelativeTime(rtf, value, unit, implDetails) {\n var parts = PartitionRelativeTimePattern(rtf, value, unit, implDetails);\n var result = '';\n for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {\n var part = parts_1[_i];\n result += part.value;\n }\n return result;\n}\n","import { PartitionRelativeTimePattern } from './PartitionRelativeTimePattern';\nimport { ArrayCreate } from '../262';\nexport function FormatRelativeTimeToParts(rtf, value, unit, implDetails) {\n var parts = PartitionRelativeTimePattern(rtf, value, unit, implDetails);\n var result = ArrayCreate(0);\n for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {\n var part = parts_1[_i];\n var o = {\n type: part.type,\n value: part.value,\n };\n if ('unit' in part) {\n o.unit = part.unit;\n }\n result.push(o);\n }\n return result;\n}\n","import { CanonicalizeLocaleList } from '../CanonicalizeLocaleList';\nimport { ToObject } from '../262';\nimport { GetOption } from '../GetOption';\nimport { ResolveLocale } from '../ResolveLocale';\nimport { invariant } from '../utils';\nvar NUMBERING_SYSTEM_REGEX = /^[a-z0-9]{3,8}(-[a-z0-9]{3,8})*$/i;\nexport function InitializeRelativeTimeFormat(rtf, locales, options, _a) {\n var getInternalSlots = _a.getInternalSlots, availableLocales = _a.availableLocales, relevantExtensionKeys = _a.relevantExtensionKeys, localeData = _a.localeData, getDefaultLocale = _a.getDefaultLocale;\n var internalSlots = getInternalSlots(rtf);\n internalSlots.initializedRelativeTimeFormat = true;\n var requestedLocales = CanonicalizeLocaleList(locales);\n var opt = Object.create(null);\n var opts = options === undefined ? Object.create(null) : ToObject(options);\n var matcher = GetOption(opts, 'localeMatcher', 'string', ['best fit', 'lookup'], 'best fit');\n opt.localeMatcher = matcher;\n var numberingSystem = GetOption(opts, 'numberingSystem', 'string', undefined, undefined);\n if (numberingSystem !== undefined) {\n if (!NUMBERING_SYSTEM_REGEX.test(numberingSystem)) {\n throw new RangeError(\"Invalid numbering system \" + numberingSystem);\n }\n }\n opt.nu = numberingSystem;\n var r = ResolveLocale(availableLocales, requestedLocales, opt, relevantExtensionKeys, localeData, getDefaultLocale);\n var locale = r.locale, nu = r.nu;\n internalSlots.locale = locale;\n internalSlots.style = GetOption(opts, 'style', 'string', ['long', 'narrow', 'short'], 'long');\n internalSlots.numeric = GetOption(opts, 'numeric', 'string', ['always', 'auto'], 'always');\n var fields = localeData[locale];\n invariant(!!fields, \"Missing locale data for \" + locale);\n internalSlots.fields = fields;\n internalSlots.numberFormat = new Intl.NumberFormat(locales);\n internalSlots.pluralRules = new Intl.PluralRules(locales);\n internalSlots.numberingSystem = nu;\n return rtf;\n}\n","import { UNICODE_EXTENSION_SEQUENCE_REGEX } from './utils';\nimport { BestAvailableLocale } from './BestAvailableLocale';\n/**\n * https://tc39.es/ecma402/#sec-lookupsupportedlocales\n * @param availableLocales\n * @param requestedLocales\n */\nexport function LookupSupportedLocales(availableLocales, requestedLocales) {\n var subset = [];\n for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {\n var locale = requestedLocales_1[_i];\n var noExtensionLocale = locale.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, '');\n var availableLocale = BestAvailableLocale(availableLocales, noExtensionLocale);\n if (availableLocale) {\n subset.push(availableLocale);\n }\n }\n return subset;\n}\n","import { ToObject } from './262';\nimport { GetOption } from './GetOption';\nimport { LookupSupportedLocales } from './LookupSupportedLocales';\n/**\n * https://tc39.es/ecma402/#sec-supportedlocales\n * @param availableLocales\n * @param requestedLocales\n * @param options\n */\nexport function SupportedLocales(availableLocales, requestedLocales, options) {\n var matcher = 'best fit';\n if (options !== undefined) {\n options = ToObject(options);\n matcher = GetOption(options, 'localeMatcher', 'string', ['lookup', 'best fit'], 'best fit');\n }\n if (matcher === 'best fit') {\n return LookupSupportedLocales(availableLocales, requestedLocales);\n }\n return LookupSupportedLocales(availableLocales, requestedLocales);\n}\n","import { __assign, __extends } from \"tslib\";\nexport function getLocaleHierarchy(locale) {\n var results = [locale];\n var localeParts = locale.split('-');\n for (var i = localeParts.length; i > 1; i--) {\n results.push(localeParts.slice(0, i - 1).join('-'));\n }\n return results;\n}\nvar MissingLocaleDataError = /** @class */ (function (_super) {\n __extends(MissingLocaleDataError, _super);\n function MissingLocaleDataError() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'MISSING_LOCALE_DATA';\n return _this;\n }\n return MissingLocaleDataError;\n}(Error));\nexport function isMissingLocaleDataError(e) {\n return e.type === 'MISSING_LOCALE_DATA';\n}\nexport function unpackData(locale, localeData, \n/** By default shallow merge the dictionaries. */\nreducer) {\n if (reducer === void 0) { reducer = function (all, d) { return (__assign(__assign({}, all), d)); }; }\n var localeHierarchy = getLocaleHierarchy(locale);\n var dataToMerge = localeHierarchy\n .map(function (l) { return localeData.data[l]; })\n .filter(Boolean);\n if (!dataToMerge.length) {\n throw new MissingLocaleDataError(\"Missing locale data for \\\"\" + locale + \"\\\", lookup hierarchy: \" + localeHierarchy.join(', '));\n }\n dataToMerge.reverse();\n return dataToMerge.reduce(reducer, {});\n}\n","export var RangePatternType;\n(function (RangePatternType) {\n RangePatternType[\"startRange\"] = \"startRange\";\n RangePatternType[\"shared\"] = \"shared\";\n RangePatternType[\"endRange\"] = \"endRange\";\n})(RangePatternType || (RangePatternType = {}));\n","!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?t(exports):\"function\"==typeof define&&define.amd?define([\"exports\"],t):t(e.reduxLogger=e.reduxLogger||{})}(this,function(e){\"use strict\";function t(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function r(e,t){Object.defineProperty(this,\"kind\",{value:e,enumerable:!0}),t&&t.length&&Object.defineProperty(this,\"path\",{value:t,enumerable:!0})}function n(e,t,r){n.super_.call(this,\"E\",e),Object.defineProperty(this,\"lhs\",{value:t,enumerable:!0}),Object.defineProperty(this,\"rhs\",{value:r,enumerable:!0})}function o(e,t){o.super_.call(this,\"N\",e),Object.defineProperty(this,\"rhs\",{value:t,enumerable:!0})}function i(e,t){i.super_.call(this,\"D\",e),Object.defineProperty(this,\"lhs\",{value:t,enumerable:!0})}function a(e,t,r){a.super_.call(this,\"A\",e),Object.defineProperty(this,\"index\",{value:t,enumerable:!0}),Object.defineProperty(this,\"item\",{value:r,enumerable:!0})}function f(e,t,r){var n=e.slice((r||t)+1||e.length);return e.length=t<0?e.length+t:t,e.push.apply(e,n),e}function u(e){var t=\"undefined\"==typeof e?\"undefined\":N(e);return\"object\"!==t?t:e===Math?\"math\":null===e?\"null\":Array.isArray(e)?\"array\":\"[object Date]\"===Object.prototype.toString.call(e)?\"date\":\"function\"==typeof e.toString&&/^\\/.*\\//.test(e.toString())?\"regexp\":\"object\"}function l(e,t,r,c,s,d,p){s=s||[],p=p||[];var g=s.slice(0);if(\"undefined\"!=typeof d){if(c){if(\"function\"==typeof c&&c(g,d))return;if(\"object\"===(\"undefined\"==typeof c?\"undefined\":N(c))){if(c.prefilter&&c.prefilter(g,d))return;if(c.normalize){var h=c.normalize(g,d,e,t);h&&(e=h[0],t=h[1])}}}g.push(d)}\"regexp\"===u(e)&&\"regexp\"===u(t)&&(e=e.toString(),t=t.toString());var y=\"undefined\"==typeof e?\"undefined\":N(e),v=\"undefined\"==typeof t?\"undefined\":N(t),b=\"undefined\"!==y||p&&p[p.length-1].lhs&&p[p.length-1].lhs.hasOwnProperty(d),m=\"undefined\"!==v||p&&p[p.length-1].rhs&&p[p.length-1].rhs.hasOwnProperty(d);if(!b&&m)r(new o(g,t));else if(!m&&b)r(new i(g,e));else if(u(e)!==u(t))r(new n(g,e,t));else if(\"date\"===u(e)&&e-t!==0)r(new n(g,e,t));else if(\"object\"===y&&null!==e&&null!==t)if(p.filter(function(t){return t.lhs===e}).length)e!==t&&r(new n(g,e,t));else{if(p.push({lhs:e,rhs:t}),Array.isArray(e)){var w;e.length;for(w=0;w=t.length?r(new a(g,w,new i(void 0,e[w]))):l(e[w],t[w],r,c,g,w,p);for(;w=0?(l(e[n],t[n],r,c,g,n,p),S=f(S,i)):l(e[n],void 0,r,c,g,n,p)}),S.forEach(function(e){l(void 0,t[e],r,c,g,e,p)})}p.length=p.length-1}else e!==t&&(\"number\"===y&&isNaN(e)&&isNaN(t)||r(new n(g,e,t)))}function c(e,t,r,n){return n=n||[],l(e,t,function(e){e&&n.push(e)},r),n.length?n:void 0}function s(e,t,r){if(r.path&&r.path.length){var n,o=e[t],i=r.path.length-1;for(n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},L,e),r=t.logger,n=t.stateTransformer,o=t.errorTransformer,i=t.predicate,a=t.logErrors,f=t.diffPredicate;if(\"undefined\"==typeof r)return function(){return function(e){return function(t){return e(t)}}};if(e.getState&&e.dispatch)return console.error(\"[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware:\\n// Logger with default options\\nimport { logger } from 'redux-logger'\\nconst store = createStore(\\n reducer,\\n applyMiddleware(logger)\\n)\\n// Or you can create your own logger with custom options http://bit.ly/redux-logger-options\\nimport createLogger from 'redux-logger'\\nconst logger = createLogger({\\n // ...options\\n});\\nconst store = createStore(\\n reducer,\\n applyMiddleware(logger)\\n)\\n\"),function(){return function(e){return function(t){return e(t)}}};var u=[];return function(e){var r=e.getState;return function(e){return function(l){if(\"function\"==typeof i&&!i(r,l))return e(l);var c={};u.push(c),c.started=O.now(),c.startedTime=new Date,c.prevState=n(r()),c.action=l;var s=void 0;if(a)try{s=e(l)}catch(e){c.error=o(e)}else s=e(l);c.took=O.now()-c.started,c.nextState=n(r());var d=t.diff&&\"function\"==typeof f?f(r,l):t.diff;if(x(u,Object.assign({},t,{diff:d})),u.length=0,c.error)throw c.error;return s}}}}var k,j,E=function(e,t){return new Array(t+1).join(e)},A=function(e,t){return E(\"0\",t-e.toString().length)+e},D=function(e){return A(e.getHours(),2)+\":\"+A(e.getMinutes(),2)+\":\"+A(e.getSeconds(),2)+\".\"+A(e.getMilliseconds(),3)},O=\"undefined\"!=typeof performance&&null!==performance&&\"function\"==typeof performance.now?performance:Date,N=\"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},P=function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:{},t=e.dispatch,r=e.getState;return\"function\"==typeof t||\"function\"==typeof r?S()({dispatch:t,getState:r}):void console.error(\"\\n[redux-logger v3] BREAKING CHANGE\\n[redux-logger v3] Since 3.0.0 redux-logger exports by default logger with default settings.\\n[redux-logger v3] Change\\n[redux-logger v3] import createLogger from 'redux-logger'\\n[redux-logger v3] to\\n[redux-logger v3] import { createLogger } from 'redux-logger'\\n\")};e.defaults=L,e.createLogger=S,e.logger=T,e.default=T,Object.defineProperty(e,\"__esModule\",{value:!0})});\n","function createThunkMiddleware(extraArgument) {\n return function (_ref) {\n var dispatch = _ref.dispatch,\n getState = _ref.getState;\n return function (next) {\n return function (action) {\n if (typeof action === 'function') {\n return action(dispatch, getState, extraArgument);\n }\n\n return next(action);\n };\n };\n };\n}\n\nvar thunk = createThunkMiddleware();\nthunk.withExtraArgument = createThunkMiddleware;\n\nexport default thunk;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.initStateWithPrevTab = exports.withReduxStateSync = exports.createReduxStateSync = exports.createStateSyncMiddleware = undefined;\nexports.generateUuidForAction = generateUuidForAction;\nexports.isActionAllowed = isActionAllowed;\nexports.isActionSynced = isActionSynced;\nexports.createMessageListener = createMessageListener;\n\nvar _broadcastChannel = require('broadcast-channel');\n\nvar _broadcastChannel2 = _interopRequireDefault(_broadcastChannel);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar lastUuid = 0; /* eslint-env browser */\n\nvar GET_INIT_STATE = '&_GET_INIT_STATE';\nvar SEND_INIT_STATE = '&_SEND_INIT_STATE';\nvar RECEIVE_INIT_STATE = '&_RECEIVE_INIT_STATE';\n\nvar defaultConfig = {\n channel: 'redux_state_sync',\n predicate: null,\n blacklist: [],\n whitelist: [],\n broadcastChannelOption: null,\n prepareState: function prepareState(state) {\n return state;\n }\n};\n\nvar getIniteState = function getIniteState() {\n return { type: GET_INIT_STATE };\n};\nvar sendIniteState = function sendIniteState() {\n return { type: SEND_INIT_STATE };\n};\nvar receiveIniteState = function receiveIniteState(state) {\n return { type: RECEIVE_INIT_STATE, payload: state };\n};\n\nfunction s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n}\n\nfunction guid() {\n return '' + s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n}\n\n// generate current window unique id\nvar WINDOW_STATE_SYNC_ID = guid();\n// if the message receiver is already created\nvar isMessageListenerCreated = false;\n// export for test\nfunction generateUuidForAction(action) {\n var stampedAction = action;\n stampedAction.$uuid = guid();\n stampedAction.$wuid = WINDOW_STATE_SYNC_ID;\n return stampedAction;\n}\n// export for test\nfunction isActionAllowed(_ref) {\n var predicate = _ref.predicate,\n blacklist = _ref.blacklist,\n whitelist = _ref.whitelist;\n\n var allowed = function allowed() {\n return true;\n };\n\n if (predicate && typeof predicate === 'function') {\n allowed = predicate;\n } else if (Array.isArray(blacklist)) {\n allowed = function allowed(type) {\n return blacklist.indexOf(type) < 0;\n };\n } else if (Array.isArray(whitelist)) {\n allowed = function allowed(type) {\n return whitelist.indexOf(type) >= 0;\n };\n }\n return allowed;\n}\n// export for test\nfunction isActionSynced(action) {\n return !!action.$isSync;\n}\n// export for test\nfunction createMessageListener(_ref2) {\n var channel = _ref2.channel,\n dispatch = _ref2.dispatch,\n allowed = _ref2.allowed;\n\n var isSynced = false;\n var tabs = {};\n var messageChannel = channel;\n messageChannel.onmessage = function (stampedAction) {\n // Ignore if this action is triggered by this window\n if (stampedAction.$wuid === WINDOW_STATE_SYNC_ID) {\n return;\n }\n // IE bug https://stackoverflow.com/questions/18265556/why-does-internet-explorer-fire-the-window-storage-event-on-the-window-that-st\n if (stampedAction.type === RECEIVE_INIT_STATE) {\n return;\n }\n // ignore other values that saved to localstorage.\n if (stampedAction.$uuid && stampedAction.$uuid !== lastUuid) {\n if (stampedAction.type === GET_INIT_STATE && !tabs[stampedAction.$wuid]) {\n tabs[stampedAction.$wuid] = true;\n dispatch(sendIniteState());\n } else if (stampedAction.type === SEND_INIT_STATE && !tabs[stampedAction.$wuid]) {\n if (!isSynced) {\n isSynced = true;\n dispatch(receiveIniteState(stampedAction.payload));\n }\n return;\n } else if (allowed(stampedAction.type)) {\n lastUuid = stampedAction.$uuid;\n dispatch(Object.assign(stampedAction, {\n $isSync: true\n }));\n }\n }\n };\n}\n\nvar createStateSyncMiddleware = exports.createStateSyncMiddleware = function createStateSyncMiddleware() {\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultConfig;\n\n var allowed = isActionAllowed(config);\n var channel = new _broadcastChannel2.default(config.channel, config.broadcastChannelOption);\n var prepareState = config.prepareState || defaultConfig.prepareState;\n\n return function (_ref3) {\n var getState = _ref3.getState,\n dispatch = _ref3.dispatch;\n return function (next) {\n return function (action) {\n // create message receiver\n if (!isMessageListenerCreated) {\n isMessageListenerCreated = true;\n createMessageListener({ channel: channel, dispatch: dispatch, allowed: allowed });\n }\n // post messages\n if (action && !action.$uuid) {\n var stampedAction = generateUuidForAction(action);\n lastUuid = stampedAction.$uuid;\n try {\n if (action.type === SEND_INIT_STATE) {\n if (getState()) {\n stampedAction.payload = prepareState(getState());\n channel.postMessage(stampedAction);\n }\n return next(action);\n }\n if (allowed(stampedAction.type) || action.type === GET_INIT_STATE) {\n channel.postMessage(stampedAction);\n }\n } catch (e) {\n console.error(\"Your browser doesn't support cross tab communication\");\n }\n }\n return next(Object.assign(action, {\n $isSync: typeof action.$isSync === 'undefined' ? false : action.$isSync\n }));\n };\n };\n };\n};\n\nvar createReduxStateSync = exports.createReduxStateSync = function createReduxStateSync(_ref4) {\n var prepareState = _ref4.prepareState;\n return function (appReducer) {\n return function (state, action) {\n var initState = state;\n if (action.type === RECEIVE_INIT_STATE) {\n initState = prepareState(action.payload);\n }\n return appReducer(initState, action);\n };\n };\n};\n\n// init state with other tab's state\nvar withReduxStateSync = exports.withReduxStateSync = createReduxStateSync({\n prepareState: function prepareState(state) {\n return state;\n }\n});\n\nvar initStateWithPrevTab = exports.initStateWithPrevTab = function initStateWithPrevTab(_ref5) {\n var dispatch = _ref5.dispatch;\n\n dispatch(getIniteState());\n};","'use strict';\n\nexports.__esModule = true;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nexports.default = autoMergeLevel2;\nfunction autoMergeLevel2(inboundState, originalState, reducedState, _ref) {\n var debug = _ref.debug;\n\n var newState = _extends({}, reducedState);\n // only rehydrate if inboundState exists and is an object\n if (inboundState && (typeof inboundState === 'undefined' ? 'undefined' : _typeof(inboundState)) === 'object') {\n Object.keys(inboundState).forEach(function (key) {\n // ignore _persist data\n if (key === '_persist') return;\n // if reducer modifies substate, skip auto rehydration\n if (originalState[key] !== reducedState[key]) {\n if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', key);\n return;\n }\n if (isPlainEnoughObject(reducedState[key])) {\n // if object is plain enough shallow merge the new values (hence \"Level2\")\n newState[key] = _extends({}, newState[key], inboundState[key]);\n return;\n }\n // otherwise hard set\n newState[key] = inboundState[key];\n });\n }\n\n if (process.env.NODE_ENV !== 'production' && debug && inboundState && (typeof inboundState === 'undefined' ? 'undefined' : _typeof(inboundState)) === 'object') console.log('redux-persist/stateReconciler: rehydrated keys \\'' + Object.keys(inboundState).join(', ') + '\\'');\n\n return newState;\n}\n\n/*\n autoMergeLevel2: \n - merges 2 level of substate\n - skips substate if already modified\n - this is essentially redux-perist v4 behavior\n*/\n\nfunction isPlainEnoughObject(o) {\n return o !== null && !Array.isArray(o) && (typeof o === 'undefined' ? 'undefined' : _typeof(o)) === 'object';\n}","'use strict';\n\nexports.__esModule = true;\n\nvar _createWebStorage = require('./createWebStorage');\n\nvar _createWebStorage2 = _interopRequireDefault(_createWebStorage);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = (0, _createWebStorage2.default)('local');","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for comparison styles. */\nvar UNORDERED_COMPARE_FLAG = 1,\n PARTIAL_COMPARE_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values ? values.length : 0;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {boolean} [bitmask] The bitmask of comparison flags.\n * The bitmask may be composed of the following flags:\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, customizer, bitmask, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`\n * for more details.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = arrayTag,\n othTag = arrayTag;\n\n if (!objIsArr) {\n objTag = getTag(object);\n objTag = objTag == argsTag ? objectTag : objTag;\n }\n if (!othIsArr) {\n othTag = getTag(other);\n othTag = othTag == argsTag ? objectTag : othTag;\n }\n var objIsObj = objTag == objectTag && !isHostObject(object),\n othIsObj = othTag == objectTag && !isHostObject(other),\n isSameTag = objTag == othTag;\n\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)\n : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);\n }\n if (!(bitmask & PARTIAL_COMPARE_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, equalFunc, customizer, bitmask, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n * for more details.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, equalFunc, customizer, bitmask, stack) {\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!seen.has(othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {\n return seen.add(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, customizer, bitmask, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n * for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= UNORDERED_COMPARE_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n * for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, equalFunc, customizer, bitmask, stack) {\n var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n objProps = keys(object),\n objLength = objProps.length,\n othProps = keys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\nfunction isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, customizer) : !!result;\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = isEqualWith;\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Scrollbars = undefined;\n\nvar _Scrollbars = require('./Scrollbars');\n\nvar _Scrollbars2 = _interopRequireDefault(_Scrollbars);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nexports[\"default\"] = _Scrollbars2[\"default\"];\nexports.Scrollbars = _Scrollbars2[\"default\"];","//\n\nmodule.exports = function shallowEqual(objA, objB, compare, compareContext) {\n var ret = compare ? compare.call(compareContext, objA, objB) : void 0;\n\n if (ret !== void 0) {\n return !!ret;\n }\n\n if (objA === objB) {\n return true;\n }\n\n if (typeof objA !== \"object\" || !objA || typeof objB !== \"object\" || !objB) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);\n\n // Test for A's keys different from B.\n for (var idx = 0; idx < keysA.length; idx++) {\n var key = keysA[idx];\n\n if (!bHasOwnProperty(key)) {\n return false;\n }\n\n var valueA = objA[key];\n var valueB = objB[key];\n\n ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;\n\n if (ret === false || (ret === void 0 && valueA !== valueB)) {\n return false;\n }\n }\n\n return true;\n};\n","function stylis_min (W) {\n function M(d, c, e, h, a) {\n for (var m = 0, b = 0, v = 0, n = 0, q, g, x = 0, K = 0, k, u = k = q = 0, l = 0, r = 0, I = 0, t = 0, B = e.length, J = B - 1, y, f = '', p = '', F = '', G = '', C; l < B;) {\n g = e.charCodeAt(l);\n l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47), n = v = m = 0, B++, J++);\n\n if (0 === b + n + v + m) {\n if (l === J && (0 < r && (f = f.replace(N, '')), 0 < f.trim().length)) {\n switch (g) {\n case 32:\n case 9:\n case 59:\n case 13:\n case 10:\n break;\n\n default:\n f += e.charAt(l);\n }\n\n g = 59;\n }\n\n switch (g) {\n case 123:\n f = f.trim();\n q = f.charCodeAt(0);\n k = 1;\n\n for (t = ++l; l < B;) {\n switch (g = e.charCodeAt(l)) {\n case 123:\n k++;\n break;\n\n case 125:\n k--;\n break;\n\n case 47:\n switch (g = e.charCodeAt(l + 1)) {\n case 42:\n case 47:\n a: {\n for (u = l + 1; u < J; ++u) {\n switch (e.charCodeAt(u)) {\n case 47:\n if (42 === g && 42 === e.charCodeAt(u - 1) && l + 2 !== u) {\n l = u + 1;\n break a;\n }\n\n break;\n\n case 10:\n if (47 === g) {\n l = u + 1;\n break a;\n }\n\n }\n }\n\n l = u;\n }\n\n }\n\n break;\n\n case 91:\n g++;\n\n case 40:\n g++;\n\n case 34:\n case 39:\n for (; l++ < J && e.charCodeAt(l) !== g;) {\n }\n\n }\n\n if (0 === k) break;\n l++;\n }\n\n k = e.substring(t, l);\n 0 === q && (q = (f = f.replace(ca, '').trim()).charCodeAt(0));\n\n switch (q) {\n case 64:\n 0 < r && (f = f.replace(N, ''));\n g = f.charCodeAt(1);\n\n switch (g) {\n case 100:\n case 109:\n case 115:\n case 45:\n r = c;\n break;\n\n default:\n r = O;\n }\n\n k = M(c, r, k, g, a + 1);\n t = k.length;\n 0 < A && (r = X(O, f, I), C = H(3, k, r, c, D, z, t, g, a, h), f = r.join(''), void 0 !== C && 0 === (t = (k = C.trim()).length) && (g = 0, k = ''));\n if (0 < t) switch (g) {\n case 115:\n f = f.replace(da, ea);\n\n case 100:\n case 109:\n case 45:\n k = f + '{' + k + '}';\n break;\n\n case 107:\n f = f.replace(fa, '$1 $2');\n k = f + '{' + k + '}';\n k = 1 === w || 2 === w && L('@' + k, 3) ? '@-webkit-' + k + '@' + k : '@' + k;\n break;\n\n default:\n k = f + k, 112 === h && (k = (p += k, ''));\n } else k = '';\n break;\n\n default:\n k = M(c, X(c, f, I), k, h, a + 1);\n }\n\n F += k;\n k = I = r = u = q = 0;\n f = '';\n g = e.charCodeAt(++l);\n break;\n\n case 125:\n case 59:\n f = (0 < r ? f.replace(N, '') : f).trim();\n if (1 < (t = f.length)) switch (0 === u && (q = f.charCodeAt(0), 45 === q || 96 < q && 123 > q) && (t = (f = f.replace(' ', ':')).length), 0 < A && void 0 !== (C = H(1, f, c, d, D, z, p.length, h, a, h)) && 0 === (t = (f = C.trim()).length) && (f = '\\x00\\x00'), q = f.charCodeAt(0), g = f.charCodeAt(1), q) {\n case 0:\n break;\n\n case 64:\n if (105 === g || 99 === g) {\n G += f + e.charAt(l);\n break;\n }\n\n default:\n 58 !== f.charCodeAt(t - 1) && (p += P(f, q, g, f.charCodeAt(2)));\n }\n I = r = u = q = 0;\n f = '';\n g = e.charCodeAt(++l);\n }\n }\n\n switch (g) {\n case 13:\n case 10:\n 47 === b ? b = 0 : 0 === 1 + q && 107 !== h && 0 < f.length && (r = 1, f += '\\x00');\n 0 < A * Y && H(0, f, c, d, D, z, p.length, h, a, h);\n z = 1;\n D++;\n break;\n\n case 59:\n case 125:\n if (0 === b + n + v + m) {\n z++;\n break;\n }\n\n default:\n z++;\n y = e.charAt(l);\n\n switch (g) {\n case 9:\n case 32:\n if (0 === n + m + b) switch (x) {\n case 44:\n case 58:\n case 9:\n case 32:\n y = '';\n break;\n\n default:\n 32 !== g && (y = ' ');\n }\n break;\n\n case 0:\n y = '\\\\0';\n break;\n\n case 12:\n y = '\\\\f';\n break;\n\n case 11:\n y = '\\\\v';\n break;\n\n case 38:\n 0 === n + b + m && (r = I = 1, y = '\\f' + y);\n break;\n\n case 108:\n if (0 === n + b + m + E && 0 < u) switch (l - u) {\n case 2:\n 112 === x && 58 === e.charCodeAt(l - 3) && (E = x);\n\n case 8:\n 111 === K && (E = K);\n }\n break;\n\n case 58:\n 0 === n + b + m && (u = l);\n break;\n\n case 44:\n 0 === b + v + n + m && (r = 1, y += '\\r');\n break;\n\n case 34:\n case 39:\n 0 === b && (n = n === g ? 0 : 0 === n ? g : n);\n break;\n\n case 91:\n 0 === n + b + v && m++;\n break;\n\n case 93:\n 0 === n + b + v && m--;\n break;\n\n case 41:\n 0 === n + b + m && v--;\n break;\n\n case 40:\n if (0 === n + b + m) {\n if (0 === q) switch (2 * x + 3 * K) {\n case 533:\n break;\n\n default:\n q = 1;\n }\n v++;\n }\n\n break;\n\n case 64:\n 0 === b + v + n + m + u + k && (k = 1);\n break;\n\n case 42:\n case 47:\n if (!(0 < n + m + v)) switch (b) {\n case 0:\n switch (2 * g + 3 * e.charCodeAt(l + 1)) {\n case 235:\n b = 47;\n break;\n\n case 220:\n t = l, b = 42;\n }\n\n break;\n\n case 42:\n 47 === g && 42 === x && t + 2 !== l && (33 === e.charCodeAt(t + 2) && (p += e.substring(t, l + 1)), y = '', b = 0);\n }\n }\n\n 0 === b && (f += y);\n }\n\n K = x;\n x = g;\n l++;\n }\n\n t = p.length;\n\n if (0 < t) {\n r = c;\n if (0 < A && (C = H(2, p, r, d, D, z, t, h, a, h), void 0 !== C && 0 === (p = C).length)) return G + p + F;\n p = r.join(',') + '{' + p + '}';\n\n if (0 !== w * E) {\n 2 !== w || L(p, 2) || (E = 0);\n\n switch (E) {\n case 111:\n p = p.replace(ha, ':-moz-$1') + p;\n break;\n\n case 112:\n p = p.replace(Q, '::-webkit-input-$1') + p.replace(Q, '::-moz-$1') + p.replace(Q, ':-ms-input-$1') + p;\n }\n\n E = 0;\n }\n }\n\n return G + p + F;\n }\n\n function X(d, c, e) {\n var h = c.trim().split(ia);\n c = h;\n var a = h.length,\n m = d.length;\n\n switch (m) {\n case 0:\n case 1:\n var b = 0;\n\n for (d = 0 === m ? '' : d[0] + ' '; b < a; ++b) {\n c[b] = Z(d, c[b], e).trim();\n }\n\n break;\n\n default:\n var v = b = 0;\n\n for (c = []; b < a; ++b) {\n for (var n = 0; n < m; ++n) {\n c[v++] = Z(d[n] + ' ', h[b], e).trim();\n }\n }\n\n }\n\n return c;\n }\n\n function Z(d, c, e) {\n var h = c.charCodeAt(0);\n 33 > h && (h = (c = c.trim()).charCodeAt(0));\n\n switch (h) {\n case 38:\n return c.replace(F, '$1' + d.trim());\n\n case 58:\n return d.trim() + c.replace(F, '$1' + d.trim());\n\n default:\n if (0 < 1 * e && 0 < c.indexOf('\\f')) return c.replace(F, (58 === d.charCodeAt(0) ? '' : '$1') + d.trim());\n }\n\n return d + c;\n }\n\n function P(d, c, e, h) {\n var a = d + ';',\n m = 2 * c + 3 * e + 4 * h;\n\n if (944 === m) {\n d = a.indexOf(':', 9) + 1;\n var b = a.substring(d, a.length - 1).trim();\n b = a.substring(0, d).trim() + b + ';';\n return 1 === w || 2 === w && L(b, 1) ? '-webkit-' + b + b : b;\n }\n\n if (0 === w || 2 === w && !L(a, 1)) return a;\n\n switch (m) {\n case 1015:\n return 97 === a.charCodeAt(10) ? '-webkit-' + a + a : a;\n\n case 951:\n return 116 === a.charCodeAt(3) ? '-webkit-' + a + a : a;\n\n case 963:\n return 110 === a.charCodeAt(5) ? '-webkit-' + a + a : a;\n\n case 1009:\n if (100 !== a.charCodeAt(4)) break;\n\n case 969:\n case 942:\n return '-webkit-' + a + a;\n\n case 978:\n return '-webkit-' + a + '-moz-' + a + a;\n\n case 1019:\n case 983:\n return '-webkit-' + a + '-moz-' + a + '-ms-' + a + a;\n\n case 883:\n if (45 === a.charCodeAt(8)) return '-webkit-' + a + a;\n if (0 < a.indexOf('image-set(', 11)) return a.replace(ja, '$1-webkit-$2') + a;\n break;\n\n case 932:\n if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) {\n case 103:\n return '-webkit-box-' + a.replace('-grow', '') + '-webkit-' + a + '-ms-' + a.replace('grow', 'positive') + a;\n\n case 115:\n return '-webkit-' + a + '-ms-' + a.replace('shrink', 'negative') + a;\n\n case 98:\n return '-webkit-' + a + '-ms-' + a.replace('basis', 'preferred-size') + a;\n }\n return '-webkit-' + a + '-ms-' + a + a;\n\n case 964:\n return '-webkit-' + a + '-ms-flex-' + a + a;\n\n case 1023:\n if (99 !== a.charCodeAt(8)) break;\n b = a.substring(a.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify');\n return '-webkit-box-pack' + b + '-webkit-' + a + '-ms-flex-pack' + b + a;\n\n case 1005:\n return ka.test(a) ? a.replace(aa, ':-webkit-') + a.replace(aa, ':-moz-') + a : a;\n\n case 1e3:\n b = a.substring(13).trim();\n c = b.indexOf('-') + 1;\n\n switch (b.charCodeAt(0) + b.charCodeAt(c)) {\n case 226:\n b = a.replace(G, 'tb');\n break;\n\n case 232:\n b = a.replace(G, 'tb-rl');\n break;\n\n case 220:\n b = a.replace(G, 'lr');\n break;\n\n default:\n return a;\n }\n\n return '-webkit-' + a + '-ms-' + b + a;\n\n case 1017:\n if (-1 === a.indexOf('sticky', 9)) break;\n\n case 975:\n c = (a = d).length - 10;\n b = (33 === a.charCodeAt(c) ? a.substring(0, c) : a).substring(d.indexOf(':', 7) + 1).trim();\n\n switch (m = b.charCodeAt(0) + (b.charCodeAt(7) | 0)) {\n case 203:\n if (111 > b.charCodeAt(8)) break;\n\n case 115:\n a = a.replace(b, '-webkit-' + b) + ';' + a;\n break;\n\n case 207:\n case 102:\n a = a.replace(b, '-webkit-' + (102 < m ? 'inline-' : '') + 'box') + ';' + a.replace(b, '-webkit-' + b) + ';' + a.replace(b, '-ms-' + b + 'box') + ';' + a;\n }\n\n return a + ';';\n\n case 938:\n if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) {\n case 105:\n return b = a.replace('-items', ''), '-webkit-' + a + '-webkit-box-' + b + '-ms-flex-' + b + a;\n\n case 115:\n return '-webkit-' + a + '-ms-flex-item-' + a.replace(ba, '') + a;\n\n default:\n return '-webkit-' + a + '-ms-flex-line-pack' + a.replace('align-content', '').replace(ba, '') + a;\n }\n break;\n\n case 973:\n case 989:\n if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break;\n\n case 931:\n case 953:\n if (!0 === la.test(d)) return 115 === (b = d.substring(d.indexOf(':') + 1)).charCodeAt(0) ? P(d.replace('stretch', 'fill-available'), c, e, h).replace(':fill-available', ':stretch') : a.replace(b, '-webkit-' + b) + a.replace(b, '-moz-' + b.replace('fill-', '')) + a;\n break;\n\n case 962:\n if (a = '-webkit-' + a + (102 === a.charCodeAt(5) ? '-ms-' + a : '') + a, 211 === e + h && 105 === a.charCodeAt(13) && 0 < a.indexOf('transform', 10)) return a.substring(0, a.indexOf(';', 27) + 1).replace(ma, '$1-webkit-$2') + a;\n }\n\n return a;\n }\n\n function L(d, c) {\n var e = d.indexOf(1 === c ? ':' : '{'),\n h = d.substring(0, 3 !== c ? e : 10);\n e = d.substring(e + 1, d.length - 1);\n return R(2 !== c ? h : h.replace(na, '$1'), e, c);\n }\n\n function ea(d, c) {\n var e = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2));\n return e !== c + ';' ? e.replace(oa, ' or ($1)').substring(4) : '(' + c + ')';\n }\n\n function H(d, c, e, h, a, m, b, v, n, q) {\n for (var g = 0, x = c, w; g < A; ++g) {\n switch (w = S[g].call(B, d, x, e, h, a, m, b, v, n, q)) {\n case void 0:\n case !1:\n case !0:\n case null:\n break;\n\n default:\n x = w;\n }\n }\n\n if (x !== c) return x;\n }\n\n function T(d) {\n switch (d) {\n case void 0:\n case null:\n A = S.length = 0;\n break;\n\n default:\n if ('function' === typeof d) S[A++] = d;else if ('object' === typeof d) for (var c = 0, e = d.length; c < e; ++c) {\n T(d[c]);\n } else Y = !!d | 0;\n }\n\n return T;\n }\n\n function U(d) {\n d = d.prefix;\n void 0 !== d && (R = null, d ? 'function' !== typeof d ? w = 1 : (w = 2, R = d) : w = 0);\n return U;\n }\n\n function B(d, c) {\n var e = d;\n 33 > e.charCodeAt(0) && (e = e.trim());\n V = e;\n e = [V];\n\n if (0 < A) {\n var h = H(-1, c, e, e, D, z, 0, 0, 0, 0);\n void 0 !== h && 'string' === typeof h && (c = h);\n }\n\n var a = M(O, e, c, 0, 0);\n 0 < A && (h = H(-2, a, e, e, D, z, a.length, 0, 0, 0), void 0 !== h && (a = h));\n V = '';\n E = 0;\n z = D = 1;\n return a;\n }\n\n var ca = /^\\0+/g,\n N = /[\\0\\r\\f]/g,\n aa = /: */g,\n ka = /zoo|gra/,\n ma = /([,: ])(transform)/g,\n ia = /,\\r+?/g,\n F = /([\\t\\r\\n ])*\\f?&/g,\n fa = /@(k\\w+)\\s*(\\S*)\\s*/,\n Q = /::(place)/g,\n ha = /:(read-only)/g,\n G = /[svh]\\w+-[tblr]{2}/,\n da = /\\(\\s*(.*)\\s*\\)/g,\n oa = /([\\s\\S]*?);/g,\n ba = /-self|flex-/g,\n na = /[^]*?(:[rp][el]a[\\w-]+)[^]*/,\n la = /stretch|:\\s*\\w+\\-(?:conte|avail)/,\n ja = /([^-])(image-set\\()/,\n z = 1,\n D = 1,\n E = 0,\n w = 1,\n O = [],\n S = [],\n A = 0,\n R = null,\n Y = 0,\n V = '';\n B.use = T;\n B.set = U;\n void 0 !== W && U(W);\n return B;\n}\n\nexport default stylis_min;\n","var unitlessKeys = {\n animationIterationCount: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n msGridRow: 1,\n msGridRowSpan: 1,\n msGridColumn: 1,\n msGridColumnSpan: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\n\nexport default unitlessKeys;\n","import * as React from \"react\";\nimport * as PropTypes from \"prop-types\";\n\nexport type ProgressBarProps = {\n completed: string | number;\n bgColor?: string;\n baseBgColor?: string;\n height?: string;\n width?: string;\n borderRadius?: string;\n margin?: string;\n padding?: string;\n labelAlignment?: \"left\" | \"center\" | \"right\" | \"outside\";\n labelColor?: string;\n labelSize?: string;\n customLabelStyles?: React.CSSProperties;\n isLabelVisible?: boolean;\n transitionDuration?: string;\n transitionTimingFunction?:\n | \"ease\"\n | \"linear\"\n | \"ease-in\"\n | \"ease-out\"\n | \"ease-in-out\";\n className?: string;\n dir?: \"ltr\" | \"rtl\" | \"auto\";\n ariaValuemin?: number;\n ariaValuemax?: number;\n ariaValuetext?: number | null;\n maxCompleted?: number;\n customLabel?: string;\n animateOnRender?: boolean;\n barContainerClassName?: string;\n completedClassName?: string;\n labelClassName?: string;\n initCompletedOnAnimation?: string | number;\n};\n\nconst ProgressBar: React.FC = ({\n bgColor,\n completed,\n baseBgColor,\n height,\n width,\n margin,\n padding,\n borderRadius,\n labelAlignment,\n labelColor,\n labelSize,\n isLabelVisible,\n customLabelStyles,\n transitionDuration,\n transitionTimingFunction,\n className,\n dir,\n ariaValuemin,\n ariaValuemax,\n ariaValuetext,\n maxCompleted,\n customLabel,\n animateOnRender,\n barContainerClassName,\n completedClassName,\n labelClassName,\n initCompletedOnAnimation = 0,\n}) => {\n const getAlignment = (\n alignmentOption: ProgressBarProps[\"labelAlignment\"]\n ) => {\n if (alignmentOption === \"left\") {\n return \"flex-start\";\n } else if (alignmentOption === \"center\") {\n return \"center\";\n } else if (alignmentOption === \"right\") {\n return \"flex-end\";\n } else {\n return null;\n }\n };\n\n const alignment = getAlignment(labelAlignment);\n\n const initCompletedOnAnimationStr =\n typeof initCompletedOnAnimation === \"number\"\n ? `${initCompletedOnAnimation}%`\n : initCompletedOnAnimation;\n\n const getFillerWidth = (\n maxCompletedValue: ProgressBarProps[\"maxCompleted\"],\n completedValue: ProgressBarProps[\"completed\"]\n ) => {\n if (maxCompletedValue) {\n const ratio = Number(completedValue) / maxCompletedValue;\n return ratio > 1 ? \"100%\" : `${ratio * 100}%`;\n }\n return initCompletedOnAnimationStr;\n };\n\n const fillerWidth = getFillerWidth(maxCompleted, completed);\n\n const [initWidth, setInitWidth] = React.useState(\n initCompletedOnAnimationStr\n );\n\n const containerStyles: React.CSSProperties = {\n height: height,\n background: baseBgColor,\n borderRadius: borderRadius,\n padding: padding,\n width: width,\n margin: margin,\n overflow: \"hidden\",\n };\n\n const fillerStyles: React.CSSProperties = {\n height: height,\n width: animateOnRender ? initWidth : fillerWidth,\n background: bgColor,\n transition: `width ${transitionDuration || \"1s\"} ${\n transitionTimingFunction || \"ease-in-out\"\n }`,\n borderRadius: \"inherit\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent:\n labelAlignment !== \"outside\" && alignment ? alignment : \"normal\",\n };\n\n const labelStyles: React.CSSProperties = {\n padding: labelAlignment === \"outside\" ? \"0 0 0 5px\" : \"5px\",\n color: labelColor,\n fontWeight: \"bold\",\n fontSize: labelSize,\n display: !isLabelVisible ? \"none\" : \"initial\",\n ...customLabelStyles,\n };\n\n const outsideStyles = {\n display: labelAlignment === \"outside\" ? \"flex\" : \"initial\",\n alignItems: labelAlignment === \"outside\" ? \"center\" : \"initial\",\n };\n\n const completedStr =\n typeof completed === \"number\" ? `${completed}%` : `${completed}`;\n\n const labelStr = customLabel ? customLabel : completedStr;\n\n React.useEffect(() => {\n if (animateOnRender) {\n requestAnimationFrame(() => setInitWidth(fillerWidth));\n }\n }, [fillerWidth, animateOnRender]);\n\n return (\n \n
\n
\n {labelAlignment !== \"outside\" && (\n \n {labelStr}\n \n )}\n
\n
\n {labelAlignment === \"outside\" && (\n
\n {labelStr}\n \n )}\n
\n );\n};\n\nProgressBar.propTypes = {\n completed: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n .isRequired,\n bgColor: PropTypes.string,\n baseBgColor: PropTypes.string,\n height: PropTypes.string,\n width: PropTypes.string,\n borderRadius: PropTypes.string,\n margin: PropTypes.string,\n padding: PropTypes.string,\n labelAlignment: PropTypes.oneOf([\"left\", \"center\", \"right\", \"outside\"]),\n labelColor: PropTypes.string,\n labelSize: PropTypes.string,\n isLabelVisible: PropTypes.bool,\n className: PropTypes.string,\n dir: PropTypes.oneOf([\"rtl\", \"ltr\", \"auto\"]),\n maxCompleted: PropTypes.number,\n customLabel: PropTypes.string,\n animateOnRender: PropTypes.bool,\n barContainerClassName: PropTypes.string,\n completedClassName: PropTypes.string,\n labelClassName: PropTypes.string,\n initCompletedOnAnimation: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.number,\n ]),\n};\n\nProgressBar.defaultProps = {\n bgColor: \"#6a1b9a\",\n height: \"20px\",\n width: \"100%\",\n borderRadius: \"50px\",\n labelAlignment: \"right\",\n baseBgColor: \"#e0e0de\",\n labelColor: \"#fff\",\n labelSize: \"15px\",\n isLabelVisible: true,\n dir: \"ltr\",\n ariaValuemin: 0,\n ariaValuemax: 100,\n ariaValuetext: null,\n maxCompleted: 100,\n animateOnRender: false,\n initCompletedOnAnimation: 0,\n};\n\nexport default ProgressBar;\n","import React, { Fragment, useEffect, useState, useRef } from \"react\";\nimport \"./Marquee.scss\";\n\ninterface MarqueeProps {\n /**\n * Inline style for the container div\n * Type: object\n * Default: {}\n */\n style?: React.CSSProperties;\n /**\n * Class name to style the container div\n * Type: string\n * Default: \"\"\n */\n className?: string;\n /**\n * Whether to play or pause the marquee\n * Type: boolean\n * Default: true\n */\n play?: boolean;\n /**\n * Whether to pause the marquee when hovered\n * Type: boolean\n * Default: false\n */\n pauseOnHover?: boolean;\n /**\n * Whether to pause the marquee when clicked\n * Type: boolean\n * Default: false\n */\n pauseOnClick?: boolean;\n /**\n * The direction the marquee is sliding\n * Type: \"left\" or \"right\"\n * Default: \"left\"\n */\n direction?: \"left\" | \"right\";\n /**\n * Speed calculated as pixels/second\n * Type: number\n * Default: 20\n */\n speed?: number;\n /**\n * Duration to delay the animation after render, in seconds\n * Type: number\n * Default: 0\n */\n delay?: number;\n /**\n * The number of times the marquee should loop, 0 is equivalent to infinite\n * Type: number\n * Default: 0\n */\n loop?: number;\n /**\n * Whether to show the gradient or not\n * Type: boolean\n * Default: true\n */\n gradient?: boolean;\n /**\n * The rgb color of the gradient as an array of length 3\n * Type: Array of length 3\n * Default: [255, 255, 255]\n */\n gradientColor?: [number, number, number];\n /**\n * The width of the gradient on either side\n * Type: string\n * Default: 200\n */\n gradientWidth?: number | string;\n /**\n * A callback for when the marquee finishes scrolling and stops. Only calls if loop is non-zero.\n * Type: Function\n * Default: null\n */\n onFinish?: () => void;\n /**\n * A callback for when the marquee finishes a loop. Does not call if maximum loops are reached (use onFinish instead).\n * Type: Function\n * Default: null\n */\n onCycleComplete?: () => void;\n /**\n * The children rendered inside the marquee\n * Type: ReactNode\n * Default: null\n */\n children?: React.ReactNode;\n}\n\nconst Marquee: React.FC = ({\n style = {},\n className = \"\",\n play = true,\n pauseOnHover = false,\n pauseOnClick = false,\n direction = \"left\",\n speed = 20,\n delay = 0,\n loop = 0,\n gradient = true,\n gradientColor = [255, 255, 255],\n gradientWidth = 200,\n onFinish,\n onCycleComplete,\n children,\n}) => {\n // React Hooks\n const [containerWidth, setContainerWidth] = useState(0);\n const [marqueeWidth, setMarqueeWidth] = useState(0);\n const [isMounted, setIsMounted] = useState(false);\n const containerRef = useRef(null);\n const marqueeRef = useRef(null);\n\n useEffect(() => {\n if (!isMounted) return;\n\n const calculateWidth = () => {\n // Find width of container and width of marquee\n if (marqueeRef.current && containerRef.current) {\n setContainerWidth(containerRef.current.getBoundingClientRect().width);\n setMarqueeWidth(marqueeRef.current.getBoundingClientRect().width);\n }\n };\n\n calculateWidth();\n // Rerender on window resize\n window.addEventListener(\"resize\", calculateWidth);\n return () => {\n window.removeEventListener(\"resize\", calculateWidth);\n };\n }, [isMounted]);\n\n useEffect(() => {\n setIsMounted(true);\n }, []);\n\n // Gradient color in an unfinished rgba format\n const rgbaGradientColor = `rgba(${gradientColor[0]}, ${gradientColor[1]}, ${gradientColor[2]}`;\n\n // Animation duration\n const duration =\n marqueeWidth < containerWidth\n ? containerWidth / speed\n : marqueeWidth / speed;\n\n return (\n \n {!isMounted ? null : (\n