\n */\n\n/**\n * Utilities\n */\n\n\nimport format from './utils/format';\nimport removeLeadingSlash from './utils/removeLeadingSlash';\nimport trim from './utils/trim';\nimport loadGA from './utils/loadGA';\nimport warn from './utils/console/warn';\nimport log from './utils/console/log';\nimport TestModeAPI from './utils/testModeAPI';\n\nvar _isNotBrowser = typeof window === 'undefined' || typeof document === 'undefined';\n\nvar _debug = false;\nvar _titleCase = true;\nvar _testMode = false;\nvar _alwaysSendToDefaultTracker = true;\n\nvar internalGa = function internalGa() {\n var _window;\n\n if (_testMode) return TestModeAPI.ga.apply(TestModeAPI, arguments);\n if (_isNotBrowser) return false;\n if (!window.ga) return warn('ReactGA.initialize must be called first or GoogleAnalytics should be loaded manually');\n return (_window = window).ga.apply(_window, arguments);\n};\n\nfunction _format(s) {\n return format(s, _titleCase);\n}\n\nfunction _gaCommand(trackerNames) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var command = args[0];\n\n if (typeof internalGa === 'function') {\n if (typeof command !== 'string') {\n warn('ga command must be a string');\n return;\n }\n\n if (_alwaysSendToDefaultTracker || !Array.isArray(trackerNames)) internalGa.apply(void 0, args);\n\n if (Array.isArray(trackerNames)) {\n trackerNames.forEach(function (name) {\n internalGa.apply(void 0, _toConsumableArray([\"\".concat(name, \".\").concat(command)].concat(args.slice(1))));\n });\n }\n }\n}\n\nfunction _initialize(gaTrackingID, options) {\n if (!gaTrackingID) {\n warn('gaTrackingID is required in initialize()');\n return;\n }\n\n if (options) {\n if (options.debug && options.debug === true) {\n _debug = true;\n }\n\n if (options.titleCase === false) {\n _titleCase = false;\n }\n\n if (options.useExistingGa) {\n return;\n }\n }\n\n if (options && options.gaOptions) {\n internalGa('create', gaTrackingID, options.gaOptions);\n } else {\n internalGa('create', gaTrackingID, 'auto');\n }\n}\n\nexport function initialize(configsOrTrackingId, options) {\n if (options && options.testMode === true) {\n _testMode = true;\n } else {\n if (_isNotBrowser) {\n return false;\n }\n\n if (!options || options.standardImplementation !== true) loadGA(options);\n }\n\n _alwaysSendToDefaultTracker = options && typeof options.alwaysSendToDefaultTracker === 'boolean' ? options.alwaysSendToDefaultTracker : true;\n\n if (Array.isArray(configsOrTrackingId)) {\n configsOrTrackingId.forEach(function (config) {\n if (_typeof(config) !== 'object') {\n warn('All configs must be an object');\n return;\n }\n\n _initialize(config.trackingId, config);\n });\n } else {\n _initialize(configsOrTrackingId, options);\n }\n\n return true;\n}\n/**\n * ga:\n * Returns the original GA object.\n */\n\nexport function ga() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n if (args.length > 0) {\n internalGa.apply(void 0, args);\n\n if (_debug) {\n log('called ga(\\'arguments\\');');\n log(\"with arguments: \".concat(JSON.stringify(args)));\n }\n }\n\n return window.ga;\n}\n/**\n * set:\n * GA tracker set method\n * @param {Object} fieldsObject - a field/value pair or a group of field/value pairs on the tracker\n * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on\n */\n\nexport function set(fieldsObject, trackerNames) {\n if (!fieldsObject) {\n warn('`fieldsObject` is required in .set()');\n return;\n }\n\n if (_typeof(fieldsObject) !== 'object') {\n warn('Expected `fieldsObject` arg to be an Object');\n return;\n }\n\n if (Object.keys(fieldsObject).length === 0) {\n warn('empty `fieldsObject` given to .set()');\n }\n\n _gaCommand(trackerNames, 'set', fieldsObject);\n\n if (_debug) {\n log('called ga(\\'set\\', fieldsObject);');\n log(\"with fieldsObject: \".concat(JSON.stringify(fieldsObject)));\n }\n}\n/**\n * send:\n * Clone of the low level `ga.send` method\n * WARNING: No validations will be applied to this\n * @param {Object} fieldObject - field object for tracking different analytics\n * @param {Array} trackerNames - trackers to send the command to\n * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on\n */\n\nexport function send(fieldObject, trackerNames) {\n _gaCommand(trackerNames, 'send', fieldObject);\n\n if (_debug) {\n log('called ga(\\'send\\', fieldObject);');\n log(\"with fieldObject: \".concat(JSON.stringify(fieldObject)));\n log(\"with trackers: \".concat(JSON.stringify(trackerNames)));\n }\n}\n/**\n * pageview:\n * Basic GA pageview tracking\n * @param {String} path - the current page page e.g. '/about'\n * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on\n * @param {String} title - (optional) the page title e. g. 'My Website'\n */\n\nexport function pageview(rawPath, trackerNames, title) {\n if (!rawPath) {\n warn('path is required in .pageview()');\n return;\n }\n\n var path = trim(rawPath);\n\n if (path === '') {\n warn('path cannot be an empty string in .pageview()');\n return;\n }\n\n var extraFields = {};\n\n if (title) {\n extraFields.title = title;\n }\n\n if (typeof ga === 'function') {\n _gaCommand(trackerNames, 'send', _objectSpread({\n hitType: 'pageview',\n page: path\n }, extraFields));\n\n if (_debug) {\n log('called ga(\\'send\\', \\'pageview\\', path);');\n var extraLog = '';\n\n if (title) {\n extraLog = \" and title: \".concat(title);\n }\n\n log(\"with path: \".concat(path).concat(extraLog));\n }\n }\n}\n/**\n * modalview:\n * a proxy to basic GA pageview tracking to consistently track\n * modal views that are an equivalent UX to a traditional pageview\n * @param {String} modalName e.g. 'add-or-edit-club'\n * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on\n */\n\nexport function modalview(rawModalName, trackerNames) {\n if (!rawModalName) {\n warn('modalName is required in .modalview(modalName)');\n return;\n }\n\n var modalName = removeLeadingSlash(trim(rawModalName));\n\n if (modalName === '') {\n warn('modalName cannot be an empty string or a single / in .modalview()');\n return;\n }\n\n if (typeof ga === 'function') {\n var path = \"/modal/\".concat(modalName);\n\n _gaCommand(trackerNames, 'send', 'pageview', path);\n\n if (_debug) {\n log('called ga(\\'send\\', \\'pageview\\', path);');\n log(\"with path: \".concat(path));\n }\n }\n}\n/**\n * timing:\n * GA timing\n * @param args.category {String} required\n * @param args.variable {String} required\n * @param args.value {Int} required\n * @param args.label {String} required\n * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on\n */\n\nexport function timing() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n category = _ref.category,\n variable = _ref.variable,\n value = _ref.value,\n label = _ref.label;\n\n var trackerNames = arguments.length > 1 ? arguments[1] : undefined;\n\n if (typeof ga === 'function') {\n if (!category || !variable || !value || typeof value !== 'number') {\n warn('args.category, args.variable ' + 'AND args.value are required in timing() ' + 'AND args.value has to be a number');\n return;\n } // Required Fields\n\n\n var fieldObject = {\n hitType: 'timing',\n timingCategory: _format(category),\n timingVar: _format(variable),\n timingValue: value\n };\n\n if (label) {\n fieldObject.timingLabel = _format(label);\n }\n\n send(fieldObject, trackerNames);\n }\n}\n/**\n * event:\n * GA event tracking\n * @param args.category {String} required\n * @param args.action {String} required\n * @param args.label {String} optional\n * @param args.value {Int} optional\n * @param args.nonInteraction {boolean} optional\n * @param args.transport {string} optional\n * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on\n */\n\nexport function event() {\n var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n category = _ref2.category,\n action = _ref2.action,\n label = _ref2.label,\n value = _ref2.value,\n nonInteraction = _ref2.nonInteraction,\n transport = _ref2.transport,\n args = _objectWithoutProperties(_ref2, [\"category\", \"action\", \"label\", \"value\", \"nonInteraction\", \"transport\"]);\n\n var trackerNames = arguments.length > 1 ? arguments[1] : undefined;\n\n if (typeof ga === 'function') {\n // Simple Validation\n if (!category || !action) {\n warn('args.category AND args.action are required in event()');\n return;\n } // Required Fields\n\n\n var fieldObject = {\n hitType: 'event',\n eventCategory: _format(category),\n eventAction: _format(action)\n }; // Optional Fields\n\n if (label) {\n fieldObject.eventLabel = _format(label);\n }\n\n if (typeof value !== 'undefined') {\n if (typeof value !== 'number') {\n warn('Expected `args.value` arg to be a Number.');\n } else {\n fieldObject.eventValue = value;\n }\n }\n\n if (typeof nonInteraction !== 'undefined') {\n if (typeof nonInteraction !== 'boolean') {\n warn('`args.nonInteraction` must be a boolean.');\n } else {\n fieldObject.nonInteraction = nonInteraction;\n }\n }\n\n if (typeof transport !== 'undefined') {\n if (typeof transport !== 'string') {\n warn('`args.transport` must be a string.');\n } else {\n if (['beacon', 'xhr', 'image'].indexOf(transport) === -1) {\n warn('`args.transport` must be either one of these values: `beacon`, `xhr` or `image`');\n }\n\n fieldObject.transport = transport;\n }\n }\n\n Object.keys(args).filter(function (key) {\n return key.substr(0, 'dimension'.length) === 'dimension';\n }).forEach(function (key) {\n fieldObject[key] = args[key];\n });\n Object.keys(args).filter(function (key) {\n return key.substr(0, 'metric'.length) === 'metric';\n }).forEach(function (key) {\n fieldObject[key] = args[key];\n }); // Send to GA\n\n send(fieldObject, trackerNames);\n }\n}\n/**\n * exception:\n * GA exception tracking\n * @param args.description {String} optional\n * @param args.fatal {boolean} optional\n * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on\n */\n\nexport function exception(_ref3, trackerNames) {\n var description = _ref3.description,\n fatal = _ref3.fatal;\n\n if (typeof ga === 'function') {\n // Required Fields\n var fieldObject = {\n hitType: 'exception'\n }; // Optional Fields\n\n if (description) {\n fieldObject.exDescription = _format(description);\n }\n\n if (typeof fatal !== 'undefined') {\n if (typeof fatal !== 'boolean') {\n warn('`args.fatal` must be a boolean.');\n } else {\n fieldObject.exFatal = fatal;\n }\n } // Send to GA\n\n\n send(fieldObject, trackerNames);\n }\n}\nexport var plugin = {\n /**\n * require:\n * GA requires a plugin\n * @param name {String} e.g. 'ecommerce' or 'myplugin'\n * @param options {Object} optional e.g {path: '/log', debug: true}\n * @param trackerName {String} optional e.g 'trackerName'\n */\n require: function require(rawName, options, trackerName) {\n if (typeof ga === 'function') {\n // Required Fields\n if (!rawName) {\n warn('`name` is required in .require()');\n return;\n }\n\n var name = trim(rawName);\n\n if (name === '') {\n warn('`name` cannot be an empty string in .require()');\n return;\n }\n\n var requireString = trackerName ? \"\".concat(trackerName, \".require\") : 'require'; // Optional Fields\n\n if (options) {\n if (_typeof(options) !== 'object') {\n warn('Expected `options` arg to be an Object');\n return;\n }\n\n if (Object.keys(options).length === 0) {\n warn('Empty `options` given to .require()');\n }\n\n ga(requireString, name, options);\n\n if (_debug) {\n log(\"called ga('require', '\".concat(name, \"', \").concat(JSON.stringify(options)));\n }\n } else {\n ga(requireString, name);\n\n if (_debug) {\n log(\"called ga('require', '\".concat(name, \"');\"));\n }\n }\n }\n },\n\n /**\n * execute:\n * GA execute action for plugin\n * Takes variable number of arguments\n * @param pluginName {String} e.g. 'ecommerce' or 'myplugin'\n * @param action {String} e.g. 'addItem' or 'myCustomAction'\n * @param actionType {String} optional e.g. 'detail'\n * @param payload {Object} optional e.g { id: '1x5e', name : 'My product to track' }\n */\n execute: function execute(pluginName, action) {\n var payload;\n var actionType;\n\n if ((arguments.length <= 2 ? 0 : arguments.length - 2) === 1) {\n payload = arguments.length <= 2 ? undefined : arguments[2];\n } else {\n actionType = arguments.length <= 2 ? undefined : arguments[2];\n payload = arguments.length <= 3 ? undefined : arguments[3];\n }\n\n if (typeof ga === 'function') {\n if (typeof pluginName !== 'string') {\n warn('Expected `pluginName` arg to be a String.');\n } else if (typeof action !== 'string') {\n warn('Expected `action` arg to be a String.');\n } else {\n var command = \"\".concat(pluginName, \":\").concat(action);\n payload = payload || null;\n\n if (actionType && payload) {\n ga(command, actionType, payload);\n\n if (_debug) {\n log(\"called ga('\".concat(command, \"');\"));\n log(\"actionType: \\\"\".concat(actionType, \"\\\" with payload: \").concat(JSON.stringify(payload)));\n }\n } else if (payload) {\n ga(command, payload);\n\n if (_debug) {\n log(\"called ga('\".concat(command, \"');\"));\n log(\"with payload: \".concat(JSON.stringify(payload)));\n }\n } else {\n ga(command);\n\n if (_debug) {\n log(\"called ga('\".concat(command, \"');\"));\n }\n }\n }\n }\n }\n};\n/**\n * outboundLink:\n * GA outboundLink tracking\n * @param args.label {String} e.g. url, or 'Create an Account'\n * @param {function} hitCallback - Called after processing a hit.\n */\n\nexport function outboundLink(args, hitCallback, trackerNames) {\n if (typeof hitCallback !== 'function') {\n warn('hitCallback function is required');\n return;\n }\n\n if (typeof ga === 'function') {\n // Simple Validation\n if (!args || !args.label) {\n warn('args.label is required in outboundLink()');\n return;\n } // Required Fields\n\n\n var fieldObject = {\n hitType: 'event',\n eventCategory: 'Outbound',\n eventAction: 'Click',\n eventLabel: _format(args.label)\n };\n var safetyCallbackCalled = false;\n\n var safetyCallback = function safetyCallback() {\n // This prevents a delayed response from GA\n // causing hitCallback from being fired twice\n safetyCallbackCalled = true;\n hitCallback();\n }; // Using a timeout to ensure the execution of critical application code\n // in the case when the GA server might be down\n // or an ad blocker prevents sending the data\n // register safety net timeout:\n\n\n var t = setTimeout(safetyCallback, 250);\n\n var clearableCallbackForGA = function clearableCallbackForGA() {\n clearTimeout(t);\n\n if (!safetyCallbackCalled) {\n hitCallback();\n }\n };\n\n fieldObject.hitCallback = clearableCallbackForGA; // Send to GA\n\n send(fieldObject, trackerNames);\n } else {\n // if ga is not defined, return the callback so the application\n // continues to work as expected\n setTimeout(hitCallback, 0);\n }\n}\nexport var testModeAPI = TestModeAPI;\nexport default {\n initialize: initialize,\n ga: ga,\n set: set,\n send: send,\n pageview: pageview,\n modalview: modalview,\n timing: timing,\n event: event,\n exception: exception,\n plugin: plugin,\n outboundLink: outboundLink,\n testModeAPI: TestModeAPI\n};","export default function (options) {\n var gaAddress = 'https://www.google-analytics.com/analytics.js';\n\n if (options && options.gaAddress) {\n gaAddress = options.gaAddress;\n } else if (options && options.debug) {\n gaAddress = 'https://www.google-analytics.com/analytics_debug.js';\n } // https://developers.google.com/analytics/devguides/collection/analyticsjs/\n\n /* eslint-disable */\n\n\n (function (i, s, o, g, r, a, m) {\n i['GoogleAnalyticsObject'] = r;\n i[r] = i[r] || function () {\n (i[r].q = i[r].q || []).push(arguments);\n }, i[r].l = 1 * new Date();\n a = s.createElement(o), m = s.getElementsByTagName(o)[0];\n a.async = 1;\n a.src = g;\n m.parentNode.insertBefore(a, m);\n })(window, document, 'script', gaAddress, 'ga');\n /* eslint-enable */\n\n}","export default function removeLeadingSlash(string) {\n if (string.substring(0, 1) === '/') {\n return string.substring(1);\n }\n\n return string;\n}","function ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(source, true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(source).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nimport UnboundOutboundLink from './components/OutboundLink';\nimport * as Defaults from './core';\nexport var initialize = Defaults.initialize;\nexport var ga = Defaults.ga;\nexport var set = Defaults.set;\nexport var send = Defaults.send;\nexport var pageview = Defaults.pageview;\nexport var modalview = Defaults.modalview;\nexport var timing = Defaults.timing;\nexport var event = Defaults.event;\nexport var exception = Defaults.exception;\nexport var plugin = Defaults.plugin;\nexport var outboundLink = Defaults.outboundLink;\nexport var testModeAPI = Defaults.testModeAPI;\nUnboundOutboundLink.origTrackLink = UnboundOutboundLink.trackLink;\nUnboundOutboundLink.trackLink = Defaults.outboundLink;\nexport var OutboundLink = UnboundOutboundLink;\nexport default _objectSpread({}, Defaults, {\n OutboundLink: OutboundLink\n});","import moment from \"moment\";\r\nimport i18n from \"./i18n\";\r\nimport Axios from 'axios';\r\nimport ReactGA from 'react-ga';\r\n\r\nimport * as FrontendStatic from \"../bundles/Frontend/FrontendStatic\";\r\nimport * as BackendStatic from \"../bundles/Backend/BackendStatic\";\r\nimport * as SharekanStatic from \"../bundles/SharekanStatic\";\r\nimport * as Color from '@material-ui/core/colors';\r\nimport React from \"react\";\r\nimport MenuItem from \"@material-ui/core/MenuItem\";\r\n\r\nimport {ErrorMessageProtocol} from \"../bundles/base/ErrorMessage/ErrorMessage\";\r\n\r\nimport * as HolidayJp from '@holiday-jp/holiday_jp';\r\n\r\nimport Amplify, {API, graphqlOperation, Storage} from 'aws-amplify';\r\nimport config from \"../../../src/aws-exports\";\r\nimport {messagesByChannelSortedByCreatedAt} from '../../../src/graphql/queries';\r\nimport {createMessage, createReservation, updateReservation} from '../../../src/graphql/mutations';\r\nimport Table from \"@material-ui/core/Table\";\r\nimport TableHead from \"@material-ui/core/TableHead\";\r\nimport TableRow from \"@material-ui/core/TableRow\";\r\nimport TableCell from \"@material-ui/core/TableCell\";\r\nimport TableBody from \"@material-ui/core/TableBody\";\r\n\r\nAmplify.configure(config);\r\n\r\nexport const BOOKED_TYPE_INCLUDED = 1;\r\nexport const BOOKED_TYPE_AFTER_START = 2;\r\nexport const BOOKED_TYPE_BEFORE_END = 3;\r\nexport const BOOKED_TYPE_ALL = 4;\r\n\r\nconst priority_table = [\r\n Color.red[200], //pink[200],\r\n Color.purple[200], //deepPurple[200],\r\n Color.indigo[200], //blue[200],\r\n Color.lightBlue[200], //cyan[200],\r\n Color.teal[200], //green[200],\r\n Color.lightGreen[200], //lime[200],\r\n Color.yellow[200], //amber[200],\r\n Color.orange[200], //deepOrange[200],\r\n Color.brown[200], //grey[200],\r\n Color.blueGrey[200]\r\n];\r\n\r\nconst colors = {\r\n amber: Color.amber[500],\r\n blue: Color.blue[500],\r\n blueGrey: Color.blueGrey[500],\r\n brown: Color.brown[500],\r\n common: Color.common[500],\r\n cyan: Color.cyan[500],\r\n deepOrange: Color.deepOrange[500],\r\n deepPurple: Color.deepPurple[500],\r\n green: Color.green[500],\r\n grey: Color.grey[500],\r\n indigo: Color.indigo[500],\r\n lightBlue: Color.lightBlue[500],\r\n lightGreen: Color.lightGreen[500],\r\n lime: Color.lime[500],\r\n orange: Color.orange[500],\r\n pink: Color.pink[500],\r\n purple: Color.purple[500],\r\n red: Color.red[500],\r\n teal: Color.teal[500],\r\n yellow: Color.yellow[500],\r\n};\r\n\r\nexport default class Toolkit\r\n{\r\n static FRONTEND_HOST = '';\r\n\r\n static deepCopy(obj)\r\n {\r\n let check = () =>\r\n {\r\n // Object||ArrayならリストにINして循環参照チェック\r\n let checkList = [];\r\n return function (key, value)\r\n {\r\n // 初回用\r\n if (key === '')\r\n {\r\n checkList.push(value);\r\n return value;\r\n }\r\n // Node,Elementの類はカット\r\n if (value instanceof Node)\r\n {\r\n return undefined;\r\n }\r\n // Object,Arrayなら循環参照チェック\r\n if (typeof value === 'object' && value !== null)\r\n {\r\n return checkList.every(function (v, i, a)\r\n {\r\n return value !== v;\r\n }) ? value : undefined;\r\n }\r\n return value;\r\n }\r\n };\r\n\r\n return JSON.parse(JSON.stringify(obj, check()));\r\n }\r\n\r\n static getWindowSize()\r\n {\r\n var w = window,\r\n d = document,\r\n e = d.documentElement,\r\n g = d.getElementsByTagName('body')[0],\r\n w = w.innerWidth || e.clientWidth || g.clientWidth,\r\n h = w.innerHeight || e.clientHeight || g.clientHeight;\r\n\r\n return {\r\n width: w,\r\n height: h\r\n };\r\n }\r\n\r\n static isSmartPhone()\r\n {\r\n const ua = window.navigator.userAgent.toLowerCase();\r\n return ua.indexOf('iphone') > 0 || ua.indexOf('ipod') > 0 || ua.indexOf('android') > 0 && ua.indexOf('mobile') > 0;\r\n }\r\n\r\n static setCookie(key, value)\r\n {\r\n document.cookie = key + '=' + encodeURIComponent(value);\r\n }\r\n\r\n static getCookie(key)\r\n {\r\n console.log(document.cookie);\r\n for (let c of document.cookie.split(/;[ ]*/))\r\n {\r\n let cArray = c.split('=');\r\n if (cArray[0] === key)\r\n return decodeURIComponent(cArray[1]);\r\n }\r\n return null;\r\n }\r\n\r\n static deleteCookie(key)\r\n {\r\n if (document.cookie)\r\n {\r\n for (let c of document.cookie.split(/;[ ]*/))\r\n {\r\n let cArray = c.split('=');\r\n if (cArray[0] === key)\r\n {\r\n document.cookie = c + \"; max-age=0\";\r\n return;\r\n }\r\n }\r\n }\r\n }\r\n\r\n static isDummyEmail(email)\r\n {\r\n return email.toString().match(/dummy_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/)\r\n }\r\n\r\n static generateId()\r\n {\r\n var random = Math.floor(Math.random() * 100000);\r\n\r\n return random + new Date().getTime();\r\n }\r\n\r\n static getDisplayOrderId(event)\r\n {\r\n if (event.order.order_id && String(event.order.order_id).startsWith(\"_new_\"))\r\n return '新規予約';\r\n let order_id = event.order.id;\r\n if (String(order_id).startsWith(\"_new_\"))\r\n return order_id;\r\n if (Number(order_id) < 100000000)\r\n order_id = ('00000000' + order_id).slice(-8);\r\n return 'SH' + order_id;\r\n }\r\n\r\n static generateUuid()\r\n {\r\n let chars = \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".split(\"\");\r\n for (let i = 0, len = chars.length; i < len; i++)\r\n {\r\n switch (chars[i])\r\n {\r\n case \"x\":\r\n chars[i] = Math.floor(Math.random() * 16).toString(16);\r\n break;\r\n case \"y\":\r\n chars[i] = (Math.floor(Math.random() * 4) + 8).toString(16);\r\n break;\r\n }\r\n }\r\n return chars.join(\"\");\r\n }\r\n\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n // Component系\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n static hourmins(min = '00:00', max = '24:00')\r\n {\r\n let [min_hour, min_min] = min.split(\":\");\r\n let min_step = Number(min_hour) * 2 + (Number(min_min) === 30 ? 1 : 0);\r\n\r\n let [max_hour, max_min] = max.split(\":\");\r\n let max_step = Number(max_hour) * 2 + (Number(max_min) === 30 ? 1 : 0);\r\n\r\n let selectList = [];\r\n // for (let hour = 0; hour <= 24; hour++)\r\n // {\r\n // let displayHour = hour < 10 ? \"0\" + hour : hour;\r\n //\r\n // for (let min = 0; min < 60; min += 30)\r\n // {\r\n // if (hour !== 24 || min === 0)\r\n // {\r\n // let displayMin = min < 10 ? \"0\" + min : min;\r\n //\r\n // selectList.push(\r\n // \r\n // );\r\n // }\r\n // }\r\n // }\r\n\r\n for (let i = min_step; i <= max_step; i++)\r\n {\r\n let h = ('0' + Math.floor(i / 2)).slice(-2);\r\n let m = i % 2 === 0 ? '00' : '30';\r\n selectList.push(\r\n \r\n );\r\n }\r\n\r\n return selectList;\r\n }\r\n\r\n /**\r\n * @param datetime_str {string}\r\n * @returns {moment.Moment}\r\n */\r\n static getEndOfReservation(datetime_str)\r\n {\r\n let datetime = moment(datetime_str);\r\n if (datetime.hours() === 0 && datetime.minutes() === 0)\r\n datetime.subtract(1, 'days');\r\n return datetime;\r\n }\r\n\r\n /**\r\n * 予約終了日付設定\r\n * @param datetime {moment.Moment}\r\n */\r\n static setEndDateOfReservation(datetime)\r\n {\r\n if (datetime.hours() === 0 && datetime.minutes() === 0)\r\n return datetime.add(1, 'days');\r\n return datetime\r\n }\r\n\r\n /**\r\n * 予約終了時刻設定\r\n * @param origin {moment.Moment}\r\n * @param hour {int}\r\n * @param minute {int}\r\n */\r\n static setEndTimeOfReservation(origin, hour, minute)\r\n {\r\n if ((hour === 0 && minute === 0) || (origin.hours() === 0 && origin.minutes() === 0))\r\n origin.subtract(1, 'days');\r\n origin.hours(hour);\r\n origin.minutes(minute);\r\n return origin\r\n }\r\n\r\n static getItemDescriptionOneLine(item_description)\r\n {\r\n let _description = \"\";\r\n if (item_description)\r\n // _description = JSON.parse(item_description).blocks[0].text;\r\n _description = (item_description.split(/\\n|\\r|\\n\\r/))[0];\r\n return _description;\r\n }\r\n\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n // 計算系\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n\r\n static tax()\r\n {\r\n return 0.1;\r\n }\r\n\r\n static calculateTotal(event, item_list = null)\r\n {\r\n let bill = event.bill;\r\n\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n // 支払\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n // 元価格合計\r\n let totalPrice = 0;\r\n // 割引・割増し合計\r\n let totalPriceExtra = 0;\r\n // 割引・割増し適用後合計\r\n let totalPriceWithExtra = 0;\r\n\r\n // extra合計\r\n let totalExtra = 0;\r\n // extraクーポン合計\r\n let totalExtraPriceExtra = 0;\r\n\r\n console.log(\"************************** calculateTotal **************************\");\r\n console.log(event);\r\n console.log(event.another_reservation);\r\n\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n // 支払\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n // 支払い金額合計\r\n let paidTotal = 0;\r\n // 払い戻し金額合計\r\n let refundedTotal = 0;\r\n // 請求中合計\r\n let billingTotal = 0;\r\n // 支払い後残金\r\n let paidAfterLeft = 0;\r\n\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n // 主予約\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n if (event.item_reservation)\r\n {\r\n let mainItemReservation = event.item_reservation;\r\n let price_extra = parseInt(mainItemReservation.price_extra ? mainItemReservation.price_extra : 0);\r\n totalPriceExtra += price_extra; // 割引・割増し合計\r\n\r\n let sum_price = 0;\r\n if (item_list != null)\r\n {\r\n let itemEntity = Toolkit.findSelectedItemById(item_list, mainItemReservation.item_id);\r\n let price = Toolkit.calculateItemReservationPrice(event, item_list, mainItemReservation, itemEntity);\r\n sum_price += price * mainItemReservation.amount;\r\n }\r\n else if (mainItemReservation.price_summary > 0)\r\n {\r\n sum_price = mainItemReservation.price_summary * mainItemReservation.amount;\r\n }\r\n\r\n totalPrice += sum_price; // 元価格合計\r\n totalPriceWithExtra += sum_price + price_extra; // 割引・割増し適用後合計\r\n console.log(\" + main item (\" + mainItemReservation.id + \") : \" + totalPriceWithExtra);\r\n }\r\n\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n // 副予約\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n if (event.another_reservation)\r\n {\r\n event.another_reservation.map((subItemReservation) =>\r\n {\r\n console.log(\" - has an another reservation : \" + subItemReservation.item_reservation_id);\r\n\r\n if (subItemReservation.id !== event.item_reservation.id)\r\n {\r\n let price_extra = parseInt(subItemReservation.price_extra ? subItemReservation.price_extra : 0);\r\n totalPriceExtra += price_extra; // 割引・割増し合計\r\n\r\n let sum_price = 0;\r\n if (item_list != null)\r\n {\r\n let itemEntity = Toolkit.findSelectedItemById(item_list, subItemReservation.item_id);\r\n let price = Toolkit.calculateItemReservationPrice(event, item_list, subItemReservation, itemEntity);\r\n sum_price += price * subItemReservation.amount;\r\n }\r\n else if (subItemReservation.price_summary > 0)\r\n {\r\n sum_price = subItemReservation.price_summary * subItemReservation.amount;\r\n }\r\n\r\n totalPrice += sum_price; // 元価格合計\r\n totalPriceWithExtra += sum_price + price_extra; // 割引・割増し適用後合計\r\n console.log(\" - sub item (\" + subItemReservation.id + \") : \" + totalPriceWithExtra);\r\n }\r\n });\r\n }\r\n else\r\n {\r\n console.log(\" - No another reservation\");\r\n }\r\n\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n // Extra\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n if (event.order.reservation_extra)\r\n {\r\n event.order.reservation_extra.map((reservationExtraEntity) =>\r\n {\r\n totalExtra += parseInt(reservationExtraEntity.price);\r\n\r\n console.log(\" + extra : \" + reservationExtraEntity.price);\r\n });\r\n }\r\n\r\n let invoiceTotal = parseInt(totalPriceWithExtra) + parseInt(totalExtra);\r\n if (invoiceTotal < 0)\r\n invoiceTotal = 0;\r\n let invoiceTax = Math.floor(invoiceTotal * this.tax());\r\n\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n // 支払い\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n if (bill && bill.payment)\r\n {\r\n bill.payment.map((paymentEntity) =>\r\n {\r\n switch (paymentEntity.payment_status)\r\n {\r\n case BackendStatic.PAYMENT_STATUS_NOT_YET:\r\n case BackendStatic.PAYMENT_STATUS_BILLING:\r\n case BackendStatic.PAYMENT_STATUS_FAILED:\r\n case BackendStatic.PAYMENT_STATUS_AUTHORIZE:\r\n case BackendStatic.PAYMENT_STATUS_UNKNOWN:\r\n billingTotal += parseInt(paymentEntity.price);\r\n break;\r\n case BackendStatic.PAYMENT_STATUS_PAID:\r\n paidTotal += parseInt(paymentEntity.paid_price);\r\n break;\r\n case BackendStatic.PAYMENT_STATUS_REFUNDED:\r\n refundedTotal += parseInt(paymentEntity.paid_price);\r\n break;\r\n }\r\n });\r\n }\r\n\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n // 未払い残金\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n paidAfterLeft = invoiceTotal + invoiceTax - paidTotal - billingTotal;\r\n\r\n let ret = {\r\n // アイテム利用\r\n totalPrice: totalPrice, // 元価格合計\r\n totalPriceExtra: totalPriceExtra, // 割引・割増し合計\r\n totalPriceWithExtra: totalPriceWithExtra, // 割引・割増し適用後合計\r\n\r\n // extra\r\n totalExtra: totalExtra, // Extra合計\r\n\r\n invoiceTotal: invoiceTotal, //請求総額\r\n invoiceTax: invoiceTax, // 税金\r\n\r\n paidTotal: paidTotal, // 支払い総額\r\n refundedTotal: refundedTotal,\r\n billingTotal: billingTotal,\r\n paidAfterLeft: paidAfterLeft, // 残金\r\n };\r\n console.log(ret);\r\n\r\n return ret;\r\n }\r\n\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n // 見積もりロジック\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n\r\n /**\r\n * 予約の利用料金計算\r\n * @param event イベント\r\n * @param item_list アイテムリスト\r\n * @param from 計算上の開始日時指定\r\n * @param to 計算上の終了日時指定\r\n * @returns {number}\r\n */\r\n static calculateTotalPrice(event, item_list, from = null, to = null)\r\n {\r\n let total = 0;\r\n let detail = [];\r\n\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n // 主予約の見積\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n {\r\n let itemEntity = Toolkit.findSelectedItemById(item_list, event.item_reservation.item_id);\r\n if (itemEntity.item_id)\r\n {\r\n let price = Toolkit.calculateItemReservationPrice(event, item_list, event.item_reservation, itemEntity, from, to);\r\n let sum_price = price * event.item_reservation.amount;\r\n total += sum_price;\r\n\r\n detail.push({\r\n type: itemEntity.reservation_type,\r\n item_name: itemEntity.item_name,\r\n price: price,\r\n amount: event.item_reservation.amount,\r\n sum_price: sum_price,\r\n })\r\n }\r\n }\r\n\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n // 副予約の見積\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n event.another_reservation.map((itemReservationEntity) =>\r\n {\r\n if (itemReservationEntity.id !== event.item_reservation.id)\r\n {\r\n let itemEntity = Toolkit.findSelectedItemById(item_list, itemReservationEntity.item_id);\r\n let price = Toolkit.calculateItemReservationPrice(event, item_list, itemReservationEntity, itemEntity, from, to);\r\n let sum_price = price * itemReservationEntity.amount;\r\n total += sum_price;\r\n\r\n detail.push({\r\n type: itemEntity.reservation_type,\r\n item_name: itemEntity.item_name,\r\n price: price,\r\n amount: itemReservationEntity.amount,\r\n sum_price: sum_price,\r\n });\r\n }\r\n });\r\n\r\n return {\r\n total: total,\r\n detail: detail\r\n };\r\n }\r\n\r\n /**\r\n * クーポン割引計算\r\n * @param couponEntity 適用するクーポン\r\n * @param event イベント\r\n * @param item_list アイテムリスト\r\n * @returns {number}\r\n */\r\n static calculateDiscount(couponEntity, event, item_list)\r\n {\r\n console.log(\"calculate discount...\");\r\n\r\n //最低利用時間の確認\r\n if (couponEntity.min_rent_hours > 0)\r\n {\r\n if (couponEntity.item_id > 0)\r\n {\r\n for (let itemReservation of Toolkit.findItemReservationsInEvent(event, couponEntity.item_id))\r\n {\r\n if (moment(itemReservation.datetime_from).add(couponEntity.min_rent_hours, 'h') > moment(itemReservation.datetime_to))\r\n return 0;\r\n }\r\n }\r\n else\r\n {\r\n if (moment(event.item_reservation.datetime_from).add(couponEntity.min_rent_hours, 'h') > moment(event.item_reservation.datetime_to))\r\n return 0;\r\n }\r\n }\r\n\r\n let total = 0;\r\n let getFrom = _reservation_from =>\r\n {\r\n if (couponEntity.is_target)\r\n {\r\n let from = moment(couponEntity.target_datetime_from);\r\n if (from.isAfter(moment(_reservation_from)))\r\n return couponEntity.target_datetime_from;\r\n }\r\n return null;\r\n };\r\n\r\n let getTo = _reservation_to =>\r\n {\r\n if (couponEntity.is_target)\r\n {\r\n let to = moment(couponEntity.target_datetime_to);\r\n if (to.isBefore(moment(_reservation_to)))\r\n return couponEntity.target_datetime_to;\r\n }\r\n return null;\r\n };\r\n\r\n if (couponEntity.item_id)\r\n {\r\n for (let itemReservation of Toolkit.findItemReservationsInEvent(event, couponEntity.item_id))\r\n {\r\n let item = Toolkit.findSelectedItemById(item_list, itemReservation.item_id);\r\n total += Toolkit.calculateItemReservationPrice(event, item_list, itemReservation, item, getFrom(itemReservation.datetime_from), getTo(itemReservation.datetime_to)) * itemReservation.amount;\r\n }\r\n }\r\n else\r\n {\r\n {\r\n let itemEntity = Toolkit.findSelectedItemById(item_list, event.item_reservation.item_id);\r\n total += Toolkit.calculateItemReservationPrice(event, item_list, event.item_reservation, itemEntity, getFrom(event.item_reservation.datetime_from), getTo(event.item_reservation.datetime_to)) * event.item_reservation.amount;\r\n }\r\n\r\n event.another_reservation.map((itemReservation) =>\r\n {\r\n if (itemReservation.id !== event.item_reservation.id)\r\n {\r\n let item = Toolkit.findSelectedItemById(item_list, itemReservation.item_id);\r\n total += Toolkit.calculateItemReservationPrice(event, item_list, itemReservation, item, getFrom(itemReservation.datetime_from), getTo(itemReservation.datetime_to)) * itemReservation.amount;\r\n }\r\n });\r\n }\r\n\r\n switch (couponEntity.discount_type)\r\n {\r\n case BackendStatic.COUPON_DISCOUNT_TYPE_PRICE:\r\n return total > couponEntity.discount ? couponEntity.discount : total;\r\n case BackendStatic.COUPON_DISCOUNT_TYPE_RATIO:\r\n return Math.ceil(total * (couponEntity.discount / 100));\r\n }\r\n return 0;\r\n }\r\n\r\n /**\r\n * 割引適用後 税別合計金額\r\n * @param applied_coupon_list クーポン一覧\r\n * @param event イベント\r\n * @param item_list アイテム一覧\r\n * @returns {number}\r\n */\r\n static calculateTotalPriceWithDiscount(applied_coupon_list, event, item_list)\r\n {\r\n let totalPriceEntity = Toolkit.calculateTotalPrice(event, item_list);\r\n let total = totalPriceEntity.total;\r\n let discount = 0;\r\n applied_coupon_list.map((couponEntity) =>\r\n {\r\n discount += Toolkit.calculateDiscount(couponEntity, event, item_list);\r\n });\r\n\r\n return total - discount;\r\n }\r\n\r\n /**\r\n * 税金計算\r\n * @param applied_coupon_list クーポン一覧\r\n * @param event イベント\r\n * @param item_list アイテム一覧\r\n * @returns {number}\r\n */\r\n static calculateTax(applied_coupon_list, event, item_list)\r\n {\r\n let sum = Toolkit.calculateTotalPriceWithDiscount(applied_coupon_list, event, item_list);\r\n let tax = sum * Toolkit.tax();\r\n\r\n return parseInt(tax);\r\n }\r\n\r\n /**\r\n * 指定した item_reservation の価格計算\r\n * @param event\r\n * @param item_list\r\n * @param itemReservation\r\n * @param itemEntity\r\n * @param from 計算上の開始日時指定\r\n * @param to 計算上の終了日時指定\r\n * @returns {number}\r\n */\r\n static calculateItemReservationPrice(event, item_list, itemReservation, itemEntity, from = null, to = null)\r\n {\r\n let price = 0;\r\n if (!from)\r\n from = itemReservation.datetime_from;\r\n if (!to)\r\n to = itemReservation.datetime_to;\r\n\r\n let lentDayList = Toolkit.createDateList(from, to);\r\n\r\n let startDay = moment(lentDayList[0]);\r\n let startDateTime = moment(from);\r\n\r\n let endDay = lentDayList.length === 1 ? moment(lentDayList[0]) : moment(lentDayList[lentDayList.length - 1]);\r\n let endDateTime = moment(to);\r\n\r\n lentDayList.some((date) =>\r\n {\r\n // その日の課金ルールを取得\r\n let appliedPrice = Toolkit.findAppliedPrice(date, itemEntity.item_prices);\r\n let thisDay = moment(date);\r\n\r\n switch (appliedPrice.price_unit)\r\n {\r\n case BackendStatic.PRICE_UNIT_MINUTE:\r\n if (startDay.isSame(thisDay, \"day\") && endDay.isSame(thisDay, \"day\"))\r\n {\r\n // 開始日と終了日が同一\r\n let differenceMin = endDateTime.diff(startDateTime, \"minutes\");\r\n price += appliedPrice.price * differenceMin;\r\n\r\n console.log(\"[PRICE_UNIT_HOUR] (\" + date + \") same day : differenceMin=\" + differenceMin + \", price=\" + (appliedPrice.price * differenceMin));\r\n }\r\n else if (startDay.isSame(thisDay, \"day\"))\r\n {\r\n // 時間割:startDateTime ~ 23:59まで\r\n let endOfDay = thisDay.clone().endOf(\"day\").add(1, \"seconds\");\r\n let differenceMin = endOfDay.diff(startDateTime, \"minutes\");\r\n\r\n price += appliedPrice.price * differenceMin;\r\n\r\n console.log(\"[PRICE_UNIT_HOUR] (\" + date + \") start day : differenceMin=\" + differenceMin + \", price=\" + (appliedPrice.price * differenceMin));\r\n }\r\n else if (endDay.isSame(thisDay, \"day\"))\r\n {\r\n // 時間割:0:00 ~ endDateTime\r\n let startOfDay = thisDay.clone().startOf(\"day\");\r\n let differenceMin = endDateTime.diff(startOfDay, \"hours\");\r\n\r\n price += appliedPrice.price * differenceMin;\r\n\r\n console.log(\"[PRICE_UNIT_HOUR] (\" + date + \") end day : differenceMin=\" + differenceMin + \", price=\" + (appliedPrice.price * differenceMin));\r\n }\r\n else\r\n {\r\n // 丸一日課金\r\n price += appliedPrice.price * 24 * 60;\r\n\r\n console.log(\"[PRICE_UNIT_HOUR] (\" + date + \") a day : price=\" + appliedPrice.price);\r\n }\r\n break;\r\n\r\n case BackendStatic.PRICE_UNIT_HOUR:\r\n if (startDay.isSame(thisDay, \"day\") && endDay.isSame(thisDay, \"day\"))\r\n {\r\n // 開始日と終了日が同一\r\n let differenceHour = endDateTime.diff(startDateTime, \"hours\");\r\n price += appliedPrice.price * differenceHour;\r\n\r\n console.log(\"[PRICE_UNIT_HOUR] (\" + date + \") same day : differenceHour=\" + differenceHour + \", price=\" + (appliedPrice.price * differenceHour));\r\n }\r\n else if (startDay.isSame(thisDay, \"day\"))\r\n {\r\n // 時間割:startDateTime ~ 23:59まで\r\n let endOfDay = thisDay.clone().endOf(\"day\").add(1, \"seconds\");\r\n let differenceHour = endOfDay.diff(startDateTime, \"hours\");\r\n\r\n price += appliedPrice.price * differenceHour;\r\n\r\n console.log(\"[PRICE_UNIT_HOUR] (\" + date + \") start day : differenceHour=\" + differenceHour + \", price=\" + (appliedPrice.price * differenceHour));\r\n }\r\n else if (endDay.isSame(thisDay, \"day\"))\r\n {\r\n // 時間割:0:00 ~ endDateTime\r\n let startOfDay = thisDay.clone().startOf(\"day\");\r\n let differenceHour = endDateTime.diff(startOfDay, \"hours\");\r\n\r\n price += appliedPrice.price * differenceHour;\r\n\r\n console.log(\"[PRICE_UNIT_HOUR] (\" + date + \") end day : differenceHour=\" + differenceHour + \", price=\" + (appliedPrice.price * differenceHour));\r\n }\r\n else\r\n {\r\n // 丸一日課金\r\n price += appliedPrice.price * 24;\r\n\r\n console.log(\"[PRICE_UNIT_HOUR] (\" + date + \") a day : price=\" + appliedPrice.price);\r\n }\r\n break;\r\n\r\n case BackendStatic.PRICE_UNIT_DAY: // 日単位で課金\r\n price += appliedPrice.price;\r\n\r\n console.log(\"[PRICE_UNIT_DAY] (\" + date + \") add price : \" + appliedPrice.price);\r\n break;\r\n\r\n case BackendStatic.PRICE_UNIT_DAY_HOUR: // 日単位で課金\r\n if (startDay.isSame(thisDay, \"day\") && endDay.isSame(thisDay, \"day\"))\r\n {\r\n // 開始日と終了日が同一\r\n let differenceHour = endDateTime.diff(startDateTime, \"hours\");\r\n let priceRatio = differenceHour / 24;\r\n\r\n price += appliedPrice.price * priceRatio;\r\n\r\n console.log(\"[PRICE_UNIT_DAY_HOUR] (\" + date + \") same day : differenceHour=\" + differenceHour + \", priceRatio=\" + priceRatio + \", price=\" + (appliedPrice.price * priceRatio));\r\n }\r\n else if (startDay.isSame(thisDay, \"day\"))\r\n {\r\n // 時間割:startDateTime ~ 23:59まで\r\n let endOfDay = thisDay.clone().endOf(\"day\").add(1, \"seconds\");\r\n let differenceHour = endOfDay.diff(startDateTime, \"hours\");\r\n let priceRatio = differenceHour / 24;\r\n\r\n price += appliedPrice.price * priceRatio;\r\n\r\n console.log(\"[PRICE_UNIT_DAY_HOUR] (\" + date + \") start day : differenceHour=\" + differenceHour + \", priceRatio=\" + priceRatio + \", price=\" + (appliedPrice.price * priceRatio));\r\n }\r\n else if (endDay.isSame(thisDay, \"day\"))\r\n {\r\n // 時間割:0:00 ~ endDateTime\r\n let startOfDay = thisDay.clone().startOf(\"day\");\r\n let differenceHour = endDateTime.diff(startOfDay, \"hours\");\r\n let priceRatio = differenceHour / 24;\r\n\r\n price += appliedPrice.price * priceRatio;\r\n\r\n console.log(\"[PRICE_UNIT_DAY_HOUR] (\" + date + \") end day : differenceHour=\" + differenceHour + \", priceRatio=\" + priceRatio + \", price=\" + (appliedPrice.price * priceRatio));\r\n }\r\n else\r\n {\r\n // 丸一日課金\r\n price += appliedPrice.price;\r\n\r\n console.log(\"[PRICE_UNIT_DAY_HOUR] (\" + date + \") a day : price=\" + appliedPrice.price);\r\n }\r\n break;\r\n\r\n case BackendStatic.PRICE_UNIT_LENT: // 貸した回数で課金(貸出日の価格が適用)\r\n if (startDay.isSame(thisDay, \"day\"))\r\n {\r\n price = appliedPrice.price;\r\n console.log(\"[PRICE_UNIT_LENT] (\" + date + \") add price : \" + appliedPrice.price);\r\n }\r\n break;\r\n case BackendStatic.PRICE_UNIT_RATIO: // 貸出アイテム額の割合課金\r\n if (itemEntity.reservation_type === BackendStatic.ITEM_RESERVATION_TYPE_OPTION)\r\n {\r\n let f = thisDay.clone().startOf(\"day\");\r\n let t = thisDay.clone().endOf(\"day\").add(1, \"seconds\");\r\n\r\n if (startDay.isSame(thisDay, \"day\") && endDay.isSame(thisDay, \"day\"))\r\n {\r\n // 開始日と終了日が同一\r\n f = startDateTime;\r\n t = endDateTime;\r\n }\r\n else if (startDay.isSame(thisDay, \"day\"))\r\n {\r\n // startDateTime ~ 23:59まで\r\n f = startDateTime;\r\n }\r\n else if (endDay.isSame(thisDay, \"day\"))\r\n {\r\n // 0:00 ~ endDateTime\r\n t = endDateTime;\r\n }\r\n\r\n for (let reservation of Toolkit.convertEventToReservations(event))\r\n {\r\n let item = Toolkit.findSelectedItemById(item_list, reservation.item_id);\r\n if (item.reservation_type === BackendStatic.ITEM_RESERVATION_TYPE_ITEM)\r\n {\r\n let _from = f.clone();\r\n let _to = t.clone();\r\n let reservation_from = moment(reservation.datetime_from);\r\n let reservation_to = moment(reservation.datetime_to);\r\n if (_to.isBefore(reservation_from) || _from.isAfter(reservation_to)) continue;\r\n if (_from.isSame(reservation_from, \"day\") && _from.isBefore(reservation_from)) _from = reservation_from;\r\n if (_to.clone().subtract(1, 'second').isSame(reservation_to.clone().subtract(1, 'second'), \"day\") && _to.isAfter(reservation_to)) _to = reservation_to;\r\n price += parseInt(Toolkit.calculateItemReservationPrice(event, item_list, reservation, item, _from, _to) * appliedPrice.price / 100);\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n });\r\n\r\n return parseInt(price);\r\n }\r\n\r\n /**\r\n * 指定した item_reservation の価格内訳view\r\n * @param event\r\n * @param item_list\r\n * @param itemReservation\r\n * @param itemEntity\r\n * @returns Component\r\n */\r\n static calculateItemReservationDetail(event, item_list, itemReservation, itemEntity)\r\n {\r\n let details = [];\r\n let lentDayList = Toolkit.createDateList(itemReservation.datetime_from, itemReservation.datetime_to);\r\n\r\n let startDay = moment(lentDayList[0]);\r\n let startDateTime = moment(itemReservation.datetime_from);\r\n\r\n let endDay = lentDayList.length === 1 ? moment(lentDayList[0]) : moment(lentDayList[lentDayList.length - 1]);\r\n let endDateTime = moment(itemReservation.datetime_to);\r\n\r\n lentDayList.some((date) =>\r\n {\r\n // その日の課金ルールを取得\r\n let appliedPrice = Toolkit.findAppliedPrice(date, itemEntity.item_prices);\r\n let thisDay = moment(date);\r\n\r\n switch (appliedPrice.price_unit)\r\n {\r\n case BackendStatic.PRICE_UNIT_MINUTE:\r\n let differenceMin = 0;\r\n if (startDay.isSame(thisDay, \"day\") && endDay.isSame(thisDay, \"day\"))\r\n {\r\n // 開始日と終了日が同一\r\n differenceMin = endDateTime.diff(startDateTime, \"minutes\");\r\n }\r\n else if (startDay.isSame(thisDay, \"day\"))\r\n {\r\n // 時間割:startDateTime ~ 23:59まで\r\n let endOfDay = thisDay.clone().endOf(\"day\").add(1, \"seconds\");\r\n differenceMin = endOfDay.diff(startDateTime, \"minutes\");\r\n }\r\n else if (endDay.isSame(thisDay, \"day\"))\r\n {\r\n // 時間割:0:00 ~ endDateTime\r\n let startOfDay = thisDay.clone().startOf(\"day\");\r\n differenceMin = endDateTime.diff(startOfDay, \"hours\");\r\n }\r\n else\r\n {\r\n // 一日\r\n differenceMin = 24 * 60;\r\n }\r\n\r\n details.push(\r\n \r\n {moment(date).format('YYYY/M/D') + \" (\" + differenceMin + \"分)\"}\r\n {(appliedPrice.price).toLocaleString()}
分単位\r\n {parseInt(appliedPrice.price * differenceMin).toLocaleString()}\r\n \r\n );\r\n break;\r\n\r\n case BackendStatic.PRICE_UNIT_HOUR:\r\n let differenceHour = 0;\r\n\r\n if (startDay.isSame(thisDay, \"day\") && endDay.isSame(thisDay, \"day\"))\r\n {\r\n // 開始日と終了日が同一\r\n differenceHour = endDateTime.diff(startDateTime, \"hours\");\r\n }\r\n else if (startDay.isSame(thisDay, \"day\"))\r\n {\r\n // 時間割:startDateTime ~ 23:59まで\r\n let endOfDay = thisDay.clone().endOf(\"day\").add(1, \"seconds\");\r\n differenceHour = endOfDay.diff(startDateTime, \"hours\");\r\n }\r\n else if (endDay.isSame(thisDay, \"day\"))\r\n {\r\n // 時間割:0:00 ~ endDateTime\r\n let startOfDay = thisDay.clone().startOf(\"day\");\r\n differenceHour = endDateTime.diff(startOfDay, \"hours\");\r\n }\r\n else\r\n {\r\n // 丸一日課金\r\n differenceHour = 24;\r\n }\r\n\r\n details.push(\r\n \r\n {moment(date).format('YYYY/M/D') + \" (\" + differenceHour + \"時間)\"}\r\n {(appliedPrice.price).toLocaleString()}
時間単位\r\n {parseInt(appliedPrice.price * differenceHour).toLocaleString()}\r\n \r\n );\r\n break;\r\n\r\n case BackendStatic.PRICE_UNIT_DAY: // 日単位で課金\r\n details.push(\r\n \r\n {moment(date).format('YYYY/M/D')}\r\n {(appliedPrice.price).toLocaleString()}
日単位\r\n {(appliedPrice.price).toLocaleString()}\r\n \r\n );\r\n break;\r\n\r\n case BackendStatic.PRICE_UNIT_DAY_HOUR: // 日単位で課金\r\n {\r\n let differenceHour = 0;\r\n if (startDay.isSame(thisDay, \"day\") && endDay.isSame(thisDay, \"day\"))\r\n {\r\n // 開始日と終了日が同一\r\n differenceHour = endDateTime.diff(startDateTime, \"hours\");\r\n }\r\n else if (startDay.isSame(thisDay, \"day\"))\r\n {\r\n // 時間割:startDateTime ~ 23:59まで\r\n let endOfDay = thisDay.clone().endOf(\"day\").add(1, \"seconds\");\r\n differenceHour = endOfDay.diff(startDateTime, \"hours\");\r\n }\r\n else if (endDay.isSame(thisDay, \"day\"))\r\n {\r\n // 時間割:0:00 ~ endDateTime\r\n let startOfDay = thisDay.clone().startOf(\"day\");\r\n differenceHour = endDateTime.diff(startOfDay, \"hours\");\r\n }\r\n else\r\n {\r\n // 丸一日課金\r\n differenceHour = 24;\r\n }\r\n\r\n details.push(\r\n \r\n {moment(date).format('YYYY/M/D') + \" (\" + differenceHour + \"時間)\"}\r\n {(appliedPrice.price).toLocaleString()}
日単位/時間割\r\n {parseInt(appliedPrice.price * differenceHour / 24).toLocaleString()}\r\n \r\n );\r\n }\r\n break;\r\n\r\n case BackendStatic.PRICE_UNIT_LENT: // 貸した回数で課金(貸出日の価格が適用)\r\n if (startDay.isSame(thisDay, \"day\"))\r\n {\r\n details.push(\r\n \r\n {startDay.format('YYYY/M/D')}\r\n {(appliedPrice.price).toLocaleString()}
貸出回数\r\n {(appliedPrice.price).toLocaleString()}\r\n \r\n );\r\n }\r\n break;\r\n case BackendStatic.PRICE_UNIT_RATIO: // 貸出アイテム額の割合課金\r\n if (itemEntity.reservation_type === BackendStatic.ITEM_RESERVATION_TYPE_OPTION)\r\n {\r\n let f = thisDay.clone().startOf(\"day\");\r\n let t = thisDay.clone().endOf(\"day\").add(1, \"seconds\");\r\n\r\n if (startDay.isSame(thisDay, \"day\") && endDay.isSame(thisDay, \"day\"))\r\n {\r\n // 開始日と終了日が同一\r\n f = startDateTime;\r\n t = endDateTime;\r\n }\r\n else if (startDay.isSame(thisDay, \"day\"))\r\n {\r\n // startDateTime ~ 23:59まで\r\n f = startDateTime;\r\n }\r\n else if (endDay.isSame(thisDay, \"day\"))\r\n {\r\n // 0:00 ~ endDateTime\r\n t = endDateTime;\r\n }\r\n\r\n let price = 0;\r\n for (let reservation of Toolkit.convertEventToReservations(event))\r\n {\r\n let item = Toolkit.findSelectedItemById(item_list, reservation.item_id);\r\n if (item.reservation_type === BackendStatic.ITEM_RESERVATION_TYPE_ITEM)\r\n {\r\n let _from = f.clone();\r\n let _to = t.clone();\r\n let reservation_from = moment(reservation.datetime_from);\r\n let reservation_to = moment(reservation.datetime_to);\r\n if (_to.isBefore(reservation_from) || _from.isAfter(reservation_to)) continue;\r\n if (_from.isSame(reservation_from, \"day\") && _from.isBefore(reservation_from)) _from = reservation_from;\r\n if (_to.clone().subtract(1, 'second').isSame(reservation_to.clone().subtract(1, 'second'), \"day\") && _to.isAfter(reservation_to)) _to = reservation_to;\r\n price += parseInt(Toolkit.calculateItemReservationPrice(event, item_list, reservation, item, _from, _to) * appliedPrice.price / 100);\r\n }\r\n }\r\n details.push(\r\n \r\n {thisDay.format('YYYY/M/D')}\r\n {appliedPrice.price}%
貸出アイテム額の割合課金\r\n {(price).toLocaleString()}\r\n \r\n );\r\n }\r\n break;\r\n }\r\n });\r\n\r\n return (\r\n \r\n \r\n \r\n 期間\r\n 単価\r\n 小計\r\n \r\n \r\n \r\n {details}\r\n \r\n
\r\n );\r\n }\r\n\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n // イベントのステータス\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n\r\n /**\r\n * 指定イベントの注文ステータス(ItemReservationの予約ステータスの合成)\r\n * @param event\r\n * @returns {number}\r\n */\r\n static currentOrderStatus(event)\r\n {\r\n let orderStatus = Toolkit.itemOrderStatus(event.item_reservation);\r\n\r\n event.another_reservation.map((itemReservationEntity) =>\r\n {\r\n let next = Toolkit.itemOrderStatus(itemReservationEntity);\r\n\r\n if (orderStatus > next)\r\n orderStatus = next;\r\n });\r\n\r\n return orderStatus;\r\n }\r\n\r\n /**\r\n * ItemReservation単体のの注文ステータス\r\n * @param itemReservationEntity\r\n * @returns {number}\r\n */\r\n static itemOrderStatus(itemReservationEntity)\r\n {\r\n if (itemReservationEntity)\r\n {\r\n switch (itemReservationEntity.reservation_status)\r\n {\r\n // 予約時間・アイテム・顧客の登録\r\n case BackendStatic.RESERVATION_STATUS_NOT_APPROVED: // 仮予約(承認待ち)\r\n case BackendStatic.RESERVATION_STATUS_RESCHEDULING: // リスケ依頼中\r\n return BackendStatic.ORDER_STATUS_1_NEW_RESERVATION;\r\n\r\n // 利用料金の請求\r\n case BackendStatic.RESERVATION_STATUS_WAIT_PAYMENT: // 支払い待ち\r\n return BackendStatic.ORDER_STATUS_2_PAYMENT;\r\n\r\n // 仮予約の承認\r\n case BackendStatic.RESERVATION_STATUS_APPROVED: // 予約\r\n return BackendStatic.ORDER_STATUS_3_APPROVE;\r\n\r\n // 貸渡\r\n case BackendStatic.RESERVATION_STATUS_USING: // 利用中\r\n case BackendStatic.RESERVATION_STATUS_NO_SHOW: // ノーショー\r\n return BackendStatic.ORDER_STATUS_4_LENT;\r\n\r\n // 返却\r\n case BackendStatic.RESERVATION_STATUS_DONE: // 利用終了\r\n case BackendStatic.RESERVATION_STATUS_REJECT: // リジェクト\r\n case BackendStatic.RESERVATION_STATUS_CANCELED: // キャンセル\r\n case BackendStatic.RESERVATION_STATUS_DELETED: // 削除\r\n return BackendStatic.ORDER_STATUS_5_RETURN;\r\n }\r\n }\r\n return BackendStatic.ORDER_STATUS_5_RETURN;\r\n }\r\n\r\n static showLentOperation(item_reservation)\r\n {\r\n if (!item_reservation)\r\n return false;\r\n\r\n switch (item_reservation.reservation_status)\r\n {\r\n case BackendStatic.RESERVATION_STATUS_NOT_APPROVED: // 仮予約(承認待ち)\r\n case BackendStatic.RESERVATION_STATUS_REJECT: // リジェクト\r\n case BackendStatic.RESERVATION_STATUS_WAIT_PAYMENT: // 支払い待ち\r\n case BackendStatic.RESERVATION_STATUS_RESCHEDULING: // リスケ依頼中\r\n case BackendStatic.RESERVATION_STATUS_CANCELED: // キャンセル\r\n return false;\r\n\r\n case BackendStatic.RESERVATION_STATUS_APPROVED: // 予約\r\n case BackendStatic.RESERVATION_STATUS_USING: // 利用中\r\n case BackendStatic.RESERVATION_STATUS_NO_SHOW: // ノーショー\r\n case BackendStatic.RESERVATION_STATUS_DONE: // 利用終了\r\n return true;\r\n\r\n case BackendStatic.RESERVATION_STATUS_DELETED: // 削除\r\n return false;\r\n }\r\n return false;\r\n }\r\n\r\n static showReturnOperation(item_reservation)\r\n {\r\n if (!item_reservation)\r\n return false;\r\n\r\n switch (item_reservation.reservation_status)\r\n {\r\n case BackendStatic.RESERVATION_STATUS_NOT_APPROVED: // 仮予約(承認待ち)\r\n case BackendStatic.RESERVATION_STATUS_REJECT: // リジェクト\r\n case BackendStatic.RESERVATION_STATUS_WAIT_PAYMENT: // 支払い待ち\r\n case BackendStatic.RESERVATION_STATUS_RESCHEDULING: // リスケ依頼中\r\n case BackendStatic.RESERVATION_STATUS_CANCELED: // キャンセル\r\n return false;\r\n\r\n case BackendStatic.RESERVATION_STATUS_APPROVED: // 予約\r\n return false;\r\n\r\n case BackendStatic.RESERVATION_STATUS_USING: // 利用中\r\n case BackendStatic.RESERVATION_STATUS_NO_SHOW: // ノーショー\r\n case BackendStatic.RESERVATION_STATUS_DONE: // 利用終了\r\n return true;\r\n\r\n case BackendStatic.RESERVATION_STATUS_DELETED: // 削除\r\n return false;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * payment の payment status から、bill の payment status の決定\r\n * @returns {number}\r\n */\r\n static billPaymentStatus(event, item_list)\r\n {\r\n let status = {};\r\n if (event && event.bill && event.bill.payment)\r\n {\r\n event.bill.payment.map((paymentEntity) =>\r\n {\r\n if (!status[paymentEntity.payment_status])\r\n {\r\n status[paymentEntity.payment_status] = 1;\r\n }\r\n else\r\n {\r\n status[paymentEntity.payment_status] += 1;\r\n }\r\n });\r\n }\r\n\r\n let result = BackendStatic.PAYMENT_STATUS_PAID;\r\n\r\n // 見積もり\r\n let calculate = Toolkit.calculateTotal(event, item_list);\r\n\r\n if (calculate.paidAfterLeft > 0 || status[BackendStatic.PAYMENT_STATUS_NOT_YET])\r\n result = BackendStatic.PAYMENT_STATUS_NOT_YET;\r\n else if (status[BackendStatic.PAYMENT_STATUS_FAILED])\r\n result = BackendStatic.PAYMENT_STATUS_FAILED;\r\n else if (status[BackendStatic.PAYMENT_STATUS_UNKNOWN])\r\n result = BackendStatic.PAYMENT_STATUS_UNKNOWN;\r\n else if (status[BackendStatic.PAYMENT_STATUS_BILLING])\r\n result = BackendStatic.PAYMENT_STATUS_BILLING;\r\n else if (status[BackendStatic.PAYMENT_STATUS_AUTHORIZE])\r\n result = BackendStatic.PAYMENT_STATUS_AUTHORIZE;\r\n\r\n return result;\r\n }\r\n\r\n\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n // アイテムのステータス\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n static isOptionItem(item_entity)\r\n {\r\n return item_entity.reservation_type === BackendStatic.ITEM_RESERVATION_TYPE_OPTION /* 予約選択不可機材(オプション)*/ &&\r\n item_entity.display === BackendStatic.ITEM_DISPLAY_ON /* 表示ON */;\r\n }\r\n\r\n static isLentItem(item_entity)\r\n {\r\n return item_entity.reservation_type === BackendStatic.ITEM_RESERVATION_TYPE_ITEM /* 予約選択可機材*/ &&\r\n item_entity.display === BackendStatic.ITEM_DISPLAY_ON /* 表示ON */;\r\n }\r\n\r\n\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n // イベントの操作\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n\r\n static isTemporaryUserEntity(entity)\r\n {\r\n return String(entity.user_id).startsWith(\"_new_\");\r\n }\r\n\r\n\r\n /**\r\n * 指定イベントにオプションを追加・追加済の場合は削除\r\n */\r\n static addOrRemoveAnotherReservation(event, itemEntity, amount, append)\r\n {\r\n if (append)\r\n {\r\n var item_lent = {\r\n item_lent_id: 1,\r\n amount: 0,\r\n lent_type: 1,\r\n lent_account_id: null,\r\n lent_datetime: null,\r\n lent_done: 0,\r\n lent_remarks: \"\",\r\n send_with_another: 0,\r\n name: \"\",\r\n postcode: \"\",\r\n prefecture: \"\",\r\n city: \"\",\r\n address1: \"\",\r\n address2: \"\",\r\n phone_number: \"\"\r\n };\r\n\r\n var item_return = {\r\n item_return_id: 1,\r\n return_type: 1,\r\n return_account_id: null,\r\n return_datetime: null,\r\n return_done: 0,\r\n return_remarks: \"\",\r\n };\r\n\r\n event.another_reservation.push({\r\n \"id\": \"_new_\" + this.generateId(),\r\n 'item_id': itemEntity.item_id,\r\n 'order_id': event.order.order_id,\r\n 'is_main': 0,\r\n \"reservation_type\": itemEntity.reservation_type,\r\n \"reservation_status\": BackendStatic.RESERVATION_STATUS_APPROVED,\r\n \"datetime_from\": event.item_reservation.datetime_from,\r\n 'datetime_to': event.item_reservation.datetime_to,\r\n \"amount\": amount,\r\n \"price_summary\": 0,\r\n \"remark\": \"\",\r\n \"user_request\": \"\",\r\n\r\n item_lent: item_lent,\r\n item_return: item_return\r\n });\r\n }\r\n else\r\n {\r\n let idx = -1;\r\n event.another_reservation.map((itemReservationEntity, index) =>\r\n {\r\n if (itemReservationEntity.item_id === itemEntity.item_id)\r\n {\r\n idx = index;\r\n }\r\n });\r\n\r\n if (idx !== -1 /* another reservation に登録済 */)\r\n {\r\n event.another_reservation.splice(idx, 1);\r\n }\r\n }\r\n\r\n return event;\r\n }\r\n\r\n static convertEventToReservations(event)\r\n {\r\n let reservations = [];\r\n reservations.push(event.item_reservation);\r\n for (let another of event.another_reservation)\r\n {\r\n if (event.item_reservation.item_id !== another.item_id)\r\n reservations.push(another);\r\n }\r\n return reservations;\r\n }\r\n\r\n /**\r\n * 主予約または副予約に指定したアイテムIDのものがあれば取得\r\n */\r\n static findItemReservationsInEvent(event, item_id)\r\n {\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n // 主予約\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n if (event.item_reservation.item_id === item_id)\r\n {\r\n return [event.item_reservation];\r\n }\r\n\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n // 副予約\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n let subReservations = event.another_reservation.filter((itemReservationEntity) => itemReservationEntity.item_id === item_id);\r\n if (subReservations.length > 0)\r\n {\r\n return subReservations;\r\n }\r\n\r\n return [];\r\n }\r\n\r\n\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n // 表示デコレーション系\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n\r\n static renderPrice(price, message = \"\")\r\n {\r\n if (price)\r\n {\r\n if (price > 0)\r\n {\r\n return (\r\n ¥{price.toLocaleString()} {message}
\r\n );\r\n }\r\n else\r\n {\r\n return (\r\n ¥{price.toLocaleString()} {message}
\r\n );\r\n }\r\n }\r\n\r\n return (\r\n -
\r\n );\r\n }\r\n\r\n\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n // ソート\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n\r\n static sortEventList(event_list)\r\n {\r\n var arranged = new Map();\r\n\r\n // 開始時間でソート\r\n event_list.sort((a, b) => a.start > b.start);\r\n\r\n event_list.forEach(function (event)\r\n {\r\n let key = moment(event.start).format(\"YYYYMMDD\");\r\n\r\n if (!arranged.has(key))\r\n arranged.set(key, {\"date\": event.start, \"list\": []});\r\n\r\n arranged.get(key).list.push(event);\r\n });\r\n\r\n return arranged;\r\n }\r\n\r\n static sortItemPriceInverse(item_prices)\r\n {\r\n item_prices.sort((a, b) => b.priority - a.priority);\r\n return item_prices;\r\n }\r\n\r\n static sortItemPrice(item_prices)\r\n {\r\n item_prices.sort((a, b) => a.priority - b.priority);\r\n return item_prices;\r\n }\r\n\r\n static getCurrentLanguage(i18n)\r\n {\r\n return i18n.language || window.localStorage.i18nextLng || 'ja';\r\n }\r\n\r\n static findSelectedItemById(item_list, item_id)\r\n {\r\n for (let item of item_list)\r\n {\r\n if (item.item_id === item_id)\r\n return item;\r\n }\r\n\r\n return {\r\n item_id: null,\r\n item_name: \"N/A\",\r\n description: \"N/A\",\r\n thumbnails: [],\r\n item_prices: [],\r\n };\r\n }\r\n\r\n static findBillByOrderId(bill_list, order_id)\r\n {\r\n for (let billEntity of bill_list)\r\n {\r\n if (billEntity.order_id === order_id)\r\n return billEntity;\r\n }\r\n return null;\r\n }\r\n\r\n static findSelectedEvent(event_list, id)\r\n {\r\n for (let event of event_list)\r\n {\r\n if (event.item_reservation && event.item_reservation.id === id)\r\n return event;\r\n }\r\n return null;\r\n }\r\n\r\n static findAnotherReservations(this_event, from_event_list)\r\n {\r\n return from_event_list.filter((eventEntity) =>\r\n this_event.another_reservation.filter((anotherReservationEntity) =>\r\n eventEntity.item_reservation && eventEntity.item_reservation.id === anotherReservationEntity.id\r\n ).length > 0 // contains\r\n );\r\n }\r\n\r\n static findCouponById(coupon_id, from_counpon_list)\r\n {\r\n for (let couponEntity of from_counpon_list)\r\n {\r\n if (couponEntity.id === coupon_id)\r\n return couponEntity;\r\n }\r\n return null;\r\n }\r\n\r\n static filterEvent(event_list, item_list,\r\n reservation_status,\r\n reservation_type = 1, /* アイテムカテゴリー 0:オプション 1:アイテム */\r\n item_type = undefined, /* アイテムタイプ 0:未定義 1:貸出資産(重複不可) 2:オプション(重複可能) */\r\n display = undefined, /* アイテム表示非表示 0:非表示 1:表示 */\r\n available = undefined, /* アイテム利用可不可 0:利用不可 1:利用可 */\r\n warning = undefined /* アイテム予約フラグ */)\r\n {\r\n var list = [];\r\n\r\n for (let event of event_list)\r\n {\r\n // 新規登録イベントの場合\r\n if (!event.item_reservation)\r\n continue;\r\n\r\n let itemEntity = Toolkit.findSelectedItemById(item_list, event.item_reservation.item_id);\r\n let add = true;\r\n\r\n if (reservation_status !== undefined && event.item_reservation.reservation_status !== reservation_status)\r\n add = false;\r\n if (reservation_type !== undefined && itemEntity.reservation_type !== reservation_type)\r\n add = false;\r\n if (item_type !== undefined && itemEntity.item_type !== item_type)\r\n add = false;\r\n if (display !== undefined && itemEntity.display !== display)\r\n add = false;\r\n if (available !== undefined && itemEntity.available !== available)\r\n add = false;\r\n if (warning !== undefined && event.item_reservation.warning !== warning)\r\n add = false;\r\n\r\n if (add)\r\n list.push(event);\r\n }\r\n\r\n return list;\r\n }\r\n\r\n static countItemAndOption(selected_event, event_list, item_list)\r\n {\r\n var itemCount = 0;\r\n var optionCount = 0;\r\n\r\n selected_event.another_reservation.map((another_reservation) =>\r\n {\r\n var event = Toolkit.findSelectedEvent(event_list, another_reservation.item_reservation_id);\r\n if (event)\r\n {\r\n var item = Toolkit.findSelectedItemById(item_list, event.item_reservation.item_id);\r\n if (item)\r\n {\r\n switch (item.item_type)\r\n {\r\n case 1: /* 貸し出し資産 */\r\n if (item.reservation_type === 0) /* 予約選択不可 */\r\n optionCount++; // オプション扱い\r\n else\r\n itemCount++;\r\n break;\r\n\r\n case 2: /* オプション */\r\n optionCount++;\r\n break;\r\n }\r\n }\r\n }\r\n });\r\n\r\n return {\r\n item: itemCount,\r\n option: optionCount\r\n }\r\n }\r\n\r\n /**\r\n * チェックリストのカウント\r\n * @param selected_id_list\r\n * @returns {number}\r\n */\r\n static countChecked(selected_id_list = {})\r\n {\r\n let count = 0;\r\n for (let bill_id in selected_id_list)\r\n {\r\n if (selected_id_list[bill_id])\r\n count++;\r\n }\r\n return count;\r\n }\r\n\r\n /**\r\n * 2つのイベントリストのマージ\r\n * @param event_list\r\n * @param add_event_list\r\n * @param remove_temp\r\n * @returns {*}\r\n */\r\n static mergeEvent(event_list, add_event_list, remove_temp = true)\r\n {\r\n let new_event_list = [];\r\n event_list.map((event, index) =>\r\n {\r\n // マージ時に一時イベントを掃除する\r\n if (!remove_temp || !event.id.toString().match(/_new_/))\r\n new_event_list.push(event)\r\n });\r\n\r\n add_event_list.map(add_event =>\r\n {\r\n let same_event_index = -1;\r\n new_event_list.map((event, index) =>\r\n {\r\n if (event.id === add_event.id)\r\n same_event_index = index;\r\n\r\n // 別イベントの共通項目の同期\r\n if (event.order && add_event.order && event.order.id === add_event.order.id)\r\n {\r\n event.another_reservation.map((another_reservation, idx) =>\r\n {\r\n if (another_reservation.id === add_event.item_reservation.id)\r\n event.another_reservation[idx] = add_event.item_reservation;\r\n });\r\n }\r\n\r\n if (event.user_information && add_event.user_information && event.user_information.user_id === add_event.user_information.user_id)\r\n event.user_information = add_event.user_information;\r\n });\r\n\r\n if (same_event_index >= 0)\r\n {\r\n // イベントの上書き更新\r\n new_event_list[same_event_index] = add_event\r\n }\r\n else\r\n {\r\n new_event_list.push(add_event);\r\n }\r\n });\r\n\r\n return new_event_list;\r\n }\r\n\r\n static removeEvent(event_list, remove_event_id)\r\n {\r\n let new_event_list = [];\r\n for (let _event of event_list)\r\n {\r\n if (remove_event_id !== _event.id)\r\n new_event_list.push(_event);\r\n }\r\n return new_event_list;\r\n }\r\n\r\n /**\r\n * DBから取得したanother_reservationは参照が切れている為、必要な時に主予約のイベントの値で上書きする\r\n */\r\n static updateItemReservationsByOtherEvent(target_event, event_list)\r\n {\r\n target_event.another_reservation.map((another_reservation, index) =>\r\n {\r\n event_list.map((event) =>\r\n {\r\n if (event.id === another_reservation.id)\r\n target_event.another_reservation[index] = event.item_reservation\r\n })\r\n });\r\n\r\n return target_event;\r\n }\r\n\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n // 予約管理系\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n // 表示制御・判定\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n\r\n /**\r\n * イベント編集可能かどうか?\r\n * @param item_reservation\r\n * @returns {boolean}\r\n */\r\n static editEnabled(item_reservation)\r\n {\r\n return Toolkit.editEnabledStatus(item_reservation.reservation_status);\r\n }\r\n\r\n static editEnabledStatus(reservation_status)\r\n {\r\n return reservation_status === BackendStatic.RESERVATION_STATUS_NOT_APPROVED ||\r\n reservation_status === BackendStatic.RESERVATION_STATUS_APPROVED ||\r\n reservation_status === BackendStatic.RESERVATION_STATUS_WAIT_PAYMENT;\r\n }\r\n\r\n /**\r\n *\r\n * @param item_reservation\r\n * @returns {boolean}\r\n */\r\n static reserveAvailable(item_reservation)\r\n {\r\n return item_reservation.reservation_status === BackendStatic.RESERVATION_STATUS_DELETED ||\r\n item_reservation.reservation_status === BackendStatic.RESERVATION_STATUS_CANCELED;\r\n\r\n }\r\n\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n // アイテム追加\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n\r\n /**\r\n * 新規イベント\r\n * @param user_information\r\n * @param reserve_from\r\n * @param reserve_to\r\n * @returns {*}\r\n */\r\n static createNewEvent(reserve_from, reserve_to, user_information)\r\n {\r\n let order_id = \"_new_\" + this.generateId();\r\n let bill = {\r\n bill_id: \"_new_\" + this.generateId(),\r\n customer_id: 1,\r\n user_id: user_information ? user_information.user_id : -1,\r\n order_id: order_id,\r\n bill_date: moment().toDate(),\r\n name: \"請求書\",\r\n price: 0,\r\n tax: 0,\r\n payment_type: BackendStatic.PAYMENT_TYPE_UNKNOWN,\r\n payment_date: moment().toDate(),\r\n payment_status: BackendStatic.PAYMENT_STATUS_NOT_YET,\r\n paid_at: null,\r\n\r\n payment: []\r\n };\r\n\r\n let newOrder = {\r\n order_id: order_id,\r\n order_datetime: moment().toDate(),\r\n reservation_status: BackendStatic.RESERVATION_STATUS_APPROVED,\r\n reservation_extra: [],\r\n change_histories: [],\r\n };\r\n\r\n return {\r\n id: \"_new_\" + this.generateId(),\r\n title: \"新規イベント\",\r\n start: reserve_from,\r\n end: reserve_to,\r\n user_information: user_information,\r\n order: newOrder,\r\n item_reservation: null,\r\n bill: bill,\r\n another_reservation: []\r\n };\r\n }\r\n\r\n static createNewUserInformation()\r\n {\r\n return {\r\n \"user_id\": \"_new_\" + this.generateId(),\r\n \"name_sei\": \"\",\r\n \"name_mei\": \"\",\r\n \"furigana_sei\": \"\",\r\n \"furigana_mei\": \"\",\r\n \"birthday\": \"\",\r\n \"postcode\": \"\",\r\n \"prefecture\": \"東京都\",\r\n \"city\": \"\",\r\n \"address1\": \"\",\r\n \"address2\": \"\",\r\n \"mail_address\": \"\",\r\n \"phone_number\": \"\",\r\n \"identification_status\": 0,\r\n \"id_content\": 0,\r\n \"id_content_uploaded_at\": \"\",\r\n \"id_memo\": \"\",\r\n\r\n \"memo\": \"\",\r\n \"coupon\": []\r\n };\r\n }\r\n\r\n static addNewExtra(selected_event, extra, for_event_list)\r\n {\r\n let newReservationExtra = {\r\n id: \"_new_\" + this.generateId(),\r\n order_id: selected_event.order.order_id,\r\n user_id: selected_event.user_information.user_id,\r\n name: extra.name,\r\n price: extra.price,\r\n remark: extra.remark,\r\n coupon_id: extra.coupon_id,\r\n price_extra: extra.price_extra,\r\n price_extra_reason: extra.price_extra_reason,\r\n };\r\n\r\n // 同じ order_id を持つものに追加\r\n for_event_list\r\n .filter((eventEntity) => eventEntity.order && eventEntity.order.order_id === selected_event.order.order_id)\r\n .map((eventEntity) =>\r\n {\r\n eventEntity.order.reservation_extra.push(newReservationExtra);\r\n });\r\n\r\n return for_event_list;\r\n }\r\n\r\n static newPayment(payment)\r\n {\r\n let newPayment = {\r\n id: \"_new_\" + this.generateId(),\r\n bill_id: payment.bill_id,\r\n payment_type: payment.payment_type,\r\n payment_date: payment.payment_date,\r\n payment_status: payment.payment_status,\r\n price: payment.price,\r\n paid_price: payment.paid_price,\r\n paid_at: payment.paid_at,\r\n };\r\n\r\n return newPayment;\r\n }\r\n\r\n /**\r\n * 指定イベントにアイテムを追加する\r\n * @param selected_event 主イベント\r\n * @param reserve_from 予約開始日時\r\n * @param reserve_to 予約開始日時\r\n * @param selected_item 選択アイテム\r\n * @param for_event_list イベントリスト\r\n * @returns {*}\r\n */\r\n static addNewItem(selected_event, reserve_from, reserve_to, selected_item, for_event_list)\r\n {\r\n var item_lent = {\r\n item_lent_id: 1,\r\n amount: 0,\r\n lent_type: 1,\r\n lent_account_id: null,\r\n lent_datetime: null,\r\n lent_done: 0,\r\n lent_remarks: \"\",\r\n send_with_another: 0,\r\n name: \"\",\r\n postcode: \"\",\r\n prefecture: \"\",\r\n city: \"\",\r\n address1: \"\",\r\n address2: \"\",\r\n phone_number: \"\"\r\n };\r\n\r\n var item_return = {\r\n item_return_id: 1,\r\n return_type: 1,\r\n return_account_id: null,\r\n return_datetime: null,\r\n return_done: 0,\r\n return_remarks: \"\",\r\n };\r\n\r\n var newItemReservation = {\r\n \"id\": \"_new_\" + this.generateId(),\r\n 'item_id': selected_item.item_id,\r\n 'order_id': selected_event.order.order_id,\r\n \"reservation_type\": selected_item.reservation_type,\r\n \"reservation_status\": BackendStatic.RESERVATION_STATUS_APPROVED,\r\n \"datetime_from\": reserve_from,\r\n 'datetime_to': reserve_to,\r\n \"amount\": 1,\r\n \"price_summary\": 0,\r\n \"remark\": \"\",\r\n\r\n item_lent: item_lent,\r\n item_return: item_return\r\n };\r\n\r\n // すでにアイテムがイベントに紐づいてる時 → 追加のイベント作成\r\n if (selected_event.item_reservation !== null)\r\n {\r\n // 同じ order_id を持つものに追加\r\n newItemReservation['is_main'] = 0;\r\n for_event_list\r\n .filter((eventEntity) => eventEntity.order && eventEntity.order.order_id === selected_event.order.order_id)\r\n .map((eventEntity) => eventEntity.another_reservation.push(newItemReservation));\r\n\r\n // 追加のイベント\r\n var newEvent = {\r\n 'id': \"_new_\" + this.generateId(),\r\n 'title': selected_item.item_name,\r\n 'start': reserve_from,\r\n 'end': reserve_to,\r\n\r\n 'user_information': selected_event.user_information,\r\n 'order': selected_event.order,\r\n 'item_reservation': newItemReservation,\r\n\r\n 'another_reservation': selected_event.another_reservation.slice() // 配列のコピー\r\n };\r\n\r\n for_event_list.push(newEvent);\r\n }\r\n else\r\n {\r\n // item_reservationの設定\r\n newItemReservation['is_main'] = 1;\r\n for_event_list.map((eventEntity) =>\r\n {\r\n if (eventEntity.id === selected_event.id)\r\n {\r\n eventEntity.title = selected_item.item_name;\r\n eventEntity.start = reserve_from;\r\n eventEntity.end = reserve_to;\r\n eventEntity.item_reservation = newItemReservation;\r\n eventEntity.another_reservation = [\r\n // { id : newItemReservation.id }\r\n ]\r\n }\r\n });\r\n }\r\n\r\n return for_event_list;\r\n }\r\n\r\n /**\r\n * 指定したアイテム予約のステータスを変更する\r\n * @param new_status\r\n * @param item_reservation\r\n * @param for_event_list\r\n */\r\n static changeItemReservationStatus(new_status, item_reservation, for_event_list)\r\n {\r\n for_event_list.filter((eventEntity) => eventEntity.item_reservation.id === item_reservation.id)\r\n .map((eventEntity) =>\r\n {\r\n eventEntity.item_reservation.reservation_status = new_status;\r\n });\r\n\r\n return for_event_list;\r\n }\r\n\r\n /**\r\n * アイテムの利用不可期間設定リストから、利用不可となる日付のDateリストを作成\r\n * @param available_term_list\r\n * @returns {Array}\r\n */\r\n static createDateListFromAvailableTerms(available_term_list)\r\n {\r\n let dateList = [];\r\n\r\n if (available_term_list !== undefined)\r\n {\r\n available_term_list.map((availableTermEntity, index) =>\r\n {\r\n switch (availableTermEntity.apply_type)\r\n {\r\n case BackendStatic.SCHEDULE_FOR_DAY:\r\n break;\r\n\r\n case BackendStatic.SCHEDULE_FOR_DATE:\r\n break;\r\n\r\n case BackendStatic.SCHEDULE_FOR_RANGE:\r\n let addDates = this.createDateList(availableTermEntity.apply_date_from, availableTermEntity.apply_date_to);\r\n addDates.map((addDateEntity) => dateList.push(addDateEntity));\r\n break;\r\n }\r\n });\r\n }\r\n return dateList;\r\n }\r\n\r\n static isMatchDisAvailableDate(date, available_term_list)\r\n {\r\n let available = false;\r\n let disavailable = false;\r\n let holiday = false;\r\n let rangeAndPartial = false;\r\n\r\n if (available_term_list)\r\n available_term_list.map((availableTermEntity, index) =>\r\n {\r\n let isApply = false;\r\n let targetDate = moment(date);\r\n if (availableTermEntity.apply_day)\r\n {\r\n let applyDays = JSON.parse(availableTermEntity.apply_day);\r\n isApply = applyDays.length === 0;\r\n for (let day of applyDays)\r\n {\r\n if (Number(day) === 7)\r\n {\r\n isApply |= HolidayJp.isHoliday(date);\r\n }\r\n else\r\n {\r\n isApply |= targetDate.day() === Number(day);\r\n }\r\n }\r\n }\r\n\r\n if (isApply)\r\n {\r\n switch (availableTermEntity.apply_type)\r\n {\r\n case BackendStatic.SCHEDULE_FOR_DAY:\r\n if (availableTermEntity.available === BackendStatic.SCHEDULE_AVAILABLE)\r\n available = true;\r\n else if (availableTermEntity.available === BackendStatic.SCHEDULE_DISAVAILABLE)\r\n disavailable = true;\r\n else if (availableTermEntity.available === BackendStatic.SCHEDULE_HOLIDAY)\r\n holiday = true;\r\n\r\n break;\r\n\r\n case BackendStatic.SCHEDULE_FOR_DATE:\r\n let settingDate = moment(availableTermEntity.apply_date);\r\n if (availableTermEntity.is_every_years)\r\n settingDate.year(targetDate.year());\r\n\r\n if (targetDate.isSame(settingDate, \"day\"))\r\n {\r\n if (availableTermEntity.available === BackendStatic.SCHEDULE_AVAILABLE)\r\n available = true;\r\n else if (availableTermEntity.available === BackendStatic.SCHEDULE_DISAVAILABLE)\r\n disavailable = true;\r\n else if (availableTermEntity.available === BackendStatic.SCHEDULE_HOLIDAY)\r\n holiday = true;\r\n }\r\n break;\r\n\r\n case BackendStatic.SCHEDULE_FOR_RANGE:\r\n let settingDateFrom = moment(availableTermEntity.apply_date_from);\r\n let settingDateTo = moment(availableTermEntity.apply_date_to).endOf('day');\r\n if (availableTermEntity.is_every_years)\r\n {\r\n settingDateFrom.year(targetDate.year());\r\n settingDateTo.year(targetDate.year());\r\n }\r\n\r\n if (targetDate.isBetween(settingDateFrom, settingDateTo))\r\n {\r\n if (availableTermEntity.available === BackendStatic.SCHEDULE_AVAILABLE)\r\n {\r\n available = true;\r\n }\r\n else if (availableTermEntity.available === BackendStatic.SCHEDULE_DISAVAILABLE)\r\n {\r\n disavailable = true;\r\n // if (this.isTimePartial(settingDateFrom, targetDate) ||\r\n // this.isTimePartial(settingDateTo, targetDate))\r\n // {\r\n // rangeAndPartial = true;\r\n // }\r\n }\r\n else if (availableTermEntity.available === BackendStatic.SCHEDULE_HOLIDAY)\r\n holiday = true;\r\n }\r\n break;\r\n }\r\n }\r\n });\r\n\r\n if (available)\r\n return SharekanStatic.CALENDAR_STATUS_CAN_RESERVE;\r\n\r\n if (disavailable)\r\n return SharekanStatic.CALENDAR_STATUS_DISABLE;\r\n else if (holiday)\r\n return SharekanStatic.CALENDAR_STATUS_HOLIDAY;\r\n else if (rangeAndPartial)\r\n return SharekanStatic.CALENDAR_STATUS_PARTIAL\r\n\r\n return SharekanStatic.CALENDAR_STATUS_CAN_RESERVE;\r\n }\r\n\r\n static isTimePartial(moment, momentBase)\r\n {\r\n return moment.isSame(momentBase, \"day\") /* 同一日 */ &&\r\n moment.hour() !== 0 &&\r\n moment.minute() !== 0; /* 0:00 設定 */\r\n }\r\n\r\n static getDateStartMoment(moment)\r\n {\r\n moment.hour(0);\r\n moment.minute(0);\r\n moment.second(0);\r\n return moment;\r\n }\r\n\r\n static getDateEndMoment(moment)\r\n {\r\n moment.hour(23);\r\n moment.minute(59);\r\n moment.second(59);\r\n return moment;\r\n }\r\n\r\n\r\n static createDateList(datetime_start, datetime_end)\r\n {\r\n let dateList = [];\r\n let startMoment = this.getDateStartMoment(moment(datetime_start));\r\n let endMoment = this.getDateEndMoment(moment(datetime_end).subtract(1, 's')); //0時までの予約を前日〆で計算するため1秒引く\r\n\r\n while (startMoment.isBefore(endMoment))\r\n {\r\n dateList.push(startMoment.toDate());\r\n\r\n startMoment.add(1, 'days');\r\n }\r\n\r\n return dateList;\r\n }\r\n\r\n static howManyHours(datetime_start, datetime_end)\r\n {\r\n if (datetime_start === null || datetime_end === null)\r\n return 0;\r\n\r\n let start = moment(datetime_start);\r\n let end = moment(datetime_end);\r\n\r\n return end.diff(start, \"hours\", true).toFixed(1);\r\n }\r\n\r\n static howManyDays(datetime_start, datetime_end)\r\n {\r\n if (datetime_start === null || datetime_end === null)\r\n return 0;\r\n\r\n let start = moment(datetime_start);\r\n let end = moment(datetime_end);\r\n\r\n return end.diff(start, \"days\", true).toFixed(1);\r\n }\r\n\r\n static isDisabledDate(date, available_term_list)\r\n {\r\n let disabledDates = Toolkit.createDateListFromAvailableTerms(available_term_list);\r\n return disabledDates.filter((disabledDate) => moment(disabledDate).isSame(moment(date), \"day\")).length > 0;\r\n }\r\n\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n // チャート\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n static createDateLabel(datetime_start, datetime_end)\r\n {\r\n let labelList = [];\r\n\r\n let dateList = this.createDateList(datetime_start, datetime_end);\r\n dateList.map((date) =>\r\n {\r\n labelList.push(\r\n moment(date).format(i18n.t(\"date_format\"))\r\n );\r\n });\r\n return labelList;\r\n }\r\n\r\n\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n // 抽出系\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n\r\n /**\r\n * 指定アイテムIDの予約イベントをすべて抽出\r\n * @param event_list\r\n * @param item_entity\r\n * @returns {*}\r\n */\r\n static findEventsHasItem(event_list, item_entity)\r\n {\r\n return event_list.filter((eventEntity) => eventEntity.item_reservation !== null && eventEntity.item_reservation.item_id === item_entity.item_id);\r\n }\r\n\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n // イベント開始・終了時間取得(item_reservation未登録の場合は event.start/event.end から取得\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n\r\n static getEventDatetimeFrom(eventEntity)\r\n {\r\n if (eventEntity.item_reservation === null)\r\n return eventEntity.start;\r\n return eventEntity.item_reservation.datetime_from;\r\n }\r\n\r\n static getEventDatetimeTo(eventEntity)\r\n {\r\n if (eventEntity.item_reservation === null)\r\n return eventEntity.end;\r\n return eventEntity.item_reservation.datetime_to;\r\n }\r\n\r\n\r\n /**\r\n * 渡したイベントリストから、指定アイテムの予約をさがし、指定イベントと被っているものがあればすべて抽出\r\n * @param item_entity\r\n * @param this_event\r\n * @param from_event_list\r\n * @returns {*}\r\n */\r\n static isBooked(item_entity, this_event,\r\n show_items_from, show_items_to,\r\n from_event_list)\r\n {\r\n\r\n return this.findEventsHasItem(from_event_list, item_entity)\r\n .filter((eventEntity) =>\r\n eventEntity.id !== this_event.id &&\r\n eventEntity.item_reservation &&\r\n eventEntity.item_reservation.reservation_status < BackendStatic.RESERVATION_STATUS_DONE &&\r\n (\r\n moment(this.getEventDatetimeFrom(eventEntity)).isBetween(show_items_from, show_items_to) ||\r\n moment(this.getEventDatetimeTo(eventEntity)).subtract(1, 'second').isBetween(show_items_from, show_items_to) ||\r\n (\r\n moment(this.getEventDatetimeFrom(eventEntity)).isBefore(show_items_from) &&\r\n moment(this.getEventDatetimeTo(eventEntity)).subtract(1, 'second').isAfter(show_items_to)\r\n )\r\n )\r\n );\r\n }\r\n\r\n /**\r\n * target_eventによって予約済であったイベントが、どう予約済であったのか?\r\n * @param range_from\r\n * @param range_to\r\n * @param target_event\r\n * @returns {number}\r\n */\r\n static bookedType(range_from, range_to,\r\n target_event)\r\n {\r\n if (moment(target_event.item_reservation.datetime_from).isBetween(range_from, range_to) &&\r\n moment(target_event.item_reservation.datetime_to).isBetween(range_from, range_to))\r\n return BOOKED_TYPE_INCLUDED; // 前後のぞいて予約済 「datetime_fromまでか、datetime_to以降に利用可能です。」\r\n else if (moment(target_event.item_reservation.datetime_from).isBetween(range_from, range_to))\r\n return BOOKED_TYPE_AFTER_START; // datetime_from から利用されている「datetime_fromまで利用可能です。」\r\n else if (moment(target_event.item_reservation.datetime_to).isBetween(range_from, range_to))\r\n return BOOKED_TYPE_BEFORE_END; // datetime_to まで利用されている 「datetime_to以降に利用可能です。」\r\n else if (moment(target_event.item_reservation.datetime_from).isBefore(range_from) &&\r\n moment(target_event.item_reservation.datetime_to).isAfter(range_to))\r\n return BOOKED_TYPE_ALL; // 利用期間すべて予約済\r\n\r\n return 0;\r\n }\r\n\r\n static isIn(a_from, a_to, b_from, b_to)\r\n {\r\n if (moment(b_from).isBetween(a_from, a_to) &&\r\n moment(b_to).isBetween(a_from, a_to))\r\n return BOOKED_TYPE_INCLUDED; // 前後のぞいて予約済 「datetime_fromまでか、datetime_to以降に利用可能です。」\r\n else if (moment(b_from).isBetween(a_from, a_to))\r\n return BOOKED_TYPE_AFTER_START; // datetime_from から利用されている「datetime_fromまで利用可能です。」\r\n else if (moment(b_to).isBetween(a_from, a_to))\r\n return BOOKED_TYPE_BEFORE_END; // datetime_to まで利用されている 「datetime_to以降に利用可能です。」\r\n else if (moment(b_from).isBefore(a_from) &&\r\n moment(b_to).isAfter(a_to))\r\n return BOOKED_TYPE_ALL; // 利用期間すべて予約済\r\n\r\n return 0;\r\n }\r\n\r\n /**\r\n * 利用不可の理由チェック\r\n * @param item_entity\r\n * @param this_event\r\n * @param show_items_from\r\n * @param show_items_to\r\n * @param from_event_list\r\n * @returns {{message: string, status: number}|{booked_events: *, message: string, status: number}}\r\n */\r\n static unavailableBecause(item_entity, this_event,\r\n show_items_from, show_items_to,\r\n from_event_list)\r\n {\r\n\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n // 利用設定不可\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n if (item_entity.available === 0)\r\n return {status: 1, message: \"利用不可設定のアイテムです。\"};\r\n\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n // 期間内に他のイベントで予約中\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n let booked_events = this.isBooked(item_entity, this_event, show_items_from, show_items_to, from_event_list);\r\n if (booked_events.length > 0)\r\n return {status: 4, booked_events: booked_events, message: \"指定期間内に予約済みのアイテムです。\"};\r\n\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n // このイベントで予約中\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n if (this_event.item_reservation !== null &&\r\n this_event.item_reservation.item_id === item_entity.item_id && this_event.item_reservation.reservation_status)\r\n return {status: 2, message: \"予約中です。\"};\r\n\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n // another events で予約中\r\n // ---------------------------------------------------------------------------------------------------------- //\r\n let another_events = this.findAnotherReservations(this_event, from_event_list);\r\n let booked_another_events = this.findEventsHasItem(another_events, item_entity);\r\n if (booked_another_events.length > 0)\r\n return {status: 3, booked_events: booked_another_events, message: \"予約中です。\"};\r\n\r\n return {status: 0, message: \"利用可能です。\"};\r\n }\r\n\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n // 価格テーブル表示\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n\r\n static itemColor(itemEntity)\r\n {\r\n if (!itemEntity.color)\r\n {\r\n return null\r\n }\r\n\r\n return colors[itemEntity.color];\r\n }\r\n\r\n static colors()\r\n {\r\n let colorList = [];\r\n for (let colorName in colors)\r\n colorList.push(colors[colorName]);\r\n\r\n return colorList;\r\n }\r\n\r\n static priorityColor(priority)\r\n {\r\n let index = priority;\r\n if (index > priority_table.length - 1)\r\n index = priority_table.length - 1;\r\n\r\n return {\r\n color: priority_table[index]\r\n }\r\n }\r\n\r\n static priorityColorTable()\r\n {\r\n return priority_table;\r\n }\r\n\r\n static priorities()\r\n {\r\n let priorities = [];\r\n priority_table.map((entity, index) => priorities.push(index));\r\n return priorities;\r\n }\r\n\r\n /**\r\n * 指定日の適用価格を取得\r\n * @param date\r\n * @param item_prices\r\n * @returns {*}\r\n */\r\n static findAppliedPrice(date, item_prices)\r\n {\r\n var appliedPrice = null;\r\n\r\n let priorityPrices = this.sortItemPriceInverse(item_prices); // 優先度低い方からチェック\r\n priorityPrices.map((itemPriceEntity) =>\r\n {\r\n // 適用開始日指定\r\n let isApply = !itemPriceEntity.enable_from ||\r\n (itemPriceEntity.enable_from && moment(date).isSameOrAfter(itemPriceEntity.enable_from, \"day\"));\r\n\r\n let targetDate = moment(date);\r\n if (itemPriceEntity.apply_day)\r\n {\r\n let applyDays = JSON.parse(itemPriceEntity.apply_day);\r\n let _isApply = applyDays.length === 0;\r\n for (let day of applyDays)\r\n {\r\n if (Number(day) === 7)\r\n {\r\n _isApply |= HolidayJp.isHoliday(date);\r\n }\r\n else\r\n {\r\n _isApply |= targetDate.day() === Number(day);\r\n }\r\n }\r\n isApply &= _isApply;\r\n }\r\n\r\n if (isApply)\r\n {\r\n switch (itemPriceEntity.apply_type)\r\n {\r\n case BackendStatic.PRICE_APPLY_TYPE_FOR_ALL: // 基本料金\r\n case BackendStatic.PRICE_APPLY_TYPE_FOR_DAY: // 曜日\r\n appliedPrice = itemPriceEntity;\r\n break;\r\n\r\n case BackendStatic.PRICE_APPLY_TYPE_FOR_DATE: // 特定日\r\n let settingDate = moment(itemPriceEntity.apply_date);\r\n if (itemPriceEntity.is_every_years)\r\n settingDate.year(targetDate.year());\r\n if (targetDate.isSame(settingDate, 'day'))\r\n appliedPrice = itemPriceEntity;\r\n break;\r\n\r\n case BackendStatic.PRICE_APPLY_TYPE_FOR_RANGE: // 日付範囲\r\n let settingDateFrom = moment(itemPriceEntity.apply_date_from);\r\n let settingDateTo = moment(itemPriceEntity.apply_date_to).endOf('day');\r\n if (itemPriceEntity.is_every_years)\r\n {\r\n settingDateFrom.year(targetDate.year());\r\n settingDateTo.year(targetDate.year());\r\n }\r\n\r\n if (targetDate.isBetween(settingDateFrom, settingDateTo, null, '[]'))\r\n appliedPrice = itemPriceEntity;\r\n break;\r\n }\r\n }\r\n });\r\n\r\n return appliedPrice;\r\n }\r\n\r\n /**\r\n * 指定予約期間を日付で区切る\r\n * @param start_datetime\r\n * @param end_datetime\r\n * @returns {[]}\r\n */\r\n static splitDays(start_datetime, end_datetime)\r\n {\r\n let split_list = [];\r\n\r\n let start = moment(start_datetime);\r\n let end = moment(end_datetime);\r\n\r\n if (start.day() !== end.day()) // 開始と終了が異なる日の場合\r\n {\r\n while (start.day() !== end.day())\r\n {\r\n split_list.push({start: start.toDate(), end: start.endOf(\"day\").toDate()});\r\n\r\n start = start.add(1, \"day\").startOf(\"day\");\r\n }\r\n\r\n split_list.push({start: start.toDate(), end: end.toDate()});\r\n }\r\n else\r\n {\r\n split_list.push({start: start.toDate(), end: end.toDate()});\r\n }\r\n\r\n console.log(\"split_list-----------------\");\r\n console.log(split_list);\r\n\r\n return split_list;\r\n }\r\n\r\n static latest_location_path = \"\";\r\n static force_location_path = \"\";\r\n\r\n static equalLatestPath(path)\r\n {\r\n return this.latest_location_path === path;\r\n }\r\n\r\n static replaceHistory(path)\r\n {\r\n this.latest_location_path = path;\r\n history.replaceState(null, null, path);\r\n }\r\n\r\n static pushHistory(path)\r\n {\r\n if (!path)\r\n path = BackendStatic.BACKEND_VIEW_HOME;\r\n if (this.latest_location_path === path)\r\n return \"\";\r\n if (this.force_location_path)\r\n path = this.force_location_path;\r\n if (path.match(/sign_out/))\r\n location.href = path;\r\n this.latest_location_path = path;\r\n history.pushState(null, null, path);\r\n this.force_location_path = \"\";\r\n this.viewPathGoogleAnalytics(path);\r\n return path;\r\n }\r\n\r\n static returnPage(state)\r\n {\r\n let return_page = Toolkit.pushHistory(state.return_page);\r\n switch (return_page)\r\n {\r\n case BackendStatic.BACKEND_VIEW_MESSAGE:\r\n return {\r\n show_view: BackendStatic.BACKEND_VIEW_MESSAGE,\r\n open_left_list: true,\r\n };\r\n case BackendStatic.BACKEND_VIEW_EDIT_USER:\r\n if (state.selected_event && state.selected_user)\r\n {\r\n return {\r\n show_view: BackendStatic.BACKEND_VIEW_EDIT_USER,\r\n selected_user: state.selected_user,\r\n return_page: BackendStatic.BACKEND_VIEW_USERS,\r\n };\r\n }\r\n break;\r\n case BackendStatic.BACKEND_VIEW_EDIT_EVENT:\r\n if (state.selected_event && state.selected_user)\r\n {\r\n return {\r\n show_view: BackendStatic.BACKEND_VIEW_EDIT_EVENT,\r\n selected_event: state.selected_event,\r\n selected_user: state.selected_user,\r\n return_page: BackendStatic.BACKEND_VIEW_RESERVATIONS,\r\n };\r\n }\r\n break;\r\n case BackendStatic.BACKEND_VIEW_ROOT:\r\n case BackendStatic.BACKEND_VIEW_HOME:\r\n case null:\r\n case \"\":\r\n return {\r\n show_view: null,\r\n open_left_list: true,\r\n };\r\n default:\r\n return {\r\n show_view: return_page,\r\n };\r\n }\r\n state.return_page = return_page;\r\n return Toolkit.returnPage(state);\r\n }\r\n\r\n static urlQuery()\r\n {\r\n var vars = {};\r\n var param = location.search.substring(1).split('&');\r\n for (var i = 0; i < param.length; i++)\r\n {\r\n var keySearch = param[i].search(/=/);\r\n var key = '';\r\n if (keySearch != -1) key = param[i].slice(0, keySearch);\r\n var val = param[i].slice(param[i].indexOf('=', 0) + 1);\r\n if (key != '') vars[key] = decodeURI(val);\r\n }\r\n return vars;\r\n }\r\n\r\n /**\r\n * カスタマ設定関係\r\n */\r\n static saveConfig(type, value, text, onSuccess = null, onError = null)\r\n {\r\n Toolkit.request(this,\r\n '/backend/api/edit_customer_config',\r\n {\r\n config_type: type,\r\n config_value: value,\r\n config_text: text,\r\n },\r\n (_configs) =>\r\n {\r\n // success\r\n console.log(_configs);\r\n if (onSuccess)\r\n onSuccess(_configs);\r\n },\r\n (error) =>\r\n {\r\n console.log(error);\r\n if (onError)\r\n onError(error);\r\n }\r\n )\r\n\r\n }\r\n\r\n static checkAccountPrivilege(account, type, value)\r\n {\r\n for (let _privilege of account.privileges)\r\n {\r\n if (_privilege.privilege_type === type)\r\n return _privilege.privilege >= value;\r\n }\r\n return false\r\n }\r\n\r\n\r\n /**\r\n * @deprecated\r\n * setStateForComponent の state に指定した設定値を取得してセットする\r\n */\r\n static loadConfig(component, configTypeList = [], onSuccess = null, onError = null)\r\n {\r\n if (!component.state.loaded_customer_configs)\r\n {\r\n component.setState({loaded_customer_configs: true});\r\n Toolkit.fetch(\r\n component,\r\n BackendStatic.API_GET_CUSTOMER_CONFIG_LIST,\r\n {\r\n config_type: configTypeList\r\n },\r\n (res) =>\r\n {\r\n // array -> map\r\n let customer_config = component.state.customer_config ? component.state.customer_config : {};\r\n res.customer_config.map((customerConfigEntity) =>\r\n {\r\n customer_config[customerConfigEntity.config_type] = customerConfigEntity;\r\n });\r\n\r\n component.setState({\r\n customer_config: customer_config\r\n });\r\n\r\n if (onSuccess)\r\n onSuccess(res);\r\n },\r\n (error) =>\r\n {\r\n if (onError)\r\n onError(error);\r\n }\r\n );\r\n }\r\n }\r\n\r\n static getConfigText(component, config_type)\r\n {\r\n let configEntity = Toolkit.getConfig(component, config_type);\r\n\r\n if (configEntity !== null)\r\n return configEntity.config_text;\r\n\r\n return '';\r\n }\r\n\r\n static getConfigValue(component, config_type)\r\n {\r\n let configEntity = Toolkit.getConfig(component, config_type);\r\n\r\n if (configEntity !== null)\r\n return configEntity.config_value;\r\n\r\n return '';\r\n }\r\n\r\n static isConfigAvailable(component, config_type)\r\n {\r\n let configEntity = Toolkit.getConfig(component, config_type);\r\n\r\n if (configEntity !== null)\r\n return configEntity.config_value === BackendStatic.CUSTOMER_CONFIG_VALUE_AVAILABLE;\r\n\r\n return false;\r\n }\r\n\r\n static getConfig(component, config_type)\r\n {\r\n if (component && component.state && component.state.customer_config && component.state.customer_config[config_type])\r\n return component.state.customer_config[config_type];\r\n else\r\n {\r\n if (component.props.customer_information && component.props.customer_information.config)\r\n {\r\n for (let _config of component.props.customer_information.config)\r\n if (_config.config_type === config_type)\r\n return _config;\r\n }\r\n\r\n if (!component.state.customer_config || !component.state.customer_config[config_type])\r\n {\r\n if (component.isMounted)\r\n this.loadConfig(component, [config_type]);\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n static createNewItem(successCallback)\r\n {\r\n Toolkit.fetch(this,\r\n BackendStatic.API_EDIT_ITEM,\r\n {\r\n item: {\r\n display_item_id: null,\r\n reservation_type: 1,\r\n item_type: 1,\r\n item_name: \"新しいアイテム\",\r\n description: null,\r\n available_num: 1,\r\n display: 0,\r\n available: 0,\r\n color: \"#f44336\",\r\n parent_item_id: null\r\n }\r\n },\r\n res =>\r\n {\r\n successCallback(res.item);\r\n }\r\n );\r\n }\r\n\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n // API\r\n // -------------------------------------------------------------------------------------------------------------- //\r\n static fetch(component, api, param, successCallback = null, errorCallback = null)\r\n {\r\n console.log(\"------------------------------------------------------------------------------------------------\");\r\n console.log(\"[API] start fetch ... \" + api);\r\n console.log(param);\r\n console.log(\"------------------------------------------------------------------------------------------------\");\r\n let is_backend = false;\r\n let path_split = location.pathname.split('/');\r\n if (path_split.length > 1)\r\n is_backend = path_split[1] === 'backend';\r\n\r\n switch (api)\r\n {\r\n case BackendStatic.API_GET_ORDER_INQUIRY:\r\n {\r\n let url = is_backend ? '/backend/api/get_inquiries' : '/frontend/api/get_inquiries';\r\n this.request(\r\n component,\r\n url,\r\n param,\r\n _res =>\r\n {\r\n successCallback({\r\n order_inquiry_list: _res.inquiries,\r\n });\r\n },\r\n errorCallback\r\n );\r\n }\r\n break;\r\n\r\n case BackendStatic.API_GET_CUSTOMER_CONFIG_LIST:\r\n {\r\n let url = is_backend ? '/backend/api/get_customer_configs' : '/frontend/api/get_customer_configs';\r\n this.request(\r\n component,\r\n url,\r\n param,\r\n _res =>\r\n {\r\n successCallback({\r\n customer_config: _res.customer_configs,\r\n });\r\n },\r\n errorCallback\r\n );\r\n }\r\n break;\r\n case BackendStatic.API_GET_ITEM_LIST:\r\n {\r\n let url = is_backend ? '/backend/api/get_items' : '/frontend/api/get_items';\r\n this.request(\r\n component,\r\n url,\r\n param,\r\n _res =>\r\n {\r\n successCallback({\r\n item_list: _res.items,\r\n total_list_size: _res.total\r\n });\r\n },\r\n errorCallback\r\n );\r\n }\r\n break;\r\n case BackendStatic.API_GET_ACCOUNT_LIST:\r\n this.request(\r\n component,\r\n '/backend/api/get_accounts',\r\n param,\r\n _res =>\r\n {\r\n successCallback({\r\n account_list: _res.accounts,\r\n });\r\n },\r\n errorCallback\r\n );\r\n break;\r\n\r\n case BackendStatic.API_GET_CALENDAR_STATUS:\r\n this.request(\r\n component,\r\n '/api/get_calendar_status',\r\n param,\r\n _res =>\r\n {\r\n successCallback({\r\n reservation_status_result: _res.status,\r\n suspension_events: _res.suspension_events,\r\n });\r\n },\r\n errorCallback\r\n );\r\n break;\r\n\r\n case BackendStatic.API_GET_KPI:\r\n this.request(\r\n component,\r\n '/backend/api/get_kpi',\r\n param,\r\n _res =>\r\n {\r\n successCallback({\r\n data_list: _res,\r\n });\r\n },\r\n errorCallback\r\n );\r\n break;\r\n\r\n case BackendStatic.API_GET_NOTIFICATION_LIST:\r\n this.request(\r\n component,\r\n '/backend/api/get_notifications',\r\n param,\r\n _res =>\r\n {\r\n successCallback({\r\n notification_list: _res.notifications,\r\n total_list_size: _res.total, //ないこともある\r\n });\r\n },\r\n errorCallback\r\n );\r\n break;\r\n\r\n case BackendStatic.API_GET_MESSAGE_CHANNEL_LIST:\r\n this.request(\r\n component,\r\n '/backend/api/get_message_channels',\r\n param,\r\n _res =>\r\n {\r\n successCallback({\r\n message_channel_list: _res.message_channels,\r\n });\r\n },\r\n errorCallback\r\n );\r\n break;\r\n\r\n case BackendStatic.API_SEND_MESSAGE:\r\n let send = () =>\r\n {\r\n let url = '/backend/api/send_message';\r\n if (param['sender_type'] === BackendStatic.MAIL_FROM_USER)\r\n url = '/frontend/api/send_message';\r\n\r\n this.request(\r\n component,\r\n url,\r\n {\r\n user_id: param['user_id'],\r\n },\r\n _res =>\r\n {\r\n let message_channel = _res.message_channel;\r\n API.graphql(graphqlOperation(createMessage, {\r\n input: {\r\n customer_id: message_channel['customer_id'],\r\n channel: message_channel['channel_key'],\r\n sender_type: param['sender_type'],\r\n sender_id: _res.sender_id,\r\n body: param['body'],\r\n message_type: param['message_type'],\r\n image_base64: param['image_base64'],\r\n send_at: moment(new Date(), 'YYYY-MM-DD hh:mm:ss'),\r\n }\r\n }));\r\n if (successCallback)\r\n successCallback(_res);\r\n },\r\n errorCallback\r\n );\r\n\r\n };\r\n\r\n if (param['image'])\r\n {\r\n // 画像は圧縮する\r\n const THUMBNAIL_WIDTH = 330; // 画像リサイズ後の横の長さの最大値\r\n const THUMBNAIL_HEIGHT = 330; // 画像リサイズ後の縦の長さの最大値\r\n\r\n let image = new Image();\r\n image.onload = function ()\r\n {\r\n let width, height;\r\n if (image.width > image.height)\r\n {\r\n let ratio = image.height / image.width;\r\n width = THUMBNAIL_WIDTH;\r\n height = THUMBNAIL_WIDTH * ratio;\r\n }\r\n else\r\n {\r\n let ratio = image.width / image.height;\r\n width = THUMBNAIL_HEIGHT * ratio;\r\n height = THUMBNAIL_HEIGHT;\r\n }\r\n let canvas = document.createElement(\"canvas\")\r\n canvas.setAttribute('width', width)\r\n canvas.setAttribute('height', height);\r\n let ctx = canvas.getContext('2d');\r\n ctx.clearRect(0, 0, width, height);\r\n ctx.drawImage(image, 0, 0, image.width, image.height, 0, 0, width, height);\r\n param['image_base64'] = canvas.toDataURL('image/jpeg');\r\n\r\n send();\r\n };\r\n image.src = param['image'];\r\n }\r\n else\r\n {\r\n send();\r\n }\r\n break;\r\n\r\n case BackendStatic.API_GET_MESSAGE:\r\n let _messageList = [];\r\n API.graphql(graphqlOperation(messagesByChannelSortedByCreatedAt,\r\n {\r\n channel: param['channel'],\r\n sortDirection: \"DESC\",\r\n limit: 20,\r\n nextToken: param['nextToken']\r\n }\r\n )).then(res =>\r\n {\r\n console.log(\"[API_GET_MESSAGE] DONE!\");\r\n console.log(res.data);\r\n\r\n res.data.messagesByChannelSortedByCreatedAt.items.forEach((message) =>\r\n {\r\n _messageList.push({\r\n id: message.id,\r\n user_id: message.sender_id,\r\n reply: message.sender_type,\r\n message_type: message.message_type,\r\n flag: false,\r\n read: false,\r\n content: message.body,\r\n media: message.image_base64,\r\n created_at: message.createdAt,\r\n updated_at: \"\"\r\n })\r\n });\r\n successCallback({\r\n message_list: _messageList,\r\n nextToken: res.data.messagesByChannelSortedByCreatedAt.nextToken,\r\n });\r\n }).catch(e =>\r\n {\r\n console.error(e);\r\n errorCallback(e);\r\n });\r\n break;\r\n\r\n case BackendStatic.API_GET_USER_LIST:\r\n this.request(\r\n component,\r\n '/backend/api/get_users',\r\n param,\r\n _res =>\r\n {\r\n successCallback({\r\n user_list: _res.users,\r\n total_list_size: _res.total\r\n });\r\n },\r\n errorCallback\r\n );\r\n break;\r\n\r\n case BackendStatic.API_GET_EVENT_LIST:\r\n this.request(\r\n component,\r\n '/backend/api/get_events',\r\n param,\r\n _res =>\r\n {\r\n successCallback({\r\n event_list: _res.events,\r\n total_list_size: _res.total,\r\n count: _res.count,\r\n account: _res.account,\r\n customer_information: _res.customer_information,\r\n paypal_client_id: _res.paypal_client_id,\r\n });\r\n },\r\n errorCallback\r\n );\r\n break;\r\n\r\n case BackendStatic.API_GET_CUSTOMIZE_EVENT_LIST:\r\n this.request(\r\n component,\r\n '/backend/api/get_customized_events',\r\n param,\r\n _res =>\r\n {\r\n successCallback({\r\n customized_event_list: _res.customized_events,\r\n });\r\n },\r\n errorCallback\r\n );\r\n break;\r\n\r\n case BackendStatic.API_UPDATE_RESERVATION_STATUS:\r\n this.request(\r\n component,\r\n '/backend/api/update_reservation_status',\r\n param,\r\n successCallback,\r\n errorCallback\r\n );\r\n break;\r\n\r\n case BackendStatic.API_GET_CHANGE_HISTORY:\r\n this.request(\r\n component,\r\n '/backend/api/get_change_histories',\r\n param,\r\n _change_history_list =>\r\n {\r\n successCallback({\r\n change_history_list: _change_history_list,\r\n });\r\n },\r\n errorCallback\r\n );\r\n break;\r\n\r\n case BackendStatic.API_GET_PAYMENT_LIST:\r\n this.request(\r\n component,\r\n '/backend/api/get_payments',\r\n param,\r\n _res =>\r\n {\r\n successCallback({\r\n payment_list: _res.payments,\r\n total_list_size: _res.total\r\n });\r\n },\r\n errorCallback\r\n );\r\n break;\r\n\r\n case BackendStatic.API_GET_BILL_LIST:\r\n this.request(\r\n component,\r\n '/backend/api/get_bills',\r\n param,\r\n _res =>\r\n {\r\n successCallback({\r\n bill_list: _res.bills,\r\n total_list_size: _res.total\r\n });\r\n },\r\n errorCallback\r\n );\r\n break;\r\n\r\n case BackendStatic.API_UPDATE_PAYMENT_STATUS:\r\n this.request(\r\n component,\r\n '/backend/api/update_payment_status',\r\n param,\r\n successCallback,\r\n errorCallback\r\n );\r\n break;\r\n\r\n case BackendStatic.API_GET_COUPON_LIST:\r\n this.request(\r\n component,\r\n '/backend/api/get_coupons',\r\n param,\r\n _res =>\r\n {\r\n successCallback({\r\n coupon_list: _res.coupons,\r\n total_list_size: _res.total\r\n });\r\n },\r\n errorCallback\r\n );\r\n break;\r\n\r\n case BackendStatic.API_EDIT_EVENT:\r\n // オブジェクトを削除\r\n if (param.event.eventTitle)\r\n param.event.eventTitle = undefined;\r\n\r\n console.log(\"event : \" + JSON.stringify(param));\r\n\r\n this.request(\r\n component,\r\n '/backend/api/edit_event',\r\n param,\r\n _res =>\r\n {\r\n if (_res.events.length > 0)\r\n {\r\n let variables = {\r\n input: {\r\n id: _res.events[0].order.id,\r\n order_id: _res.events[0].order.id,\r\n customer_id: _res.events[0].order.customer_id,\r\n edit_account_id: _res.account.id,\r\n }\r\n };\r\n\r\n if (param.event.id.toString().match(/_new_/))\r\n API.graphql(graphqlOperation(createReservation, variables));\r\n else\r\n API.graphql(graphqlOperation(updateReservation, variables));\r\n }\r\n\r\n successCallback(_res)\r\n },\r\n errorCallback\r\n );\r\n break;\r\n\r\n case BackendStatic.API_EDIT_ITEM:\r\n this.request(\r\n component,\r\n '/backend/api/edit_item',\r\n param,\r\n successCallback,\r\n errorCallback\r\n );\r\n break;\r\n\r\n case BackendStatic.API_EDIT_USER_INFORMATION:\r\n this.request(\r\n component,\r\n '/backend/api/edit_user_information',\r\n param,\r\n successCallback,\r\n errorCallback\r\n );\r\n break;\r\n\r\n case BackendStatic.API_EDIT_COUPON:\r\n this.request(\r\n component,\r\n '/backend/api/edit_coupon',\r\n param,\r\n successCallback,\r\n errorCallback\r\n );\r\n break;\r\n\r\n case BackendStatic.API_GRANT_USER_COUPON:\r\n this.request(\r\n component,\r\n '/backend/api/grant_user_coupon',\r\n param,\r\n successCallback,\r\n errorCallback\r\n );\r\n break;\r\n\r\n case BackendStatic.API_DROP_USER_COUPON:\r\n this.request(\r\n component,\r\n '/backend/api/drop_user_coupon',\r\n param,\r\n successCallback,\r\n errorCallback\r\n );\r\n break;\r\n\r\n case FrontendStatic.API_GET_USER_EVENT_LIST:\r\n this.request(\r\n component,\r\n '/frontend/api/get_events',\r\n param,\r\n _res =>\r\n {\r\n successCallback({\r\n event_list: _res.events,\r\n total_list_size: _res.total,\r\n count: _res.count,\r\n account: _res.account,\r\n customer_information: _res.customer_information,\r\n });\r\n },\r\n errorCallback\r\n );\r\n break;\r\n\r\n case FrontendStatic.API_GET_MY_INFORMATION:\r\n this.request(\r\n component,\r\n '/frontend/api/get_my_information',\r\n param,\r\n _res =>\r\n {\r\n successCallback({\r\n customer_information: _res.customer_information,\r\n user_information: _res.user_information,\r\n message_channel: _res.message_channel,\r\n paypal_client_id: _res.paypal_client_id,\r\n });\r\n },\r\n errorCallback\r\n );\r\n break;\r\n\r\n case FrontendStatic.API_GET_CUSTOMER_INFORMATION:\r\n this.request(\r\n component,\r\n '/frontend/api/get_customer',\r\n param,\r\n _res =>\r\n {\r\n successCallback({\r\n customer_information: _res.customer,\r\n });\r\n },\r\n errorCallback\r\n );\r\n break;\r\n\r\n case FrontendStatic.API_APPLY_EVENT:\r\n this.request(\r\n component,\r\n '/frontend/api/apply_event',\r\n param,\r\n _res =>\r\n {\r\n API.graphql(graphqlOperation(createReservation, {\r\n input: {\r\n id: _res.events[0].order.id,\r\n order_id: _res.events[0].order.id,\r\n customer_id: _res.events[0].order.customer_id,\r\n }\r\n }));\r\n successCallback(_res)\r\n },\r\n errorCallback\r\n );\r\n break;\r\n\r\n case FrontendStatic.API_CHECK_COUPON:\r\n this.request(\r\n component,\r\n '/frontend/api/check_coupon',\r\n param,\r\n _res =>\r\n {\r\n successCallback({\r\n available: _res.available,\r\n coupon: _res.coupon,\r\n user_coupons: _res.user_coupons,\r\n });\r\n },\r\n errorCallback\r\n );\r\n break;\r\n }\r\n }\r\n\r\n static request(component, url, params, successCallback = null, errorCallback = null)\r\n {\r\n console.log(url);\r\n\r\n if (component.setState) component.setState({loading: true});\r\n Axios.post(url, this.deepCopy(params))\r\n .then((response) =>\r\n {\r\n if (component.setState) component.setState({loading: false});\r\n if (successCallback) successCallback(response.data);\r\n })\r\n .catch((e) =>\r\n {\r\n if (component.setState) component.setState({loading: false});\r\n\r\n if (e.response && e.response.data)\r\n {\r\n console.error('url=' + url + '\\nerror : ' + e.response.data);\r\n if (e.response.status === 440)\r\n {\r\n location.reload(true);\r\n ErrorMessageProtocol.next('ログインセッションが切れました');\r\n return;\r\n }\r\n\r\n if (errorCallback) errorCallback(e.response.data);\r\n if (e.response.status === 400) ErrorMessageProtocol.next(e.response.data);\r\n else ErrorMessageProtocol.next('エラーが発生しました');\r\n }\r\n else\r\n {\r\n console.error(e);\r\n if (e.message === 'Network Error')\r\n {\r\n ErrorMessageProtocol.next('現在オフラインです。');\r\n }\r\n else\r\n {\r\n if (errorCallback) errorCallback('エラーが発生しました');\r\n else ErrorMessageProtocol.next('エラーが発生しました');\r\n }\r\n }\r\n });\r\n }\r\n\r\n static noticeUpdateReservation(order_id, customer_id, account_id = -1)\r\n {\r\n API.graphql(\r\n graphqlOperation(\r\n updateReservation,\r\n {\r\n input: {\r\n id: order_id,\r\n order_id: order_id,\r\n customer_id: customer_id,\r\n edit_account_id: account_id,\r\n }\r\n }\r\n )\r\n );\r\n }\r\n\r\n static getZipAddress(zipcode, successCallback)\r\n {\r\n Axios.get('https://api.zipaddress.net/?', {params: {zipcode: zipcode}})\r\n .then(_res =>\r\n {\r\n console.log(_res);\r\n if (_res.data.code >= 400)\r\n {\r\n successCallback({\r\n pref: '存在しません',\r\n city: '存在しません',\r\n town: '存在しません',\r\n });\r\n }\r\n else\r\n {\r\n successCallback(_res.data.data);\r\n }\r\n })\r\n .catch(e =>\r\n {\r\n successCallback({\r\n pref: '取得に失敗しました',\r\n city: '取得に失敗しました',\r\n town: '取得に失敗しました',\r\n });\r\n });\r\n }\r\n\r\n static notification(message)\r\n {\r\n let options = {\r\n body: message,\r\n icon: '/images/sharekan5.png',\r\n // vibrate: [200, 100, 200, 100, 200, 100, 200],\r\n // tag: 'vibration-sample'\r\n };\r\n\r\n try\r\n {\r\n if (Notification.permission === \"granted\")\r\n new Notification('シェアカン', options);\r\n else\r\n Notification.requestPermission(function (permission)\r\n {\r\n if (permission === \"granted\")\r\n new Notification('シェアカン', options);\r\n });\r\n }\r\n catch (e)\r\n {\r\n console.log(e);\r\n }\r\n }\r\n\r\n static getStorageContent(params_str, callback)\r\n {\r\n console.log('【getStorageContent】 ' + params_str);\r\n\r\n if (!params_str)\r\n return callback(\"\");\r\n\r\n let params = params_str;\r\n if (typeof params_str === 'string')\r\n try\r\n {\r\n params = JSON.parse(params_str);\r\n }\r\n catch (e)\r\n {\r\n params = {};\r\n }\r\n let key = params.key;\r\n // delete params.key;\r\n Storage.get(key, params)\r\n .then(result =>\r\n {\r\n console.log(result);\r\n callback(result);\r\n })\r\n .catch(err => console.log(err));\r\n }\r\n\r\n\r\n /**\r\n * Google Analytics Tracking\r\n */\r\n static isInitializedGoogleAnalytics = false;\r\n\r\n static initializeGoogleAnalytics(trackingId)\r\n {\r\n if (trackingId)\r\n {\r\n ReactGA.initialize(trackingId);\r\n this.isInitializedGoogleAnalytics = true;\r\n }\r\n else\r\n {\r\n this.isInitializedGoogleAnalytics = false;\r\n }\r\n }\r\n\r\n static viewPathGoogleAnalytics(path)\r\n {\r\n if (this.isInitializedGoogleAnalytics)\r\n {\r\n ReactGA.set({page: path});\r\n ReactGA.pageview(path);\r\n }\r\n }\r\n\r\n static conversionGoogleAnalytics(send_to)\r\n {\r\n if (this.isInitializedGoogleAnalytics && send_to)\r\n {\r\n ReactGA.ga('event', 'conversion', {'send_to': send_to});\r\n }\r\n }\r\n}","/* eslint-disable */\n// this is an auto generated file. This will be overwritten\n\nexport const getReservation = /* GraphQL */ `\n query GetReservation($id: ID!) {\n getReservation(id: $id) {\n id\n customer_id\n order_id\n edit_account_id\n }\n }\n`;\nexport const listReservations = /* GraphQL */ `\n query ListReservations(\n $filter: ModelReservationFilterInput\n $limit: Int\n $nextToken: String\n ) {\n listReservations(filter: $filter, limit: $limit, nextToken: $nextToken) {\n items {\n id\n customer_id\n order_id\n edit_account_id\n }\n nextToken\n }\n }\n`;\nexport const getMessage = /* GraphQL */ `\n query GetMessage($id: ID!) {\n getMessage(id: $id) {\n id\n customer_id\n channel\n sender_type\n sender_id\n body\n message_type\n image_base64\n send_at\n createdAt\n }\n }\n`;\nexport const listMessages = /* GraphQL */ `\n query ListMessages(\n $filter: ModelMessageFilterInput\n $limit: Int\n $nextToken: String\n ) {\n listMessages(filter: $filter, limit: $limit, nextToken: $nextToken) {\n items {\n id\n customer_id\n channel\n sender_type\n sender_id\n body\n message_type\n image_base64\n send_at\n createdAt\n }\n nextToken\n }\n }\n`;\nexport const reservationsByCustomerId = /* GraphQL */ `\n query ReservationsByCustomerId(\n $customer_id: Int\n $sortDirection: ModelSortDirection\n $filter: ModelReservationFilterInput\n $limit: Int\n $nextToken: String\n ) {\n reservationsByCustomerId(\n customer_id: $customer_id\n sortDirection: $sortDirection\n filter: $filter\n limit: $limit\n nextToken: $nextToken\n ) {\n items {\n id\n customer_id\n order_id\n edit_account_id\n }\n nextToken\n }\n }\n`;\nexport const messagesByChannel = /* GraphQL */ `\n query MessagesByChannel(\n $channel: String\n $sortDirection: ModelSortDirection\n $filter: ModelMessageFilterInput\n $limit: Int\n $nextToken: String\n ) {\n messagesByChannel(\n channel: $channel\n sortDirection: $sortDirection\n filter: $filter\n limit: $limit\n nextToken: $nextToken\n ) {\n items {\n id\n customer_id\n channel\n sender_type\n sender_id\n body\n message_type\n image_base64\n send_at\n createdAt\n }\n nextToken\n }\n }\n`;\nexport const messagesByChannelSortedBySendAt = /* GraphQL */ `\n query MessagesByChannelSortedBySendAt(\n $channel: String\n $send_at: ModelStringKeyConditionInput\n $sortDirection: ModelSortDirection\n $filter: ModelMessageFilterInput\n $limit: Int\n $nextToken: String\n ) {\n messagesByChannelSortedBySendAt(\n channel: $channel\n send_at: $send_at\n sortDirection: $sortDirection\n filter: $filter\n limit: $limit\n nextToken: $nextToken\n ) {\n items {\n id\n customer_id\n channel\n sender_type\n sender_id\n body\n message_type\n image_base64\n send_at\n createdAt\n }\n nextToken\n }\n }\n`;\nexport const messagesByChannelSortedByCreatedAt = /* GraphQL */ `\n query MessagesByChannelSortedByCreatedAt(\n $channel: String\n $createdAt: ModelStringKeyConditionInput\n $sortDirection: ModelSortDirection\n $filter: ModelMessageFilterInput\n $limit: Int\n $nextToken: String\n ) {\n messagesByChannelSortedByCreatedAt(\n channel: $channel\n createdAt: $createdAt\n sortDirection: $sortDirection\n filter: $filter\n limit: $limit\n nextToken: $nextToken\n ) {\n items {\n id\n customer_id\n channel\n sender_type\n sender_id\n body\n message_type\n image_base64\n send_at\n createdAt\n }\n nextToken\n }\n }\n`;\nexport const messagesByCustomerId = /* GraphQL */ `\n query MessagesByCustomerId(\n $customer_id: Int\n $sortDirection: ModelSortDirection\n $filter: ModelMessageFilterInput\n $limit: Int\n $nextToken: String\n ) {\n messagesByCustomerId(\n customer_id: $customer_id\n sortDirection: $sortDirection\n filter: $filter\n limit: $limit\n nextToken: $nextToken\n ) {\n items {\n id\n customer_id\n channel\n sender_type\n sender_id\n body\n message_type\n image_base64\n send_at\n createdAt\n }\n nextToken\n }\n }\n`;\n","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n/* eslint-disable no-proto */\n'use strict';\n\nvar base64 = require('base64-js');\n\nvar ieee754 = require('ieee754');\n\nvar isArray = require('isarray');\n\nexports.Buffer = Buffer;\nexports.SlowBuffer = SlowBuffer;\nexports.INSPECT_MAX_BYTES = 50;\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\n\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined ? global.TYPED_ARRAY_SUPPORT : typedArraySupport();\n/*\n * Export kMaxLength after typed array support is determined.\n */\n\nexports.kMaxLength = kMaxLength();\n\nfunction typedArraySupport() {\n try {\n var arr = new Uint8Array(1);\n arr.__proto__ = {\n __proto__: Uint8Array.prototype,\n foo: function foo() {\n return 42;\n }\n };\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0; // ie10 has broken `subarray`\n } catch (e) {\n return false;\n }\n}\n\nfunction kMaxLength() {\n return Buffer.TYPED_ARRAY_SUPPORT ? 0x7fffffff : 0x3fffffff;\n}\n\nfunction createBuffer(that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length');\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length);\n that.__proto__ = Buffer.prototype;\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length);\n }\n\n that.length = length;\n }\n\n return that;\n}\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\n\nfunction Buffer(arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length);\n } // Common case.\n\n\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error('If encoding is specified then the first argument must be a string');\n }\n\n return allocUnsafe(this, arg);\n }\n\n return from(this, arg, encodingOrOffset, length);\n}\n\nBuffer.poolSize = 8192; // not used by this implementation\n// TODO: Legacy, not needed anymore. Remove in next major version.\n\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype;\n return arr;\n};\n\nfunction from(that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number');\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length);\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset);\n }\n\n return fromObject(that, value);\n}\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\n\n\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length);\n};\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype;\n Buffer.__proto__ = Uint8Array;\n\n if (typeof Symbol !== 'undefined' && Symbol.species && Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n });\n }\n}\n\nfunction assertSize(size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number');\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative');\n }\n}\n\nfunction alloc(that, size, fill, encoding) {\n assertSize(size);\n\n if (size <= 0) {\n return createBuffer(that, size);\n }\n\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string' ? createBuffer(that, size).fill(fill, encoding) : createBuffer(that, size).fill(fill);\n }\n\n return createBuffer(that, size);\n}\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\n\n\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding);\n};\n\nfunction allocUnsafe(that, size) {\n assertSize(size);\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0;\n }\n }\n\n return that;\n}\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\n\n\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size);\n};\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\n\n\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size);\n};\n\nfunction fromString(that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8';\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding');\n }\n\n var length = byteLength(string, encoding) | 0;\n that = createBuffer(that, length);\n var actual = that.write(string, encoding);\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual);\n }\n\n return that;\n}\n\nfunction fromArrayLike(that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0;\n that = createBuffer(that, length);\n\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255;\n }\n\n return that;\n}\n\nfunction fromArrayBuffer(that, array, byteOffset, length) {\n array.byteLength; // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds');\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds');\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array);\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset);\n } else {\n array = new Uint8Array(array, byteOffset, length);\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array;\n that.__proto__ = Buffer.prototype;\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array);\n }\n\n return that;\n}\n\nfunction fromObject(that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0;\n that = createBuffer(that, len);\n\n if (that.length === 0) {\n return that;\n }\n\n obj.copy(that, 0, 0, len);\n return that;\n }\n\n if (obj) {\n if (typeof ArrayBuffer !== 'undefined' && obj.buffer instanceof ArrayBuffer || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0);\n }\n\n return fromArrayLike(that, obj);\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data);\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.');\n}\n\nfunction checked(length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + kMaxLength().toString(16) + ' bytes');\n }\n\n return length | 0;\n}\n\nfunction SlowBuffer(length) {\n if (+length != length) {\n // eslint-disable-line eqeqeq\n length = 0;\n }\n\n return Buffer.alloc(+length);\n}\n\nBuffer.isBuffer = function isBuffer(b) {\n return !!(b != null && b._isBuffer);\n};\n\nBuffer.compare = function compare(a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers');\n }\n\n if (a === b) return 0;\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) return -1;\n if (y < x) return 1;\n return 0;\n};\n\nBuffer.isEncoding = function isEncoding(encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true;\n\n default:\n return false;\n }\n};\n\nBuffer.concat = function concat(list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers');\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0);\n }\n\n var i;\n\n if (length === undefined) {\n length = 0;\n\n for (i = 0; i < list.length; ++i) {\n length += list[i].length;\n }\n }\n\n var buffer = Buffer.allocUnsafe(length);\n var pos = 0;\n\n for (i = 0; i < list.length; ++i) {\n var buf = list[i];\n\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers');\n }\n\n buf.copy(buffer, pos);\n pos += buf.length;\n }\n\n return buffer;\n};\n\nfunction byteLength(string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length;\n }\n\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength;\n }\n\n if (typeof string !== 'string') {\n string = '' + string;\n }\n\n var len = string.length;\n if (len === 0) return 0; // Use a for loop to avoid recursion\n\n var loweredCase = false;\n\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len;\n\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length;\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2;\n\n case 'hex':\n return len >>> 1;\n\n case 'base64':\n return base64ToBytes(string).length;\n\n default:\n if (loweredCase) return utf8ToBytes(string).length; // assume utf8\n\n encoding = ('' + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n}\n\nBuffer.byteLength = byteLength;\n\nfunction slowToString(encoding, start, end) {\n var loweredCase = false; // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n\n if (start === undefined || start < 0) {\n start = 0;\n } // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n\n\n if (start > this.length) {\n return '';\n }\n\n if (end === undefined || end > this.length) {\n end = this.length;\n }\n\n if (end <= 0) {\n return '';\n } // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n\n\n end >>>= 0;\n start >>>= 0;\n\n if (end <= start) {\n return '';\n }\n\n if (!encoding) encoding = 'utf8';\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end);\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end);\n\n case 'ascii':\n return asciiSlice(this, start, end);\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end);\n\n case 'base64':\n return base64Slice(this, start, end);\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end);\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);\n encoding = (encoding + '').toLowerCase();\n loweredCase = true;\n }\n }\n} // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\n\n\nBuffer.prototype._isBuffer = true;\n\nfunction swap(b, n, m) {\n var i = b[n];\n b[n] = b[m];\n b[m] = i;\n}\n\nBuffer.prototype.swap16 = function swap16() {\n var len = this.length;\n\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits');\n }\n\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1);\n }\n\n return this;\n};\n\nBuffer.prototype.swap32 = function swap32() {\n var len = this.length;\n\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits');\n }\n\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3);\n swap(this, i + 1, i + 2);\n }\n\n return this;\n};\n\nBuffer.prototype.swap64 = function swap64() {\n var len = this.length;\n\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits');\n }\n\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7);\n swap(this, i + 1, i + 6);\n swap(this, i + 2, i + 5);\n swap(this, i + 3, i + 4);\n }\n\n return this;\n};\n\nBuffer.prototype.toString = function toString() {\n var length = this.length | 0;\n if (length === 0) return '';\n if (arguments.length === 0) return utf8Slice(this, 0, length);\n return slowToString.apply(this, arguments);\n};\n\nBuffer.prototype.equals = function equals(b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer');\n if (this === b) return true;\n return Buffer.compare(this, b) === 0;\n};\n\nBuffer.prototype.inspect = function inspect() {\n var str = '';\n var max = exports.INSPECT_MAX_BYTES;\n\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ');\n if (this.length > max) str += ' ... ';\n }\n\n return '';\n};\n\nBuffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer');\n }\n\n if (start === undefined) {\n start = 0;\n }\n\n if (end === undefined) {\n end = target ? target.length : 0;\n }\n\n if (thisStart === undefined) {\n thisStart = 0;\n }\n\n if (thisEnd === undefined) {\n thisEnd = this.length;\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index');\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0;\n }\n\n if (thisStart >= thisEnd) {\n return -1;\n }\n\n if (start >= end) {\n return 1;\n }\n\n start >>>= 0;\n end >>>= 0;\n thisStart >>>= 0;\n thisEnd >>>= 0;\n if (this === target) return 0;\n var x = thisEnd - thisStart;\n var y = end - start;\n var len = Math.min(x, y);\n var thisCopy = this.slice(thisStart, thisEnd);\n var targetCopy = target.slice(start, end);\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i];\n y = targetCopy[i];\n break;\n }\n }\n\n if (x < y) return -1;\n if (y < x) return 1;\n return 0;\n}; // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\n\n\nfunction bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n}\n\nfunction arrayIndexOf(arr, val, byteOffset, encoding, dir) {\n var indexSize = 1;\n var arrLength = arr.length;\n var valLength = val.length;\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase();\n\n if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1;\n }\n\n indexSize = 2;\n arrLength /= 2;\n valLength /= 2;\n byteOffset /= 2;\n }\n }\n\n function read(buf, i) {\n if (indexSize === 1) {\n return buf[i];\n } else {\n return buf.readUInt16BE(i * indexSize);\n }\n }\n\n var i;\n\n if (dir) {\n var foundIndex = -1;\n\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i;\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;\n } else {\n if (foundIndex !== -1) i -= i - foundIndex;\n foundIndex = -1;\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;\n\n for (i = byteOffset; i >= 0; i--) {\n var found = true;\n\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false;\n break;\n }\n }\n\n if (found) return i;\n }\n }\n\n return -1;\n}\n\nBuffer.prototype.includes = function includes(val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1;\n};\n\nBuffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true);\n};\n\nBuffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false);\n};\n\nfunction hexWrite(buf, string, offset, length) {\n offset = Number(offset) || 0;\n var remaining = buf.length - offset;\n\n if (!length) {\n length = remaining;\n } else {\n length = Number(length);\n\n if (length > remaining) {\n length = remaining;\n }\n } // must be an even number of digits\n\n\n var strLen = string.length;\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string');\n\n if (length > strLen / 2) {\n length = strLen / 2;\n }\n\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16);\n if (isNaN(parsed)) return i;\n buf[offset + i] = parsed;\n }\n\n return i;\n}\n\nfunction utf8Write(buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);\n}\n\nfunction asciiWrite(buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length);\n}\n\nfunction latin1Write(buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length);\n}\n\nfunction base64Write(buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length);\n}\n\nfunction ucs2Write(buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);\n}\n\nBuffer.prototype.write = function write(string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8';\n length = this.length;\n offset = 0; // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset;\n length = this.length;\n offset = 0; // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0;\n\n if (isFinite(length)) {\n length = length | 0;\n if (encoding === undefined) encoding = 'utf8';\n } else {\n encoding = length;\n length = undefined;\n } // legacy write(string, encoding, offset, length) - remove in v0.13\n\n } else {\n throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported');\n }\n\n var remaining = this.length - offset;\n if (length === undefined || length > remaining) length = remaining;\n\n if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds');\n }\n\n if (!encoding) encoding = 'utf8';\n var loweredCase = false;\n\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length);\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length);\n\n case 'ascii':\n return asciiWrite(this, string, offset, length);\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length);\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length);\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length);\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);\n encoding = ('' + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n};\n\nBuffer.prototype.toJSON = function toJSON() {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n };\n};\n\nfunction base64Slice(buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf);\n } else {\n return base64.fromByteArray(buf.slice(start, end));\n }\n}\n\nfunction utf8Slice(buf, start, end) {\n end = Math.min(buf.length, end);\n var res = [];\n var i = start;\n\n while (i < end) {\n var firstByte = buf[i];\n var codePoint = null;\n var bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1;\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint;\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte;\n }\n\n break;\n\n case 2:\n secondByte = buf[i + 1];\n\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F;\n\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint;\n }\n }\n\n break;\n\n case 3:\n secondByte = buf[i + 1];\n thirdByte = buf[i + 2];\n\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F;\n\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint;\n }\n }\n\n break;\n\n case 4:\n secondByte = buf[i + 1];\n thirdByte = buf[i + 2];\n fourthByte = buf[i + 3];\n\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F;\n\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint;\n }\n }\n\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD;\n bytesPerSequence = 1;\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000;\n res.push(codePoint >>> 10 & 0x3FF | 0xD800);\n codePoint = 0xDC00 | codePoint & 0x3FF;\n }\n\n res.push(codePoint);\n i += bytesPerSequence;\n }\n\n return decodeCodePointsArray(res);\n} // Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\n\n\nvar MAX_ARGUMENTS_LENGTH = 0x1000;\n\nfunction decodeCodePointsArray(codePoints) {\n var len = codePoints.length;\n\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints); // avoid extra slice()\n } // Decode in chunks to avoid \"call stack size exceeded\".\n\n\n var res = '';\n var i = 0;\n\n while (i < len) {\n res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));\n }\n\n return res;\n}\n\nfunction asciiSlice(buf, start, end) {\n var ret = '';\n end = Math.min(buf.length, end);\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F);\n }\n\n return ret;\n}\n\nfunction latin1Slice(buf, start, end) {\n var ret = '';\n end = Math.min(buf.length, end);\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i]);\n }\n\n return ret;\n}\n\nfunction hexSlice(buf, start, end) {\n var len = buf.length;\n if (!start || start < 0) start = 0;\n if (!end || end < 0 || end > len) end = len;\n var out = '';\n\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i]);\n }\n\n return out;\n}\n\nfunction utf16leSlice(buf, start, end) {\n var bytes = buf.slice(start, end);\n var res = '';\n\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);\n }\n\n return res;\n}\n\nBuffer.prototype.slice = function slice(start, end) {\n var len = this.length;\n start = ~~start;\n end = end === undefined ? len : ~~end;\n\n if (start < 0) {\n start += len;\n if (start < 0) start = 0;\n } else if (start > len) {\n start = len;\n }\n\n if (end < 0) {\n end += len;\n if (end < 0) end = 0;\n } else if (end > len) {\n end = len;\n }\n\n if (end < start) end = start;\n var newBuf;\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end);\n newBuf.__proto__ = Buffer.prototype;\n } else {\n var sliceLen = end - start;\n newBuf = new Buffer(sliceLen, undefined);\n\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start];\n }\n }\n\n return newBuf;\n};\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\n\n\nfunction checkOffset(offset, ext, length) {\n if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint');\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length');\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {\n offset = offset | 0;\n byteLength = byteLength | 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n var val = this[offset];\n var mul = 1;\n var i = 0;\n\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul;\n }\n\n return val;\n};\n\nBuffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {\n offset = offset | 0;\n byteLength = byteLength | 0;\n\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length);\n }\n\n var val = this[offset + --byteLength];\n var mul = 1;\n\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul;\n }\n\n return val;\n};\n\nBuffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length);\n return this[offset];\n};\n\nBuffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length);\n return this[offset] | this[offset + 1] << 8;\n};\n\nBuffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length);\n return this[offset] << 8 | this[offset + 1];\n};\n\nBuffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000;\n};\n\nBuffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);\n};\n\nBuffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {\n offset = offset | 0;\n byteLength = byteLength | 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n var val = this[offset];\n var mul = 1;\n var i = 0;\n\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul;\n }\n\n mul *= 0x80;\n if (val >= mul) val -= Math.pow(2, 8 * byteLength);\n return val;\n};\n\nBuffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {\n offset = offset | 0;\n byteLength = byteLength | 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n var i = byteLength;\n var mul = 1;\n var val = this[offset + --i];\n\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul;\n }\n\n mul *= 0x80;\n if (val >= mul) val -= Math.pow(2, 8 * byteLength);\n return val;\n};\n\nBuffer.prototype.readInt8 = function readInt8(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length);\n if (!(this[offset] & 0x80)) return this[offset];\n return (0xff - this[offset] + 1) * -1;\n};\n\nBuffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length);\n var val = this[offset] | this[offset + 1] << 8;\n return val & 0x8000 ? val | 0xFFFF0000 : val;\n};\n\nBuffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length);\n var val = this[offset + 1] | this[offset] << 8;\n return val & 0x8000 ? val | 0xFFFF0000 : val;\n};\n\nBuffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;\n};\n\nBuffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];\n};\n\nBuffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return ieee754.read(this, offset, true, 23, 4);\n};\n\nBuffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return ieee754.read(this, offset, false, 23, 4);\n};\n\nBuffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length);\n return ieee754.read(this, offset, true, 52, 8);\n};\n\nBuffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length);\n return ieee754.read(this, offset, false, 52, 8);\n};\n\nfunction checkInt(buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance');\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds');\n if (offset + ext > buf.length) throw new RangeError('Index out of range');\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset | 0;\n byteLength = byteLength | 0;\n\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1;\n checkInt(this, value, offset, byteLength, maxBytes, 0);\n }\n\n var mul = 1;\n var i = 0;\n this[offset] = value & 0xFF;\n\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = value / mul & 0xFF;\n }\n\n return offset + byteLength;\n};\n\nBuffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset | 0;\n byteLength = byteLength | 0;\n\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1;\n checkInt(this, value, offset, byteLength, maxBytes, 0);\n }\n\n var i = byteLength - 1;\n var mul = 1;\n this[offset + i] = value & 0xFF;\n\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = value / mul & 0xFF;\n }\n\n return offset + byteLength;\n};\n\nBuffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0);\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);\n this[offset] = value & 0xff;\n return offset + 1;\n};\n\nfunction objectWriteUInt16(buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1;\n\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & 0xff << 8 * (littleEndian ? i : 1 - i)) >>> (littleEndian ? i : 1 - i) * 8;\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value & 0xff;\n this[offset + 1] = value >>> 8;\n } else {\n objectWriteUInt16(this, value, offset, true);\n }\n\n return offset + 2;\n};\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 8;\n this[offset + 1] = value & 0xff;\n } else {\n objectWriteUInt16(this, value, offset, false);\n }\n\n return offset + 2;\n};\n\nfunction objectWriteUInt32(buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1;\n\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = value >>> (littleEndian ? i : 3 - i) * 8 & 0xff;\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = value >>> 24;\n this[offset + 2] = value >>> 16;\n this[offset + 1] = value >>> 8;\n this[offset] = value & 0xff;\n } else {\n objectWriteUInt32(this, value, offset, true);\n }\n\n return offset + 4;\n};\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 24;\n this[offset + 1] = value >>> 16;\n this[offset + 2] = value >>> 8;\n this[offset + 3] = value & 0xff;\n } else {\n objectWriteUInt32(this, value, offset, false);\n }\n\n return offset + 4;\n};\n\nBuffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset | 0;\n\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1);\n checkInt(this, value, offset, byteLength, limit - 1, -limit);\n }\n\n var i = 0;\n var mul = 1;\n var sub = 0;\n this[offset] = value & 0xFF;\n\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1;\n }\n\n this[offset + i] = (value / mul >> 0) - sub & 0xFF;\n }\n\n return offset + byteLength;\n};\n\nBuffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset | 0;\n\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1);\n checkInt(this, value, offset, byteLength, limit - 1, -limit);\n }\n\n var i = byteLength - 1;\n var mul = 1;\n var sub = 0;\n this[offset + i] = value & 0xFF;\n\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1;\n }\n\n this[offset + i] = (value / mul >> 0) - sub & 0xFF;\n }\n\n return offset + byteLength;\n};\n\nBuffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80);\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);\n if (value < 0) value = 0xff + value + 1;\n this[offset] = value & 0xff;\n return offset + 1;\n};\n\nBuffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value & 0xff;\n this[offset + 1] = value >>> 8;\n } else {\n objectWriteUInt16(this, value, offset, true);\n }\n\n return offset + 2;\n};\n\nBuffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 8;\n this[offset + 1] = value & 0xff;\n } else {\n objectWriteUInt16(this, value, offset, false);\n }\n\n return offset + 2;\n};\n\nBuffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value & 0xff;\n this[offset + 1] = value >>> 8;\n this[offset + 2] = value >>> 16;\n this[offset + 3] = value >>> 24;\n } else {\n objectWriteUInt32(this, value, offset, true);\n }\n\n return offset + 4;\n};\n\nBuffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);\n if (value < 0) value = 0xffffffff + value + 1;\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 24;\n this[offset + 1] = value >>> 16;\n this[offset + 2] = value >>> 8;\n this[offset + 3] = value & 0xff;\n } else {\n objectWriteUInt32(this, value, offset, false);\n }\n\n return offset + 4;\n};\n\nfunction checkIEEE754(buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range');\n if (offset < 0) throw new RangeError('Index out of range');\n}\n\nfunction writeFloat(buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38);\n }\n\n ieee754.write(buf, value, offset, littleEndian, 23, 4);\n return offset + 4;\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert);\n};\n\nBuffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert);\n};\n\nfunction writeDouble(buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308);\n }\n\n ieee754.write(buf, value, offset, littleEndian, 52, 8);\n return offset + 8;\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert);\n};\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert);\n}; // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\n\n\nBuffer.prototype.copy = function copy(target, targetStart, start, end) {\n if (!start) start = 0;\n if (!end && end !== 0) end = this.length;\n if (targetStart >= target.length) targetStart = target.length;\n if (!targetStart) targetStart = 0;\n if (end > 0 && end < start) end = start; // Copy 0 bytes; we're done\n\n if (end === start) return 0;\n if (target.length === 0 || this.length === 0) return 0; // Fatal error conditions\n\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds');\n }\n\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds');\n if (end < 0) throw new RangeError('sourceEnd out of bounds'); // Are we oob?\n\n if (end > this.length) end = this.length;\n\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start;\n }\n\n var len = end - start;\n var i;\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start];\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start];\n }\n } else {\n Uint8Array.prototype.set.call(target, this.subarray(start, start + len), targetStart);\n }\n\n return len;\n}; // Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\n\n\nBuffer.prototype.fill = function fill(val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start;\n start = 0;\n end = this.length;\n } else if (typeof end === 'string') {\n encoding = end;\n end = this.length;\n }\n\n if (val.length === 1) {\n var code = val.charCodeAt(0);\n\n if (code < 256) {\n val = code;\n }\n }\n\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string');\n }\n\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding);\n }\n } else if (typeof val === 'number') {\n val = val & 255;\n } // Invalid ranges are not set to a default, so can range check early.\n\n\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index');\n }\n\n if (end <= start) {\n return this;\n }\n\n start = start >>> 0;\n end = end === undefined ? this.length : end >>> 0;\n if (!val) val = 0;\n var i;\n\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val;\n }\n } else {\n var bytes = Buffer.isBuffer(val) ? val : utf8ToBytes(new Buffer(val, encoding).toString());\n var len = bytes.length;\n\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len];\n }\n }\n\n return this;\n}; // HELPER FUNCTIONS\n// ================\n\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g;\n\nfunction base64clean(str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, ''); // Node converts strings with length < 2 to ''\n\n if (str.length < 2) return ''; // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n\n while (str.length % 4 !== 0) {\n str = str + '=';\n }\n\n return str;\n}\n\nfunction stringtrim(str) {\n if (str.trim) return str.trim();\n return str.replace(/^\\s+|\\s+$/g, '');\n}\n\nfunction toHex(n) {\n if (n < 16) return '0' + n.toString(16);\n return n.toString(16);\n}\n\nfunction utf8ToBytes(string, units) {\n units = units || Infinity;\n var codePoint;\n var length = string.length;\n var leadSurrogate = null;\n var bytes = [];\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i); // is surrogate component\n\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);\n continue;\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);\n continue;\n } // valid lead\n\n\n leadSurrogate = codePoint;\n continue;\n } // 2 leads in a row\n\n\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);\n leadSurrogate = codePoint;\n continue;\n } // valid surrogate pair\n\n\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000;\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);\n }\n\n leadSurrogate = null; // encode utf8\n\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break;\n bytes.push(codePoint);\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break;\n bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80);\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break;\n bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break;\n bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);\n } else {\n throw new Error('Invalid code point');\n }\n }\n\n return bytes;\n}\n\nfunction asciiToBytes(str) {\n var byteArray = [];\n\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF);\n }\n\n return byteArray;\n}\n\nfunction utf16leToBytes(str, units) {\n var c, hi, lo;\n var byteArray = [];\n\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break;\n c = str.charCodeAt(i);\n hi = c >> 8;\n lo = c % 256;\n byteArray.push(lo);\n byteArray.push(hi);\n }\n\n return byteArray;\n}\n\nfunction base64ToBytes(str) {\n return base64.toByteArray(base64clean(str));\n}\n\nfunction blitBuffer(src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if (i + offset >= dst.length || i >= src.length) break;\n dst[i + offset] = src[i];\n }\n\n return i;\n}\n\nfunction isnan(val) {\n return val !== val; // eslint-disable-line no-self-compare\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport responsivePropType from './responsivePropType';\nimport { handleBreakpoints } from './breakpoints';\n\nfunction getPath(obj, path) {\n if (!path || typeof path !== 'string') {\n return null;\n }\n\n return path.split('.').reduce(function (acc, item) {\n return acc && acc[item] ? acc[item] : null;\n }, obj);\n}\n\nfunction style(options) {\n var prop = options.prop,\n _options$cssProperty = options.cssProperty,\n cssProperty = _options$cssProperty === void 0 ? options.prop : _options$cssProperty,\n themeKey = options.themeKey,\n transform = options.transform;\n\n var fn = function fn(props) {\n if (props[prop] == null) {\n return null;\n }\n\n var propValue = props[prop];\n var theme = props.theme;\n var themeMapping = getPath(theme, themeKey) || {};\n\n var styleFromPropValue = function styleFromPropValue(propValueFinal) {\n var value;\n\n if (typeof themeMapping === 'function') {\n value = themeMapping(propValueFinal);\n } else if (Array.isArray(themeMapping)) {\n value = themeMapping[propValueFinal] || propValueFinal;\n } else {\n value = getPath(themeMapping, propValueFinal) || propValueFinal;\n\n if (transform) {\n value = transform(value);\n }\n }\n\n if (cssProperty === false) {\n return value;\n }\n\n return _defineProperty({}, cssProperty, value);\n };\n\n return handleBreakpoints(props, propValue, styleFromPropValue);\n };\n\n fn.propTypes = process.env.NODE_ENV !== 'production' ? _defineProperty({}, prop, responsivePropType) : {};\n fn.filterProps = [prop];\n return fn;\n}\n\nexport default style;","/* eslint-disable no-use-before-define */\n\n/**\n * Returns a number whose value is limited to the given range.\n *\n * @param {number} value The value to be clamped\n * @param {number} min The lower boundary of the output range\n * @param {number} max The upper boundary of the output range\n * @returns {number} A number in the range [min, max]\n */\nfunction clamp(value) {\n var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n\n if (process.env.NODE_ENV !== 'production') {\n if (value < min || value > max) {\n console.error(\"Material-UI: the value provided \".concat(value, \" is out of range [\").concat(min, \", \").concat(max, \"].\"));\n }\n }\n\n return Math.min(Math.max(min, value), max);\n}\n/**\n * Converts a color from CSS hex format to CSS rgb format.\n *\n * @param {string} color - Hex color, i.e. #nnn or #nnnnnn\n * @returns {string} A CSS rgb color string\n */\n\n\nexport function hexToRgb(color) {\n color = color.substr(1);\n var re = new RegExp(\".{1,\".concat(color.length / 3, \"}\"), 'g');\n var colors = color.match(re);\n\n if (colors && colors[0].length === 1) {\n colors = colors.map(function (n) {\n return n + n;\n });\n }\n\n return colors ? \"rgb(\".concat(colors.map(function (n) {\n return parseInt(n, 16);\n }).join(', '), \")\") : '';\n}\n\nfunction intToHex(_int) {\n var hex = _int.toString(16);\n\n return hex.length === 1 ? \"0\".concat(hex) : hex;\n}\n/**\n * Converts a color from CSS rgb format to CSS hex format.\n *\n * @param {string} color - RGB color, i.e. rgb(n, n, n)\n * @returns {string} A CSS rgb color string, i.e. #nnnnnn\n */\n\n\nexport function rgbToHex(color) {\n // Idempotent\n if (color.indexOf('#') === 0) {\n return color;\n }\n\n var _decomposeColor = decomposeColor(color),\n values = _decomposeColor.values;\n\n return \"#\".concat(values.map(function (n) {\n return intToHex(n);\n }).join(''));\n}\n/**\n * Converts a color from hsl format to rgb format.\n *\n * @param {string} color - HSL color values\n * @returns {string} rgb color values\n */\n\nexport function hslToRgb(color) {\n color = decomposeColor(color);\n var _color = color,\n values = _color.values;\n var h = values[0];\n var s = values[1] / 100;\n var l = values[2] / 100;\n var a = s * Math.min(l, 1 - l);\n\n var f = function f(n) {\n var k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (n + h / 30) % 12;\n return l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n };\n\n var type = 'rgb';\n var rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];\n\n if (color.type === 'hsla') {\n type += 'a';\n rgb.push(values[3]);\n }\n\n return recomposeColor({\n type: type,\n values: rgb\n });\n}\n/**\n * Returns an object with the type and values of a color.\n *\n * Note: Does not support rgb % values.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {object} - A MUI color object: {type: string, values: number[]}\n */\n\nexport function decomposeColor(color) {\n // Idempotent\n if (color.type) {\n return color;\n }\n\n if (color.charAt(0) === '#') {\n return decomposeColor(hexToRgb(color));\n }\n\n var marker = color.indexOf('(');\n var type = color.substring(0, marker);\n\n if (['rgb', 'rgba', 'hsl', 'hsla'].indexOf(type) === -1) {\n throw new Error([\"Material-UI: unsupported `\".concat(color, \"` color.\"), 'We support the following formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla().'].join('\\n'));\n }\n\n var values = color.substring(marker + 1, color.length - 1).split(',');\n values = values.map(function (value) {\n return parseFloat(value);\n });\n return {\n type: type,\n values: values\n };\n}\n/**\n * Converts a color object with type and values to a string.\n *\n * @param {object} color - Decomposed color\n * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla'\n * @param {array} color.values - [n,n,n] or [n,n,n,n]\n * @returns {string} A CSS color string\n */\n\nexport function recomposeColor(color) {\n var type = color.type;\n var values = color.values;\n\n if (type.indexOf('rgb') !== -1) {\n // Only convert the first 3 values to int (i.e. not alpha)\n values = values.map(function (n, i) {\n return i < 3 ? parseInt(n, 10) : n;\n });\n } else if (type.indexOf('hsl') !== -1) {\n values[1] = \"\".concat(values[1], \"%\");\n values[2] = \"\".concat(values[2], \"%\");\n }\n\n return \"\".concat(type, \"(\").concat(values.join(', '), \")\");\n}\n/**\n * Calculates the contrast ratio between two colors.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n *\n * @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {number} A contrast ratio value in the range 0 - 21.\n */\n\nexport function getContrastRatio(foreground, background) {\n var lumA = getLuminance(foreground);\n var lumB = getLuminance(background);\n return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);\n}\n/**\n * The relative brightness of any point in a color space,\n * normalized to 0 for darkest black and 1 for lightest white.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {number} The relative brightness of the color in the range 0 - 1\n */\n\nexport function getLuminance(color) {\n color = decomposeColor(color);\n var rgb = color.type === 'hsl' ? decomposeColor(hslToRgb(color)).values : color.values;\n rgb = rgb.map(function (val) {\n val /= 255; // normalized\n\n return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);\n }); // Truncate at 3 digits\n\n return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));\n}\n/**\n * Darken or lighten a color, depending on its luminance.\n * Light colors are darkened, dark colors are lightened.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {number} coefficient=0.15 - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\n\nexport function emphasize(color) {\n var coefficient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.15;\n return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);\n}\n/**\n * Set the absolute transparency of a color.\n * Any existing alpha values are overwritten.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {number} value - value to set the alpha channel to in the range 0 -1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\n\nexport function fade(color, value) {\n color = decomposeColor(color);\n value = clamp(value);\n\n if (color.type === 'rgb' || color.type === 'hsl') {\n color.type += 'a';\n }\n\n color.values[3] = value;\n return recomposeColor(color);\n}\n/**\n * Darkens a color.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\n\nexport function darken(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clamp(coefficient);\n\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] *= 1 - coefficient;\n } else if (color.type.indexOf('rgb') !== -1) {\n for (var i = 0; i < 3; i += 1) {\n color.values[i] *= 1 - coefficient;\n }\n }\n\n return recomposeColor(color);\n}\n/**\n * Lightens a color.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\n\nexport function lighten(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clamp(coefficient);\n\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] += (100 - color.values[2]) * coefficient;\n } else if (color.type.indexOf('rgb') !== -1) {\n for (var i = 0; i < 3; i += 1) {\n color.values[i] += (255 - color.values[i]) * coefficient;\n }\n }\n\n return recomposeColor(color);\n}","/**\n * The main AWS namespace\n */\nvar AWS = {\n util: require('./util')\n};\n/**\n * @api private\n * @!macro [new] nobrowser\n * @note This feature is not supported in the browser environment of the SDK.\n */\n\nvar _hidden = {};\n\n_hidden.toString(); // hack to parse macro\n\n/**\n * @api private\n */\n\n\nmodule.exports = AWS;\nAWS.util.update(AWS, {\n /**\n * @constant\n */\n VERSION: '2.518.0',\n\n /**\n * @api private\n */\n Signers: {},\n\n /**\n * @api private\n */\n Protocol: {\n Json: require('./protocol/json'),\n Query: require('./protocol/query'),\n Rest: require('./protocol/rest'),\n RestJson: require('./protocol/rest_json'),\n RestXml: require('./protocol/rest_xml')\n },\n\n /**\n * @api private\n */\n XML: {\n Builder: require('./xml/builder'),\n Parser: null // conditionally set based on environment\n\n },\n\n /**\n * @api private\n */\n JSON: {\n Builder: require('./json/builder'),\n Parser: require('./json/parser')\n },\n\n /**\n * @api private\n */\n Model: {\n Api: require('./model/api'),\n Operation: require('./model/operation'),\n Shape: require('./model/shape'),\n Paginator: require('./model/paginator'),\n ResourceWaiter: require('./model/resource_waiter')\n },\n\n /**\n * @api private\n */\n apiLoader: require('./api_loader'),\n\n /**\n * @api private\n */\n EndpointCache: require('../vendor/endpoint-cache').EndpointCache\n});\n\nrequire('./sequential_executor');\n\nrequire('./service');\n\nrequire('./config');\n\nrequire('./http');\n\nrequire('./event_listeners');\n\nrequire('./request');\n\nrequire('./response');\n\nrequire('./resource_waiter');\n\nrequire('./signers/request_signer');\n\nrequire('./param_validator');\n/**\n * @readonly\n * @return [AWS.SequentialExecutor] a collection of global event listeners that\n * are attached to every sent request.\n * @see AWS.Request AWS.Request for a list of events to listen for\n * @example Logging the time taken to send a request\n * AWS.events.on('send', function startSend(resp) {\n * resp.startTime = new Date().getTime();\n * }).on('complete', function calculateTime(resp) {\n * var time = (new Date().getTime() - resp.startTime) / 1000;\n * console.log('Request took ' + time + ' seconds');\n * });\n *\n * new AWS.S3().listBuckets(); // prints 'Request took 0.285 seconds'\n */\n\n\nAWS.events = new AWS.SequentialExecutor(); //create endpoint cache lazily\n\nAWS.util.memoizedProperty(AWS, 'endpointCache', function () {\n return new AWS.EndpointCache(AWS.config.endpointCacheSize);\n}, true);","import {createMuiTheme} from '@material-ui/core/styles';\nimport * as Colors from \"@material-ui/core/colors\";\n\nvar theme = createMuiTheme({\n palette: {\n reserved: {\n light: Colors.green[300],\n main: Colors.green[500],\n dark: Colors.green[900],\n },\n not_authorized: {\n light: Colors.orange[300],\n main: Colors.orange[500],\n dark: Colors.orange[900],\n },\n warning: {\n light: Colors.red[300],\n main: Colors.red[500],\n dark: Colors.red[900],\n },\n\n ok: {\n light: Colors.green[300],\n main: Colors.green[500],\n dark: Colors.green[900],\n },\n ng: {\n light: Colors.red[300],\n main: Colors.red[500],\n dark: Colors.red[900],\n },\n in_progress: {\n light: Colors.orange[300],\n main: Colors.orange[500],\n dark: Colors.orange[900],\n },\n\n primary: {\n light: \"#0081a9\",\n main: \"#0081a9\",\n dark: \"#0081a9\",\n contrastText: '#FFFFFF', // テキストの色\n },\n secondary: {\n light: Colors.red[200],\n main: Colors.red[700],\n dark: Colors.red[900],\n contrastText: '#000',\n },\n },\n overrides: {\n MuiTab: {\n 'root': {\n minWidth: \"75px !important\", // override\n },\n }\n }\n});\n\nexport default theme","import * as React from 'react';\nimport setRef from './setRef';\nexport default function useForkRef(refA, refB) {\n /**\n * This will create a new function if the ref props change and are defined.\n * This means react will call the old forkRef with `null` and the new forkRef\n * with the ref. Cleanup naturally emerges from this behavior\n */\n return React.useMemo(function () {\n if (refA == null && refB == null) {\n return null;\n }\n\n return function (refValue) {\n setRef(refA, refValue);\n setRef(refB, refValue);\n };\n }, [refA, refB]);\n}","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function') {\n return;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.min.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is'); // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n\n\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}","\"use strict\";\n/*\n * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar analytics_1 = require(\"@aws-amplify/analytics\");\n\nexports.Analytics = analytics_1[\"default\"];\nexports.AnalyticsClass = analytics_1.AnalyticsClass;\nexports.AWSPinpointProvider = analytics_1.AWSPinpointProvider;\nexports.AWSKinesisProvider = analytics_1.AWSKinesisProvider;\nexports.AmazonPersonalizeProvider = analytics_1.AmazonPersonalizeProvider;\n\nvar auth_1 = require(\"@aws-amplify/auth\");\n\nexports.Auth = auth_1[\"default\"];\nexports.AuthClass = auth_1.AuthClass;\n\nvar storage_1 = require(\"@aws-amplify/storage\");\n\nexports.Storage = storage_1[\"default\"];\nexports.StorageClass = storage_1.StorageClass;\n\nvar api_1 = require(\"@aws-amplify/api\");\n\nexports.API = api_1[\"default\"];\nexports.APIClass = api_1.APIClass;\nexports.graphqlOperation = api_1.graphqlOperation;\n\nvar pubsub_1 = require(\"@aws-amplify/pubsub\");\n\nexports.PubSub = pubsub_1[\"default\"];\nexports.PubSubClass = pubsub_1.PubSubClass;\n\nvar cache_1 = require(\"@aws-amplify/cache\");\n\nexports.Cache = cache_1[\"default\"];\n\nvar interactions_1 = require(\"@aws-amplify/interactions\");\n\nexports.Interactions = interactions_1[\"default\"];\nexports.InteractionsClass = interactions_1.InteractionsClass;\n\nvar UI = require(\"@aws-amplify/ui\");\n\nexports.UI = UI;\n\nvar xr_1 = require(\"@aws-amplify/xr\");\n\nexports.XR = xr_1[\"default\"];\nexports.XRClass = xr_1.XRClass;\n\nvar predictions_1 = require(\"@aws-amplify/predictions\");\n\nexports.Predictions = predictions_1[\"default\"];\n\nvar core_1 = require(\"@aws-amplify/core\");\n\nexports.Logger = core_1.ConsoleLogger;\nexports.Hub = core_1.Hub;\nexports.JS = core_1.JS;\nexports.ClientDevice = core_1.ClientDevice;\nexports.Signer = core_1.Signer;\nexports.I18n = core_1.I18n;\nexports.ServiceWorker = core_1.ServiceWorker;\nexports[\"default\"] = core_1[\"default\"];\ncore_1[\"default\"].Auth = auth_1[\"default\"];\ncore_1[\"default\"].Analytics = analytics_1[\"default\"];\ncore_1[\"default\"].API = api_1[\"default\"];\ncore_1[\"default\"].Storage = storage_1[\"default\"];\ncore_1[\"default\"].I18n = core_1.I18n;\ncore_1[\"default\"].Cache = cache_1[\"default\"];\ncore_1[\"default\"].PubSub = pubsub_1[\"default\"];\ncore_1[\"default\"].Logger = core_1.ConsoleLogger;\ncore_1[\"default\"].ServiceWorker = core_1.ServiceWorker;\ncore_1[\"default\"].Interactions = interactions_1[\"default\"];\ncore_1[\"default\"].UI = UI;\ncore_1[\"default\"].XR = xr_1[\"default\"];\ncore_1[\"default\"].Predictions = predictions_1[\"default\"];","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint guard-for-in:0 */\nvar AWS;\n/**\n * A set of utility methods for use with the AWS SDK.\n *\n * @!attribute abort\n * Return this value from an iterator function {each} or {arrayEach}\n * to break out of the iteration.\n * @example Breaking out of an iterator function\n * AWS.util.each({a: 1, b: 2, c: 3}, function(key, value) {\n * if (key == 'b') return AWS.util.abort;\n * });\n * @see each\n * @see arrayEach\n * @api private\n */\n\nvar util = {\n environment: 'nodejs',\n engine: function engine() {\n if (util.isBrowser() && typeof navigator !== 'undefined') {\n return navigator.userAgent;\n } else {\n var engine = process.platform + '/' + process.version;\n\n if (process.env.AWS_EXECUTION_ENV) {\n engine += ' exec-env/' + process.env.AWS_EXECUTION_ENV;\n }\n\n return engine;\n }\n },\n userAgent: function userAgent() {\n var name = util.environment;\n\n var agent = 'aws-sdk-' + name + '/' + require('./core').VERSION;\n\n if (name === 'nodejs') agent += ' ' + util.engine();\n return agent;\n },\n uriEscape: function uriEscape(string) {\n var output = encodeURIComponent(string);\n output = output.replace(/[^A-Za-z0-9_.~\\-%]+/g, escape); // AWS percent-encodes some extra non-standard characters in a URI\n\n output = output.replace(/[*]/g, function (ch) {\n return '%' + ch.charCodeAt(0).toString(16).toUpperCase();\n });\n return output;\n },\n uriEscapePath: function uriEscapePath(string) {\n var parts = [];\n util.arrayEach(string.split('/'), function (part) {\n parts.push(util.uriEscape(part));\n });\n return parts.join('/');\n },\n urlParse: function urlParse(url) {\n return util.url.parse(url);\n },\n urlFormat: function urlFormat(url) {\n return util.url.format(url);\n },\n queryStringParse: function queryStringParse(qs) {\n return util.querystring.parse(qs);\n },\n queryParamsToString: function queryParamsToString(params) {\n var items = [];\n var escape = util.uriEscape;\n var sortedKeys = Object.keys(params).sort();\n util.arrayEach(sortedKeys, function (name) {\n var value = params[name];\n var ename = escape(name);\n var result = ename + '=';\n\n if (Array.isArray(value)) {\n var vals = [];\n util.arrayEach(value, function (item) {\n vals.push(escape(item));\n });\n result = ename + '=' + vals.sort().join('&' + ename + '=');\n } else if (value !== undefined && value !== null) {\n result = ename + '=' + escape(value);\n }\n\n items.push(result);\n });\n return items.join('&');\n },\n readFileSync: function readFileSync(path) {\n if (util.isBrowser()) return null;\n return require('fs').readFileSync(path, 'utf-8');\n },\n base64: {\n encode: function encode64(string) {\n if (typeof string === 'number') {\n throw util.error(new Error('Cannot base64 encode number ' + string));\n }\n\n if (string === null || typeof string === 'undefined') {\n return string;\n }\n\n var buf = util.buffer.toBuffer(string);\n return buf.toString('base64');\n },\n decode: function decode64(string) {\n if (typeof string === 'number') {\n throw util.error(new Error('Cannot base64 decode number ' + string));\n }\n\n if (string === null || typeof string === 'undefined') {\n return string;\n }\n\n return util.buffer.toBuffer(string, 'base64');\n }\n },\n buffer: {\n /**\n * Buffer constructor for Node buffer and buffer pollyfill\n */\n toBuffer: function toBuffer(data, encoding) {\n return typeof util.Buffer.from === 'function' && util.Buffer.from !== Uint8Array.from ? util.Buffer.from(data, encoding) : new util.Buffer(data, encoding);\n },\n alloc: function alloc(size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new Error('size passed to alloc must be a number.');\n }\n\n if (typeof util.Buffer.alloc === 'function') {\n return util.Buffer.alloc(size, fill, encoding);\n } else {\n var buf = new util.Buffer(size);\n\n if (fill !== undefined && typeof buf.fill === 'function') {\n buf.fill(fill, undefined, undefined, encoding);\n }\n\n return buf;\n }\n },\n toStream: function toStream(buffer) {\n if (!util.Buffer.isBuffer(buffer)) buffer = util.buffer.toBuffer(buffer);\n var readable = new util.stream.Readable();\n var pos = 0;\n\n readable._read = function (size) {\n if (pos >= buffer.length) return readable.push(null);\n var end = pos + size;\n if (end > buffer.length) end = buffer.length;\n readable.push(buffer.slice(pos, end));\n pos = end;\n };\n\n return readable;\n },\n\n /**\n * Concatenates a list of Buffer objects.\n */\n concat: function concat(buffers) {\n var length = 0,\n offset = 0,\n buffer = null,\n i;\n\n for (i = 0; i < buffers.length; i++) {\n length += buffers[i].length;\n }\n\n buffer = util.buffer.alloc(length);\n\n for (i = 0; i < buffers.length; i++) {\n buffers[i].copy(buffer, offset);\n offset += buffers[i].length;\n }\n\n return buffer;\n }\n },\n string: {\n byteLength: function byteLength(string) {\n if (string === null || string === undefined) return 0;\n if (typeof string === 'string') string = util.buffer.toBuffer(string);\n\n if (typeof string.byteLength === 'number') {\n return string.byteLength;\n } else if (typeof string.length === 'number') {\n return string.length;\n } else if (typeof string.size === 'number') {\n return string.size;\n } else if (typeof string.path === 'string') {\n return require('fs').lstatSync(string.path).size;\n } else {\n throw util.error(new Error('Cannot determine length of ' + string), {\n object: string\n });\n }\n },\n upperFirst: function upperFirst(string) {\n return string[0].toUpperCase() + string.substr(1);\n },\n lowerFirst: function lowerFirst(string) {\n return string[0].toLowerCase() + string.substr(1);\n }\n },\n ini: {\n parse: function string(ini) {\n var currentSection,\n map = {};\n util.arrayEach(ini.split(/\\r?\\n/), function (line) {\n line = line.split(/(^|\\s)[;#]/)[0]; // remove comments\n\n var section = line.match(/^\\s*\\[([^\\[\\]]+)\\]\\s*$/);\n\n if (section) {\n currentSection = section[1];\n } else if (currentSection) {\n var item = line.match(/^\\s*(.+?)\\s*=\\s*(.+?)\\s*$/);\n\n if (item) {\n map[currentSection] = map[currentSection] || {};\n map[currentSection][item[1]] = item[2];\n }\n }\n });\n return map;\n }\n },\n fn: {\n noop: function noop() {},\n callback: function callback(err) {\n if (err) throw err;\n },\n\n /**\n * Turn a synchronous function into as \"async\" function by making it call\n * a callback. The underlying function is called with all but the last argument,\n * which is treated as the callback. The callback is passed passed a first argument\n * of null on success to mimick standard node callbacks.\n */\n makeAsync: function makeAsync(fn, expectedArgs) {\n if (expectedArgs && expectedArgs <= fn.length) {\n return fn;\n }\n\n return function () {\n var args = Array.prototype.slice.call(arguments, 0);\n var callback = args.pop();\n var result = fn.apply(null, args);\n callback(result);\n };\n }\n },\n\n /**\n * Date and time utility functions.\n */\n date: {\n /**\n * @return [Date] the current JavaScript date object. Since all\n * AWS services rely on this date object, you can override\n * this function to provide a special time value to AWS service\n * requests.\n */\n getDate: function getDate() {\n if (!AWS) AWS = require('./core');\n\n if (AWS.config.systemClockOffset) {\n // use offset when non-zero\n return new Date(new Date().getTime() + AWS.config.systemClockOffset);\n } else {\n return new Date();\n }\n },\n\n /**\n * @return [String] the date in ISO-8601 format\n */\n iso8601: function iso8601(date) {\n if (date === undefined) {\n date = util.date.getDate();\n }\n\n return date.toISOString().replace(/\\.\\d{3}Z$/, 'Z');\n },\n\n /**\n * @return [String] the date in RFC 822 format\n */\n rfc822: function rfc822(date) {\n if (date === undefined) {\n date = util.date.getDate();\n }\n\n return date.toUTCString();\n },\n\n /**\n * @return [Integer] the UNIX timestamp value for the current time\n */\n unixTimestamp: function unixTimestamp(date) {\n if (date === undefined) {\n date = util.date.getDate();\n }\n\n return date.getTime() / 1000;\n },\n\n /**\n * @param [String,number,Date] date\n * @return [Date]\n */\n from: function format(date) {\n if (typeof date === 'number') {\n return new Date(date * 1000); // unix timestamp\n } else {\n return new Date(date);\n }\n },\n\n /**\n * Given a Date or date-like value, this function formats the\n * date into a string of the requested value.\n * @param [String,number,Date] date\n * @param [String] formatter Valid formats are:\n # * 'iso8601'\n # * 'rfc822'\n # * 'unixTimestamp'\n * @return [String]\n */\n format: function format(date, formatter) {\n if (!formatter) formatter = 'iso8601';\n return util.date[formatter](util.date.from(date));\n },\n parseTimestamp: function parseTimestamp(value) {\n if (typeof value === 'number') {\n // unix timestamp (number)\n return new Date(value * 1000);\n } else if (value.match(/^\\d+$/)) {\n // unix timestamp\n return new Date(value * 1000);\n } else if (value.match(/^\\d{4}/)) {\n // iso8601\n return new Date(value);\n } else if (value.match(/^\\w{3},/)) {\n // rfc822\n return new Date(value);\n } else {\n throw util.error(new Error('unhandled timestamp format: ' + value), {\n code: 'TimestampParserError'\n });\n }\n }\n },\n crypto: {\n crc32Table: [0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D],\n crc32: function crc32(data) {\n var tbl = util.crypto.crc32Table;\n var crc = 0 ^ -1;\n\n if (typeof data === 'string') {\n data = util.buffer.toBuffer(data);\n }\n\n for (var i = 0; i < data.length; i++) {\n var code = data.readUInt8(i);\n crc = crc >>> 8 ^ tbl[(crc ^ code) & 0xFF];\n }\n\n return (crc ^ -1) >>> 0;\n },\n hmac: function hmac(key, string, digest, fn) {\n if (!digest) digest = 'binary';\n\n if (digest === 'buffer') {\n digest = undefined;\n }\n\n if (!fn) fn = 'sha256';\n if (typeof string === 'string') string = util.buffer.toBuffer(string);\n return util.crypto.lib.createHmac(fn, key).update(string).digest(digest);\n },\n md5: function md5(data, digest, callback) {\n return util.crypto.hash('md5', data, digest, callback);\n },\n sha256: function sha256(data, digest, callback) {\n return util.crypto.hash('sha256', data, digest, callback);\n },\n hash: function hash(algorithm, data, digest, callback) {\n var hash = util.crypto.createHash(algorithm);\n\n if (!digest) {\n digest = 'binary';\n }\n\n if (digest === 'buffer') {\n digest = undefined;\n }\n\n if (typeof data === 'string') data = util.buffer.toBuffer(data);\n var sliceFn = util.arraySliceFn(data);\n var isBuffer = util.Buffer.isBuffer(data); //Identifying objects with an ArrayBuffer as buffers\n\n if (util.isBrowser() && typeof ArrayBuffer !== 'undefined' && data && data.buffer instanceof ArrayBuffer) isBuffer = true;\n\n if (callback && _typeof(data) === 'object' && typeof data.on === 'function' && !isBuffer) {\n data.on('data', function (chunk) {\n hash.update(chunk);\n });\n data.on('error', function (err) {\n callback(err);\n });\n data.on('end', function () {\n callback(null, hash.digest(digest));\n });\n } else if (callback && sliceFn && !isBuffer && typeof FileReader !== 'undefined') {\n // this might be a File/Blob\n var index = 0,\n size = 1024 * 512;\n var reader = new FileReader();\n\n reader.onerror = function () {\n callback(new Error('Failed to read data.'));\n };\n\n reader.onload = function () {\n var buf = new util.Buffer(new Uint8Array(reader.result));\n hash.update(buf);\n index += buf.length;\n\n reader._continueReading();\n };\n\n reader._continueReading = function () {\n if (index >= data.size) {\n callback(null, hash.digest(digest));\n return;\n }\n\n var back = index + size;\n if (back > data.size) back = data.size;\n reader.readAsArrayBuffer(sliceFn.call(data, index, back));\n };\n\n reader._continueReading();\n } else {\n if (util.isBrowser() && _typeof(data) === 'object' && !isBuffer) {\n data = new util.Buffer(new Uint8Array(data));\n }\n\n var out = hash.update(data).digest(digest);\n if (callback) callback(null, out);\n return out;\n }\n },\n toHex: function toHex(data) {\n var out = [];\n\n for (var i = 0; i < data.length; i++) {\n out.push(('0' + data.charCodeAt(i).toString(16)).substr(-2, 2));\n }\n\n return out.join('');\n },\n createHash: function createHash(algorithm) {\n return util.crypto.lib.createHash(algorithm);\n }\n },\n\n /** @!ignore */\n\n /* Abort constant */\n abort: {},\n each: function each(object, iterFunction) {\n for (var key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n var ret = iterFunction.call(this, key, object[key]);\n if (ret === util.abort) break;\n }\n }\n },\n arrayEach: function arrayEach(array, iterFunction) {\n for (var idx in array) {\n if (Object.prototype.hasOwnProperty.call(array, idx)) {\n var ret = iterFunction.call(this, array[idx], parseInt(idx, 10));\n if (ret === util.abort) break;\n }\n }\n },\n update: function update(obj1, obj2) {\n util.each(obj2, function iterator(key, item) {\n obj1[key] = item;\n });\n return obj1;\n },\n merge: function merge(obj1, obj2) {\n return util.update(util.copy(obj1), obj2);\n },\n copy: function copy(object) {\n if (object === null || object === undefined) return object;\n var dupe = {}; // jshint forin:false\n\n for (var key in object) {\n dupe[key] = object[key];\n }\n\n return dupe;\n },\n isEmpty: function isEmpty(obj) {\n for (var prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n return false;\n }\n }\n\n return true;\n },\n arraySliceFn: function arraySliceFn(obj) {\n var fn = obj.slice || obj.webkitSlice || obj.mozSlice;\n return typeof fn === 'function' ? fn : null;\n },\n isType: function isType(obj, type) {\n // handle cross-\"frame\" objects\n if (typeof type === 'function') type = util.typeName(type);\n return Object.prototype.toString.call(obj) === '[object ' + type + ']';\n },\n typeName: function typeName(type) {\n if (Object.prototype.hasOwnProperty.call(type, 'name')) return type.name;\n var str = type.toString();\n var match = str.match(/^\\s*function (.+)\\(/);\n return match ? match[1] : str;\n },\n error: function error(err, options) {\n var originalError = null;\n\n if (typeof err.message === 'string' && err.message !== '') {\n if (typeof options === 'string' || options && options.message) {\n originalError = util.copy(err);\n originalError.message = err.message;\n }\n }\n\n err.message = err.message || null;\n\n if (typeof options === 'string') {\n err.message = options;\n } else if (_typeof(options) === 'object' && options !== null) {\n util.update(err, options);\n if (options.message) err.message = options.message;\n if (options.code || options.name) err.code = options.code || options.name;\n if (options.stack) err.stack = options.stack;\n }\n\n if (typeof Object.defineProperty === 'function') {\n Object.defineProperty(err, 'name', {\n writable: true,\n enumerable: false\n });\n Object.defineProperty(err, 'message', {\n enumerable: true\n });\n }\n\n err.name = options && options.name || err.name || err.code || 'Error';\n err.time = new Date();\n if (originalError) err.originalError = originalError;\n return err;\n },\n\n /**\n * @api private\n */\n inherit: function inherit(klass, features) {\n var newObject = null;\n\n if (features === undefined) {\n features = klass;\n klass = Object;\n newObject = {};\n } else {\n var ctor = function ConstructorWrapper() {};\n\n ctor.prototype = klass.prototype;\n newObject = new ctor();\n } // constructor not supplied, create pass-through ctor\n\n\n if (features.constructor === Object) {\n features.constructor = function () {\n if (klass !== Object) {\n return klass.apply(this, arguments);\n }\n };\n }\n\n features.constructor.prototype = newObject;\n util.update(features.constructor.prototype, features);\n features.constructor.__super__ = klass;\n return features.constructor;\n },\n\n /**\n * @api private\n */\n mixin: function mixin() {\n var klass = arguments[0];\n\n for (var i = 1; i < arguments.length; i++) {\n // jshint forin:false\n for (var prop in arguments[i].prototype) {\n var fn = arguments[i].prototype[prop];\n\n if (prop !== 'constructor') {\n klass.prototype[prop] = fn;\n }\n }\n }\n\n return klass;\n },\n\n /**\n * @api private\n */\n hideProperties: function hideProperties(obj, props) {\n if (typeof Object.defineProperty !== 'function') return;\n util.arrayEach(props, function (key) {\n Object.defineProperty(obj, key, {\n enumerable: false,\n writable: true,\n configurable: true\n });\n });\n },\n\n /**\n * @api private\n */\n property: function property(obj, name, value, enumerable, isValue) {\n var opts = {\n configurable: true,\n enumerable: enumerable !== undefined ? enumerable : true\n };\n\n if (typeof value === 'function' && !isValue) {\n opts.get = value;\n } else {\n opts.value = value;\n opts.writable = true;\n }\n\n Object.defineProperty(obj, name, opts);\n },\n\n /**\n * @api private\n */\n memoizedProperty: function memoizedProperty(obj, name, get, enumerable) {\n var cachedValue = null; // build enumerable attribute for each value with lazy accessor.\n\n util.property(obj, name, function () {\n if (cachedValue === null) {\n cachedValue = get();\n }\n\n return cachedValue;\n }, enumerable);\n },\n\n /**\n * TODO Remove in major version revision\n * This backfill populates response data without the\n * top-level payload name.\n *\n * @api private\n */\n hoistPayloadMember: function hoistPayloadMember(resp) {\n var req = resp.request;\n var operationName = req.operation;\n var operation = req.service.api.operations[operationName];\n var output = operation.output;\n\n if (output.payload && !operation.hasEventOutput) {\n var payloadMember = output.members[output.payload];\n var responsePayload = resp.data[output.payload];\n\n if (payloadMember.type === 'structure') {\n util.each(responsePayload, function (key, value) {\n util.property(resp.data, key, value, false);\n });\n }\n }\n },\n\n /**\n * Compute SHA-256 checksums of streams\n *\n * @api private\n */\n computeSha256: function computeSha256(body, done) {\n if (util.isNode()) {\n var Stream = util.stream.Stream;\n\n var fs = require('fs');\n\n if (typeof Stream === 'function' && body instanceof Stream) {\n if (typeof body.path === 'string') {\n // assume file object\n var settings = {};\n\n if (typeof body.start === 'number') {\n settings.start = body.start;\n }\n\n if (typeof body.end === 'number') {\n settings.end = body.end;\n }\n\n body = fs.createReadStream(body.path, settings);\n } else {\n // TODO support other stream types\n return done(new Error('Non-file stream objects are ' + 'not supported with SigV4'));\n }\n }\n }\n\n util.crypto.sha256(body, 'hex', function (err, sha) {\n if (err) done(err);else done(null, sha);\n });\n },\n\n /**\n * @api private\n */\n isClockSkewed: function isClockSkewed(serverTime) {\n if (serverTime) {\n util.property(AWS.config, 'isClockSkewed', Math.abs(new Date().getTime() - serverTime) >= 300000, false);\n return AWS.config.isClockSkewed;\n }\n },\n applyClockOffset: function applyClockOffset(serverTime) {\n if (serverTime) AWS.config.systemClockOffset = serverTime - new Date().getTime();\n },\n\n /**\n * @api private\n */\n extractRequestId: function extractRequestId(resp) {\n var requestId = resp.httpResponse.headers['x-amz-request-id'] || resp.httpResponse.headers['x-amzn-requestid'];\n\n if (!requestId && resp.data && resp.data.ResponseMetadata) {\n requestId = resp.data.ResponseMetadata.RequestId;\n }\n\n if (requestId) {\n resp.requestId = requestId;\n }\n\n if (resp.error) {\n resp.error.requestId = requestId;\n }\n },\n\n /**\n * @api private\n */\n addPromises: function addPromises(constructors, PromiseDependency) {\n var deletePromises = false;\n\n if (PromiseDependency === undefined && AWS && AWS.config) {\n PromiseDependency = AWS.config.getPromisesDependency();\n }\n\n if (PromiseDependency === undefined && typeof Promise !== 'undefined') {\n PromiseDependency = Promise;\n }\n\n if (typeof PromiseDependency !== 'function') deletePromises = true;\n if (!Array.isArray(constructors)) constructors = [constructors];\n\n for (var ind = 0; ind < constructors.length; ind++) {\n var constructor = constructors[ind];\n\n if (deletePromises) {\n if (constructor.deletePromisesFromClass) {\n constructor.deletePromisesFromClass();\n }\n } else if (constructor.addPromisesToClass) {\n constructor.addPromisesToClass(PromiseDependency);\n }\n }\n },\n\n /**\n * @api private\n */\n promisifyMethod: function promisifyMethod(methodName, PromiseDependency) {\n return function promise() {\n var self = this;\n return new PromiseDependency(function (resolve, reject) {\n self[methodName](function (err, data) {\n if (err) {\n reject(err);\n } else {\n resolve(data);\n }\n });\n });\n };\n },\n\n /**\n * @api private\n */\n isDualstackAvailable: function isDualstackAvailable(service) {\n if (!service) return false;\n\n var metadata = require('../apis/metadata.json');\n\n if (typeof service !== 'string') service = service.serviceIdentifier;\n if (typeof service !== 'string' || !metadata.hasOwnProperty(service)) return false;\n return !!metadata[service].dualstackAvailable;\n },\n\n /**\n * @api private\n */\n calculateRetryDelay: function calculateRetryDelay(retryCount, retryDelayOptions) {\n if (!retryDelayOptions) retryDelayOptions = {};\n var customBackoff = retryDelayOptions.customBackoff || null;\n\n if (typeof customBackoff === 'function') {\n return customBackoff(retryCount);\n }\n\n var base = typeof retryDelayOptions.base === 'number' ? retryDelayOptions.base : 100;\n var delay = Math.random() * (Math.pow(2, retryCount) * base);\n return delay;\n },\n\n /**\n * @api private\n */\n handleRequestWithRetries: function handleRequestWithRetries(httpRequest, options, cb) {\n if (!options) options = {};\n var http = AWS.HttpClient.getInstance();\n var httpOptions = options.httpOptions || {};\n var retryCount = 0;\n\n var errCallback = function errCallback(err) {\n var maxRetries = options.maxRetries || 0;\n if (err && err.code === 'TimeoutError') err.retryable = true;\n\n if (err && err.retryable && retryCount < maxRetries) {\n retryCount++;\n var delay = util.calculateRetryDelay(retryCount, options.retryDelayOptions);\n setTimeout(sendRequest, delay + (err.retryAfter || 0));\n } else {\n cb(err);\n }\n };\n\n var sendRequest = function sendRequest() {\n var data = '';\n http.handleRequest(httpRequest, httpOptions, function (httpResponse) {\n httpResponse.on('data', function (chunk) {\n data += chunk.toString();\n });\n httpResponse.on('end', function () {\n var statusCode = httpResponse.statusCode;\n\n if (statusCode < 300) {\n cb(null, data);\n } else {\n var retryAfter = parseInt(httpResponse.headers['retry-after'], 10) * 1000 || 0;\n var err = util.error(new Error(), {\n retryable: statusCode >= 500 || statusCode === 429\n });\n if (retryAfter && err.retryable) err.retryAfter = retryAfter;\n errCallback(err);\n }\n });\n }, errCallback);\n };\n\n AWS.util.defer(sendRequest);\n },\n\n /**\n * @api private\n */\n uuid: {\n v4: function uuidV4() {\n return require('uuid').v4();\n }\n },\n\n /**\n * @api private\n */\n convertPayloadToString: function convertPayloadToString(resp) {\n var req = resp.request;\n var operation = req.operation;\n var rules = req.service.api.operations[operation].output || {};\n\n if (rules.payload && resp.data[rules.payload]) {\n resp.data[rules.payload] = resp.data[rules.payload].toString();\n }\n },\n\n /**\n * @api private\n */\n defer: function defer(callback) {\n if ((typeof process === \"undefined\" ? \"undefined\" : _typeof(process)) === 'object' && typeof process.nextTick === 'function') {\n process.nextTick(callback);\n } else if (typeof setImmediate === 'function') {\n setImmediate(callback);\n } else {\n setTimeout(callback, 0);\n }\n },\n\n /**\n * @api private\n */\n getRequestPayloadShape: function getRequestPayloadShape(req) {\n var operations = req.service.api.operations;\n if (!operations) return undefined;\n var operation = (operations || {})[req.operation];\n if (!operation || !operation.input || !operation.input.payload) return undefined;\n return operation.input.members[operation.input.payload];\n },\n getProfilesFromSharedConfig: function getProfilesFromSharedConfig(iniLoader, filename) {\n var profiles = {};\n var profilesFromConfig = {};\n\n if (process.env[util.configOptInEnv]) {\n var profilesFromConfig = iniLoader.loadFrom({\n isConfig: true,\n filename: process.env[util.sharedConfigFileEnv]\n });\n }\n\n var profilesFromCreds = iniLoader.loadFrom({\n filename: filename || process.env[util.configOptInEnv] && process.env[util.sharedCredentialsFileEnv]\n });\n\n for (var i = 0, profileNames = Object.keys(profilesFromConfig); i < profileNames.length; i++) {\n profiles[profileNames[i]] = profilesFromConfig[profileNames[i]];\n }\n\n for (var i = 0, profileNames = Object.keys(profilesFromCreds); i < profileNames.length; i++) {\n profiles[profileNames[i]] = profilesFromCreds[profileNames[i]];\n }\n\n return profiles;\n },\n\n /**\n * @api private\n */\n defaultProfile: 'default',\n\n /**\n * @api private\n */\n configOptInEnv: 'AWS_SDK_LOAD_CONFIG',\n\n /**\n * @api private\n */\n sharedCredentialsFileEnv: 'AWS_SHARED_CREDENTIALS_FILE',\n\n /**\n * @api private\n */\n sharedConfigFileEnv: 'AWS_CONFIG_FILE',\n\n /**\n * @api private\n */\n imdsDisabledEnv: 'AWS_EC2_METADATA_DISABLED'\n};\n/**\n * @api private\n */\n\nmodule.exports = util;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint guard-for-in:0 */\nvar AWS;\n/**\n * A set of utility methods for use with the AWS SDK.\n *\n * @!attribute abort\n * Return this value from an iterator function {each} or {arrayEach}\n * to break out of the iteration.\n * @example Breaking out of an iterator function\n * AWS.util.each({a: 1, b: 2, c: 3}, function(key, value) {\n * if (key == 'b') return AWS.util.abort;\n * });\n * @see each\n * @see arrayEach\n * @api private\n */\n\nvar util = {\n environment: 'nodejs',\n engine: function engine() {\n if (util.isBrowser() && typeof navigator !== 'undefined') {\n return navigator.userAgent;\n } else {\n var engine = process.platform + '/' + process.version;\n\n if (process.env.AWS_EXECUTION_ENV) {\n engine += ' exec-env/' + process.env.AWS_EXECUTION_ENV;\n }\n\n return engine;\n }\n },\n userAgent: function userAgent() {\n var name = util.environment;\n\n var agent = 'aws-sdk-' + name + '/' + require('./core').VERSION;\n\n if (name === 'nodejs') agent += ' ' + util.engine();\n return agent;\n },\n uriEscape: function uriEscape(string) {\n var output = encodeURIComponent(string);\n output = output.replace(/[^A-Za-z0-9_.~\\-%]+/g, escape); // AWS percent-encodes some extra non-standard characters in a URI\n\n output = output.replace(/[*]/g, function (ch) {\n return '%' + ch.charCodeAt(0).toString(16).toUpperCase();\n });\n return output;\n },\n uriEscapePath: function uriEscapePath(string) {\n var parts = [];\n util.arrayEach(string.split('/'), function (part) {\n parts.push(util.uriEscape(part));\n });\n return parts.join('/');\n },\n urlParse: function urlParse(url) {\n return util.url.parse(url);\n },\n urlFormat: function urlFormat(url) {\n return util.url.format(url);\n },\n queryStringParse: function queryStringParse(qs) {\n return util.querystring.parse(qs);\n },\n queryParamsToString: function queryParamsToString(params) {\n var items = [];\n var escape = util.uriEscape;\n var sortedKeys = Object.keys(params).sort();\n util.arrayEach(sortedKeys, function (name) {\n var value = params[name];\n var ename = escape(name);\n var result = ename + '=';\n\n if (Array.isArray(value)) {\n var vals = [];\n util.arrayEach(value, function (item) {\n vals.push(escape(item));\n });\n result = ename + '=' + vals.sort().join('&' + ename + '=');\n } else if (value !== undefined && value !== null) {\n result = ename + '=' + escape(value);\n }\n\n items.push(result);\n });\n return items.join('&');\n },\n readFileSync: function readFileSync(path) {\n if (util.isBrowser()) return null;\n return require('fs').readFileSync(path, 'utf-8');\n },\n base64: {\n encode: function encode64(string) {\n if (typeof string === 'number') {\n throw util.error(new Error('Cannot base64 encode number ' + string));\n }\n\n if (string === null || typeof string === 'undefined') {\n return string;\n }\n\n var buf = util.buffer.toBuffer(string);\n return buf.toString('base64');\n },\n decode: function decode64(string) {\n if (typeof string === 'number') {\n throw util.error(new Error('Cannot base64 decode number ' + string));\n }\n\n if (string === null || typeof string === 'undefined') {\n return string;\n }\n\n return util.buffer.toBuffer(string, 'base64');\n }\n },\n buffer: {\n /**\n * Buffer constructor for Node buffer and buffer pollyfill\n */\n toBuffer: function toBuffer(data, encoding) {\n return typeof util.Buffer.from === 'function' && util.Buffer.from !== Uint8Array.from ? util.Buffer.from(data, encoding) : new util.Buffer(data, encoding);\n },\n alloc: function alloc(size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new Error('size passed to alloc must be a number.');\n }\n\n if (typeof util.Buffer.alloc === 'function') {\n return util.Buffer.alloc(size, fill, encoding);\n } else {\n var buf = new util.Buffer(size);\n\n if (fill !== undefined && typeof buf.fill === 'function') {\n buf.fill(fill, undefined, undefined, encoding);\n }\n\n return buf;\n }\n },\n toStream: function toStream(buffer) {\n if (!util.Buffer.isBuffer(buffer)) buffer = util.buffer.toBuffer(buffer);\n var readable = new util.stream.Readable();\n var pos = 0;\n\n readable._read = function (size) {\n if (pos >= buffer.length) return readable.push(null);\n var end = pos + size;\n if (end > buffer.length) end = buffer.length;\n readable.push(buffer.slice(pos, end));\n pos = end;\n };\n\n return readable;\n },\n\n /**\n * Concatenates a list of Buffer objects.\n */\n concat: function concat(buffers) {\n var length = 0,\n offset = 0,\n buffer = null,\n i;\n\n for (i = 0; i < buffers.length; i++) {\n length += buffers[i].length;\n }\n\n buffer = util.buffer.alloc(length);\n\n for (i = 0; i < buffers.length; i++) {\n buffers[i].copy(buffer, offset);\n offset += buffers[i].length;\n }\n\n return buffer;\n }\n },\n string: {\n byteLength: function byteLength(string) {\n if (string === null || string === undefined) return 0;\n if (typeof string === 'string') string = util.buffer.toBuffer(string);\n\n if (typeof string.byteLength === 'number') {\n return string.byteLength;\n } else if (typeof string.length === 'number') {\n return string.length;\n } else if (typeof string.size === 'number') {\n return string.size;\n } else if (typeof string.path === 'string') {\n return require('fs').lstatSync(string.path).size;\n } else {\n throw util.error(new Error('Cannot determine length of ' + string), {\n object: string\n });\n }\n },\n upperFirst: function upperFirst(string) {\n return string[0].toUpperCase() + string.substr(1);\n },\n lowerFirst: function lowerFirst(string) {\n return string[0].toLowerCase() + string.substr(1);\n }\n },\n ini: {\n parse: function string(ini) {\n var currentSection,\n map = {};\n util.arrayEach(ini.split(/\\r?\\n/), function (line) {\n line = line.split(/(^|\\s)[;#]/)[0]; // remove comments\n\n var section = line.match(/^\\s*\\[([^\\[\\]]+)\\]\\s*$/);\n\n if (section) {\n currentSection = section[1];\n } else if (currentSection) {\n var item = line.match(/^\\s*(.+?)\\s*=\\s*(.+?)\\s*$/);\n\n if (item) {\n map[currentSection] = map[currentSection] || {};\n map[currentSection][item[1]] = item[2];\n }\n }\n });\n return map;\n }\n },\n fn: {\n noop: function noop() {},\n callback: function callback(err) {\n if (err) throw err;\n },\n\n /**\n * Turn a synchronous function into as \"async\" function by making it call\n * a callback. The underlying function is called with all but the last argument,\n * which is treated as the callback. The callback is passed passed a first argument\n * of null on success to mimick standard node callbacks.\n */\n makeAsync: function makeAsync(fn, expectedArgs) {\n if (expectedArgs && expectedArgs <= fn.length) {\n return fn;\n }\n\n return function () {\n var args = Array.prototype.slice.call(arguments, 0);\n var callback = args.pop();\n var result = fn.apply(null, args);\n callback(result);\n };\n }\n },\n\n /**\n * Date and time utility functions.\n */\n date: {\n /**\n * @return [Date] the current JavaScript date object. Since all\n * AWS services rely on this date object, you can override\n * this function to provide a special time value to AWS service\n * requests.\n */\n getDate: function getDate() {\n if (!AWS) AWS = require('./core');\n\n if (AWS.config.systemClockOffset) {\n // use offset when non-zero\n return new Date(new Date().getTime() + AWS.config.systemClockOffset);\n } else {\n return new Date();\n }\n },\n\n /**\n * @return [String] the date in ISO-8601 format\n */\n iso8601: function iso8601(date) {\n if (date === undefined) {\n date = util.date.getDate();\n }\n\n return date.toISOString().replace(/\\.\\d{3}Z$/, 'Z');\n },\n\n /**\n * @return [String] the date in RFC 822 format\n */\n rfc822: function rfc822(date) {\n if (date === undefined) {\n date = util.date.getDate();\n }\n\n return date.toUTCString();\n },\n\n /**\n * @return [Integer] the UNIX timestamp value for the current time\n */\n unixTimestamp: function unixTimestamp(date) {\n if (date === undefined) {\n date = util.date.getDate();\n }\n\n return date.getTime() / 1000;\n },\n\n /**\n * @param [String,number,Date] date\n * @return [Date]\n */\n from: function format(date) {\n if (typeof date === 'number') {\n return new Date(date * 1000); // unix timestamp\n } else {\n return new Date(date);\n }\n },\n\n /**\n * Given a Date or date-like value, this function formats the\n * date into a string of the requested value.\n * @param [String,number,Date] date\n * @param [String] formatter Valid formats are:\n # * 'iso8601'\n # * 'rfc822'\n # * 'unixTimestamp'\n * @return [String]\n */\n format: function format(date, formatter) {\n if (!formatter) formatter = 'iso8601';\n return util.date[formatter](util.date.from(date));\n },\n parseTimestamp: function parseTimestamp(value) {\n if (typeof value === 'number') {\n // unix timestamp (number)\n return new Date(value * 1000);\n } else if (value.match(/^\\d+$/)) {\n // unix timestamp\n return new Date(value * 1000);\n } else if (value.match(/^\\d{4}/)) {\n // iso8601\n return new Date(value);\n } else if (value.match(/^\\w{3},/)) {\n // rfc822\n return new Date(value);\n } else {\n throw util.error(new Error('unhandled timestamp format: ' + value), {\n code: 'TimestampParserError'\n });\n }\n }\n },\n crypto: {\n crc32Table: [0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D],\n crc32: function crc32(data) {\n var tbl = util.crypto.crc32Table;\n var crc = 0 ^ -1;\n\n if (typeof data === 'string') {\n data = util.buffer.toBuffer(data);\n }\n\n for (var i = 0; i < data.length; i++) {\n var code = data.readUInt8(i);\n crc = crc >>> 8 ^ tbl[(crc ^ code) & 0xFF];\n }\n\n return (crc ^ -1) >>> 0;\n },\n hmac: function hmac(key, string, digest, fn) {\n if (!digest) digest = 'binary';\n\n if (digest === 'buffer') {\n digest = undefined;\n }\n\n if (!fn) fn = 'sha256';\n if (typeof string === 'string') string = util.buffer.toBuffer(string);\n return util.crypto.lib.createHmac(fn, key).update(string).digest(digest);\n },\n md5: function md5(data, digest, callback) {\n return util.crypto.hash('md5', data, digest, callback);\n },\n sha256: function sha256(data, digest, callback) {\n return util.crypto.hash('sha256', data, digest, callback);\n },\n hash: function hash(algorithm, data, digest, callback) {\n var hash = util.crypto.createHash(algorithm);\n\n if (!digest) {\n digest = 'binary';\n }\n\n if (digest === 'buffer') {\n digest = undefined;\n }\n\n if (typeof data === 'string') data = util.buffer.toBuffer(data);\n var sliceFn = util.arraySliceFn(data);\n var isBuffer = util.Buffer.isBuffer(data); //Identifying objects with an ArrayBuffer as buffers\n\n if (util.isBrowser() && typeof ArrayBuffer !== 'undefined' && data && data.buffer instanceof ArrayBuffer) isBuffer = true;\n\n if (callback && _typeof(data) === 'object' && typeof data.on === 'function' && !isBuffer) {\n data.on('data', function (chunk) {\n hash.update(chunk);\n });\n data.on('error', function (err) {\n callback(err);\n });\n data.on('end', function () {\n callback(null, hash.digest(digest));\n });\n } else if (callback && sliceFn && !isBuffer && typeof FileReader !== 'undefined') {\n // this might be a File/Blob\n var index = 0,\n size = 1024 * 512;\n var reader = new FileReader();\n\n reader.onerror = function () {\n callback(new Error('Failed to read data.'));\n };\n\n reader.onload = function () {\n var buf = new util.Buffer(new Uint8Array(reader.result));\n hash.update(buf);\n index += buf.length;\n\n reader._continueReading();\n };\n\n reader._continueReading = function () {\n if (index >= data.size) {\n callback(null, hash.digest(digest));\n return;\n }\n\n var back = index + size;\n if (back > data.size) back = data.size;\n reader.readAsArrayBuffer(sliceFn.call(data, index, back));\n };\n\n reader._continueReading();\n } else {\n if (util.isBrowser() && _typeof(data) === 'object' && !isBuffer) {\n data = new util.Buffer(new Uint8Array(data));\n }\n\n var out = hash.update(data).digest(digest);\n if (callback) callback(null, out);\n return out;\n }\n },\n toHex: function toHex(data) {\n var out = [];\n\n for (var i = 0; i < data.length; i++) {\n out.push(('0' + data.charCodeAt(i).toString(16)).substr(-2, 2));\n }\n\n return out.join('');\n },\n createHash: function createHash(algorithm) {\n return util.crypto.lib.createHash(algorithm);\n }\n },\n\n /** @!ignore */\n\n /* Abort constant */\n abort: {},\n each: function each(object, iterFunction) {\n for (var key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n var ret = iterFunction.call(this, key, object[key]);\n if (ret === util.abort) break;\n }\n }\n },\n arrayEach: function arrayEach(array, iterFunction) {\n for (var idx in array) {\n if (Object.prototype.hasOwnProperty.call(array, idx)) {\n var ret = iterFunction.call(this, array[idx], parseInt(idx, 10));\n if (ret === util.abort) break;\n }\n }\n },\n update: function update(obj1, obj2) {\n util.each(obj2, function iterator(key, item) {\n obj1[key] = item;\n });\n return obj1;\n },\n merge: function merge(obj1, obj2) {\n return util.update(util.copy(obj1), obj2);\n },\n copy: function copy(object) {\n if (object === null || object === undefined) return object;\n var dupe = {}; // jshint forin:false\n\n for (var key in object) {\n dupe[key] = object[key];\n }\n\n return dupe;\n },\n isEmpty: function isEmpty(obj) {\n for (var prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n return false;\n }\n }\n\n return true;\n },\n arraySliceFn: function arraySliceFn(obj) {\n var fn = obj.slice || obj.webkitSlice || obj.mozSlice;\n return typeof fn === 'function' ? fn : null;\n },\n isType: function isType(obj, type) {\n // handle cross-\"frame\" objects\n if (typeof type === 'function') type = util.typeName(type);\n return Object.prototype.toString.call(obj) === '[object ' + type + ']';\n },\n typeName: function typeName(type) {\n if (Object.prototype.hasOwnProperty.call(type, 'name')) return type.name;\n var str = type.toString();\n var match = str.match(/^\\s*function (.+)\\(/);\n return match ? match[1] : str;\n },\n error: function error(err, options) {\n var originalError = null;\n\n if (typeof err.message === 'string' && err.message !== '') {\n if (typeof options === 'string' || options && options.message) {\n originalError = util.copy(err);\n originalError.message = err.message;\n }\n }\n\n err.message = err.message || null;\n\n if (typeof options === 'string') {\n err.message = options;\n } else if (_typeof(options) === 'object' && options !== null) {\n util.update(err, options);\n if (options.message) err.message = options.message;\n if (options.code || options.name) err.code = options.code || options.name;\n if (options.stack) err.stack = options.stack;\n }\n\n if (typeof Object.defineProperty === 'function') {\n Object.defineProperty(err, 'name', {\n writable: true,\n enumerable: false\n });\n Object.defineProperty(err, 'message', {\n enumerable: true\n });\n }\n\n err.name = options && options.name || err.name || err.code || 'Error';\n err.time = new Date();\n if (originalError) err.originalError = originalError;\n return err;\n },\n\n /**\n * @api private\n */\n inherit: function inherit(klass, features) {\n var newObject = null;\n\n if (features === undefined) {\n features = klass;\n klass = Object;\n newObject = {};\n } else {\n var ctor = function ConstructorWrapper() {};\n\n ctor.prototype = klass.prototype;\n newObject = new ctor();\n } // constructor not supplied, create pass-through ctor\n\n\n if (features.constructor === Object) {\n features.constructor = function () {\n if (klass !== Object) {\n return klass.apply(this, arguments);\n }\n };\n }\n\n features.constructor.prototype = newObject;\n util.update(features.constructor.prototype, features);\n features.constructor.__super__ = klass;\n return features.constructor;\n },\n\n /**\n * @api private\n */\n mixin: function mixin() {\n var klass = arguments[0];\n\n for (var i = 1; i < arguments.length; i++) {\n // jshint forin:false\n for (var prop in arguments[i].prototype) {\n var fn = arguments[i].prototype[prop];\n\n if (prop !== 'constructor') {\n klass.prototype[prop] = fn;\n }\n }\n }\n\n return klass;\n },\n\n /**\n * @api private\n */\n hideProperties: function hideProperties(obj, props) {\n if (typeof Object.defineProperty !== 'function') return;\n util.arrayEach(props, function (key) {\n Object.defineProperty(obj, key, {\n enumerable: false,\n writable: true,\n configurable: true\n });\n });\n },\n\n /**\n * @api private\n */\n property: function property(obj, name, value, enumerable, isValue) {\n var opts = {\n configurable: true,\n enumerable: enumerable !== undefined ? enumerable : true\n };\n\n if (typeof value === 'function' && !isValue) {\n opts.get = value;\n } else {\n opts.value = value;\n opts.writable = true;\n }\n\n Object.defineProperty(obj, name, opts);\n },\n\n /**\n * @api private\n */\n memoizedProperty: function memoizedProperty(obj, name, get, enumerable) {\n var cachedValue = null; // build enumerable attribute for each value with lazy accessor.\n\n util.property(obj, name, function () {\n if (cachedValue === null) {\n cachedValue = get();\n }\n\n return cachedValue;\n }, enumerable);\n },\n\n /**\n * TODO Remove in major version revision\n * This backfill populates response data without the\n * top-level payload name.\n *\n * @api private\n */\n hoistPayloadMember: function hoistPayloadMember(resp) {\n var req = resp.request;\n var operationName = req.operation;\n var operation = req.service.api.operations[operationName];\n var output = operation.output;\n\n if (output.payload && !operation.hasEventOutput) {\n var payloadMember = output.members[output.payload];\n var responsePayload = resp.data[output.payload];\n\n if (payloadMember.type === 'structure') {\n util.each(responsePayload, function (key, value) {\n util.property(resp.data, key, value, false);\n });\n }\n }\n },\n\n /**\n * Compute SHA-256 checksums of streams\n *\n * @api private\n */\n computeSha256: function computeSha256(body, done) {\n if (util.isNode()) {\n var Stream = util.stream.Stream;\n\n var fs = require('fs');\n\n if (typeof Stream === 'function' && body instanceof Stream) {\n if (typeof body.path === 'string') {\n // assume file object\n var settings = {};\n\n if (typeof body.start === 'number') {\n settings.start = body.start;\n }\n\n if (typeof body.end === 'number') {\n settings.end = body.end;\n }\n\n body = fs.createReadStream(body.path, settings);\n } else {\n // TODO support other stream types\n return done(new Error('Non-file stream objects are ' + 'not supported with SigV4'));\n }\n }\n }\n\n util.crypto.sha256(body, 'hex', function (err, sha) {\n if (err) done(err);else done(null, sha);\n });\n },\n\n /**\n * @api private\n */\n isClockSkewed: function isClockSkewed(serverTime) {\n if (serverTime) {\n util.property(AWS.config, 'isClockSkewed', Math.abs(new Date().getTime() - serverTime) >= 300000, false);\n return AWS.config.isClockSkewed;\n }\n },\n applyClockOffset: function applyClockOffset(serverTime) {\n if (serverTime) AWS.config.systemClockOffset = serverTime - new Date().getTime();\n },\n\n /**\n * @api private\n */\n extractRequestId: function extractRequestId(resp) {\n var requestId = resp.httpResponse.headers['x-amz-request-id'] || resp.httpResponse.headers['x-amzn-requestid'];\n\n if (!requestId && resp.data && resp.data.ResponseMetadata) {\n requestId = resp.data.ResponseMetadata.RequestId;\n }\n\n if (requestId) {\n resp.requestId = requestId;\n }\n\n if (resp.error) {\n resp.error.requestId = requestId;\n }\n },\n\n /**\n * @api private\n */\n addPromises: function addPromises(constructors, PromiseDependency) {\n var deletePromises = false;\n\n if (PromiseDependency === undefined && AWS && AWS.config) {\n PromiseDependency = AWS.config.getPromisesDependency();\n }\n\n if (PromiseDependency === undefined && typeof Promise !== 'undefined') {\n PromiseDependency = Promise;\n }\n\n if (typeof PromiseDependency !== 'function') deletePromises = true;\n if (!Array.isArray(constructors)) constructors = [constructors];\n\n for (var ind = 0; ind < constructors.length; ind++) {\n var constructor = constructors[ind];\n\n if (deletePromises) {\n if (constructor.deletePromisesFromClass) {\n constructor.deletePromisesFromClass();\n }\n } else if (constructor.addPromisesToClass) {\n constructor.addPromisesToClass(PromiseDependency);\n }\n }\n },\n\n /**\n * @api private\n * Return a function that will return a promise whose fate is decided by the\n * callback behavior of the given method with `methodName`. The method to be\n * promisified should conform to node.js convention of accepting a callback as\n * last argument and calling that callback with error as the first argument\n * and success value on the second argument.\n */\n promisifyMethod: function promisifyMethod(methodName, PromiseDependency) {\n return function promise() {\n var self = this;\n var args = Array.prototype.slice.call(arguments);\n return new PromiseDependency(function (resolve, reject) {\n args.push(function (err, data) {\n if (err) {\n reject(err);\n } else {\n resolve(data);\n }\n });\n self[methodName].apply(self, args);\n });\n };\n },\n\n /**\n * @api private\n */\n isDualstackAvailable: function isDualstackAvailable(service) {\n if (!service) return false;\n\n var metadata = require('../apis/metadata.json');\n\n if (typeof service !== 'string') service = service.serviceIdentifier;\n if (typeof service !== 'string' || !metadata.hasOwnProperty(service)) return false;\n return !!metadata[service].dualstackAvailable;\n },\n\n /**\n * @api private\n */\n calculateRetryDelay: function calculateRetryDelay(retryCount, retryDelayOptions) {\n if (!retryDelayOptions) retryDelayOptions = {};\n var customBackoff = retryDelayOptions.customBackoff || null;\n\n if (typeof customBackoff === 'function') {\n return customBackoff(retryCount);\n }\n\n var base = typeof retryDelayOptions.base === 'number' ? retryDelayOptions.base : 100;\n var delay = Math.random() * (Math.pow(2, retryCount) * base);\n return delay;\n },\n\n /**\n * @api private\n */\n handleRequestWithRetries: function handleRequestWithRetries(httpRequest, options, cb) {\n if (!options) options = {};\n var http = AWS.HttpClient.getInstance();\n var httpOptions = options.httpOptions || {};\n var retryCount = 0;\n\n var errCallback = function errCallback(err) {\n var maxRetries = options.maxRetries || 0;\n if (err && err.code === 'TimeoutError') err.retryable = true;\n\n if (err && err.retryable && retryCount < maxRetries) {\n retryCount++;\n var delay = util.calculateRetryDelay(retryCount, options.retryDelayOptions);\n setTimeout(sendRequest, delay + (err.retryAfter || 0));\n } else {\n cb(err);\n }\n };\n\n var sendRequest = function sendRequest() {\n var data = '';\n http.handleRequest(httpRequest, httpOptions, function (httpResponse) {\n httpResponse.on('data', function (chunk) {\n data += chunk.toString();\n });\n httpResponse.on('end', function () {\n var statusCode = httpResponse.statusCode;\n\n if (statusCode < 300) {\n cb(null, data);\n } else {\n var retryAfter = parseInt(httpResponse.headers['retry-after'], 10) * 1000 || 0;\n var err = util.error(new Error(), {\n retryable: statusCode >= 500 || statusCode === 429\n });\n if (retryAfter && err.retryable) err.retryAfter = retryAfter;\n errCallback(err);\n }\n });\n }, errCallback);\n };\n\n AWS.util.defer(sendRequest);\n },\n\n /**\n * @api private\n */\n uuid: {\n v4: function uuidV4() {\n return require('uuid').v4();\n }\n },\n\n /**\n * @api private\n */\n convertPayloadToString: function convertPayloadToString(resp) {\n var req = resp.request;\n var operation = req.operation;\n var rules = req.service.api.operations[operation].output || {};\n\n if (rules.payload && resp.data[rules.payload]) {\n resp.data[rules.payload] = resp.data[rules.payload].toString();\n }\n },\n\n /**\n * @api private\n */\n defer: function defer(callback) {\n if ((typeof process === \"undefined\" ? \"undefined\" : _typeof(process)) === 'object' && typeof process.nextTick === 'function') {\n process.nextTick(callback);\n } else if (typeof setImmediate === 'function') {\n setImmediate(callback);\n } else {\n setTimeout(callback, 0);\n }\n },\n\n /**\n * @api private\n */\n getRequestPayloadShape: function getRequestPayloadShape(req) {\n var operations = req.service.api.operations;\n if (!operations) return undefined;\n var operation = (operations || {})[req.operation];\n if (!operation || !operation.input || !operation.input.payload) return undefined;\n return operation.input.members[operation.input.payload];\n },\n getProfilesFromSharedConfig: function getProfilesFromSharedConfig(iniLoader, filename) {\n var profiles = {};\n var profilesFromConfig = {};\n\n if (process.env[util.configOptInEnv]) {\n var profilesFromConfig = iniLoader.loadFrom({\n isConfig: true,\n filename: process.env[util.sharedConfigFileEnv]\n });\n }\n\n var profilesFromCreds = iniLoader.loadFrom({\n filename: filename || process.env[util.configOptInEnv] && process.env[util.sharedCredentialsFileEnv]\n });\n\n for (var i = 0, profileNames = Object.keys(profilesFromConfig); i < profileNames.length; i++) {\n profiles[profileNames[i]] = profilesFromConfig[profileNames[i]];\n }\n\n for (var i = 0, profileNames = Object.keys(profilesFromCreds); i < profileNames.length; i++) {\n profiles[profileNames[i]] = profilesFromCreds[profileNames[i]];\n }\n\n return profiles;\n },\n\n /**\n * @api private\n */\n defaultProfile: 'default',\n\n /**\n * @api private\n */\n configOptInEnv: 'AWS_SDK_LOAD_CONFIG',\n\n /**\n * @api private\n */\n sharedCredentialsFileEnv: 'AWS_SHARED_CREDENTIALS_FILE',\n\n /**\n * @api private\n */\n sharedConfigFileEnv: 'AWS_CONFIG_FILE',\n\n /**\n * @api private\n */\n imdsDisabledEnv: 'AWS_EC2_METADATA_DISABLED'\n};\n/**\n * @api private\n */\n\nmodule.exports = util;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n;\n\n(function (root, factory) {\n if ((typeof exports === \"undefined\" ? \"undefined\" : _typeof(exports)) === \"object\") {\n // CommonJS\n module.exports = exports = factory();\n } else if (typeof define === \"function\" && define.amd) {\n // AMD\n define([], factory);\n } else {\n // Global (browser)\n root.CryptoJS = factory();\n }\n})(this, function () {\n /**\n * CryptoJS core components.\n */\n var CryptoJS = CryptoJS || function (Math, undefined) {\n /*\n * Local polyfil of Object.create\n */\n var create = Object.create || function () {\n function F() {}\n\n ;\n return function (obj) {\n var subtype;\n F.prototype = obj;\n subtype = new F();\n F.prototype = null;\n return subtype;\n };\n }();\n /**\n * CryptoJS namespace.\n */\n\n\n var C = {};\n /**\n * Library namespace.\n */\n\n var C_lib = C.lib = {};\n /**\n * Base object for prototypal inheritance.\n */\n\n var Base = C_lib.Base = function () {\n return {\n /**\n * Creates a new object that inherits from this object.\n *\n * @param {Object} overrides Properties to copy into the new object.\n *\n * @return {Object} The new object.\n *\n * @static\n *\n * @example\n *\n * var MyType = CryptoJS.lib.Base.extend({\n * field: 'value',\n *\n * method: function () {\n * }\n * });\n */\n extend: function extend(overrides) {\n // Spawn\n var subtype = create(this); // Augment\n\n if (overrides) {\n subtype.mixIn(overrides);\n } // Create default initializer\n\n\n if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {\n subtype.init = function () {\n subtype.$super.init.apply(this, arguments);\n };\n } // Initializer's prototype is the subtype object\n\n\n subtype.init.prototype = subtype; // Reference supertype\n\n subtype.$super = this;\n return subtype;\n },\n\n /**\n * Extends this object and runs the init method.\n * Arguments to create() will be passed to init().\n *\n * @return {Object} The new object.\n *\n * @static\n *\n * @example\n *\n * var instance = MyType.create();\n */\n create: function create() {\n var instance = this.extend();\n instance.init.apply(instance, arguments);\n return instance;\n },\n\n /**\n * Initializes a newly created object.\n * Override this method to add some logic when your objects are created.\n *\n * @example\n *\n * var MyType = CryptoJS.lib.Base.extend({\n * init: function () {\n * // ...\n * }\n * });\n */\n init: function init() {},\n\n /**\n * Copies properties into this object.\n *\n * @param {Object} properties The properties to mix in.\n *\n * @example\n *\n * MyType.mixIn({\n * field: 'value'\n * });\n */\n mixIn: function mixIn(properties) {\n for (var propertyName in properties) {\n if (properties.hasOwnProperty(propertyName)) {\n this[propertyName] = properties[propertyName];\n }\n } // IE won't copy toString using the loop above\n\n\n if (properties.hasOwnProperty('toString')) {\n this.toString = properties.toString;\n }\n },\n\n /**\n * Creates a copy of this object.\n *\n * @return {Object} The clone.\n *\n * @example\n *\n * var clone = instance.clone();\n */\n clone: function clone() {\n return this.init.prototype.extend(this);\n }\n };\n }();\n /**\n * An array of 32-bit words.\n *\n * @property {Array} words The array of 32-bit words.\n * @property {number} sigBytes The number of significant bytes in this word array.\n */\n\n\n var WordArray = C_lib.WordArray = Base.extend({\n /**\n * Initializes a newly created word array.\n *\n * @param {Array} words (Optional) An array of 32-bit words.\n * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n *\n * @example\n *\n * var wordArray = CryptoJS.lib.WordArray.create();\n * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);\n * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);\n */\n init: function init(words, sigBytes) {\n words = this.words = words || [];\n\n if (sigBytes != undefined) {\n this.sigBytes = sigBytes;\n } else {\n this.sigBytes = words.length * 4;\n }\n },\n\n /**\n * Converts this word array to a string.\n *\n * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex\n *\n * @return {string} The stringified word array.\n *\n * @example\n *\n * var string = wordArray + '';\n * var string = wordArray.toString();\n * var string = wordArray.toString(CryptoJS.enc.Utf8);\n */\n toString: function toString(encoder) {\n return (encoder || Hex).stringify(this);\n },\n\n /**\n * Concatenates a word array to this word array.\n *\n * @param {WordArray} wordArray The word array to append.\n *\n * @return {WordArray} This word array.\n *\n * @example\n *\n * wordArray1.concat(wordArray2);\n */\n concat: function concat(wordArray) {\n // Shortcuts\n var thisWords = this.words;\n var thatWords = wordArray.words;\n var thisSigBytes = this.sigBytes;\n var thatSigBytes = wordArray.sigBytes; // Clamp excess bits\n\n this.clamp(); // Concat\n\n if (thisSigBytes % 4) {\n // Copy one byte at a time\n for (var i = 0; i < thatSigBytes; i++) {\n var thatByte = thatWords[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;\n thisWords[thisSigBytes + i >>> 2] |= thatByte << 24 - (thisSigBytes + i) % 4 * 8;\n }\n } else {\n // Copy one word at a time\n for (var i = 0; i < thatSigBytes; i += 4) {\n thisWords[thisSigBytes + i >>> 2] = thatWords[i >>> 2];\n }\n }\n\n this.sigBytes += thatSigBytes; // Chainable\n\n return this;\n },\n\n /**\n * Removes insignificant bits.\n *\n * @example\n *\n * wordArray.clamp();\n */\n clamp: function clamp() {\n // Shortcuts\n var words = this.words;\n var sigBytes = this.sigBytes; // Clamp\n\n words[sigBytes >>> 2] &= 0xffffffff << 32 - sigBytes % 4 * 8;\n words.length = Math.ceil(sigBytes / 4);\n },\n\n /**\n * Creates a copy of this word array.\n *\n * @return {WordArray} The clone.\n *\n * @example\n *\n * var clone = wordArray.clone();\n */\n clone: function clone() {\n var clone = Base.clone.call(this);\n clone.words = this.words.slice(0);\n return clone;\n },\n\n /**\n * Creates a word array filled with random bytes.\n *\n * @param {number} nBytes The number of random bytes to generate.\n *\n * @return {WordArray} The random word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.lib.WordArray.random(16);\n */\n random: function random(nBytes) {\n var words = [];\n\n var r = function r(m_w) {\n var m_w = m_w;\n var m_z = 0x3ade68b1;\n var mask = 0xffffffff;\n return function () {\n m_z = 0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10) & mask;\n m_w = 0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10) & mask;\n var result = (m_z << 0x10) + m_w & mask;\n result /= 0x100000000;\n result += 0.5;\n return result * (Math.random() > .5 ? 1 : -1);\n };\n };\n\n for (var i = 0, rcache; i < nBytes; i += 4) {\n var _r = r((rcache || Math.random()) * 0x100000000);\n\n rcache = _r() * 0x3ade67b7;\n words.push(_r() * 0x100000000 | 0);\n }\n\n return new WordArray.init(words, nBytes);\n }\n });\n /**\n * Encoder namespace.\n */\n\n var C_enc = C.enc = {};\n /**\n * Hex encoding strategy.\n */\n\n var Hex = C_enc.Hex = {\n /**\n * Converts a word array to a hex string.\n *\n * @param {WordArray} wordArray The word array.\n *\n * @return {string} The hex string.\n *\n * @static\n *\n * @example\n *\n * var hexString = CryptoJS.enc.Hex.stringify(wordArray);\n */\n stringify: function stringify(wordArray) {\n // Shortcuts\n var words = wordArray.words;\n var sigBytes = wordArray.sigBytes; // Convert\n\n var hexChars = [];\n\n for (var i = 0; i < sigBytes; i++) {\n var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;\n hexChars.push((bite >>> 4).toString(16));\n hexChars.push((bite & 0x0f).toString(16));\n }\n\n return hexChars.join('');\n },\n\n /**\n * Converts a hex string to a word array.\n *\n * @param {string} hexStr The hex string.\n *\n * @return {WordArray} The word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.enc.Hex.parse(hexString);\n */\n parse: function parse(hexStr) {\n // Shortcut\n var hexStrLength = hexStr.length; // Convert\n\n var words = [];\n\n for (var i = 0; i < hexStrLength; i += 2) {\n words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << 24 - i % 8 * 4;\n }\n\n return new WordArray.init(words, hexStrLength / 2);\n }\n };\n /**\n * Latin1 encoding strategy.\n */\n\n var Latin1 = C_enc.Latin1 = {\n /**\n * Converts a word array to a Latin1 string.\n *\n * @param {WordArray} wordArray The word array.\n *\n * @return {string} The Latin1 string.\n *\n * @static\n *\n * @example\n *\n * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);\n */\n stringify: function stringify(wordArray) {\n // Shortcuts\n var words = wordArray.words;\n var sigBytes = wordArray.sigBytes; // Convert\n\n var latin1Chars = [];\n\n for (var i = 0; i < sigBytes; i++) {\n var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;\n latin1Chars.push(String.fromCharCode(bite));\n }\n\n return latin1Chars.join('');\n },\n\n /**\n * Converts a Latin1 string to a word array.\n *\n * @param {string} latin1Str The Latin1 string.\n *\n * @return {WordArray} The word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);\n */\n parse: function parse(latin1Str) {\n // Shortcut\n var latin1StrLength = latin1Str.length; // Convert\n\n var words = [];\n\n for (var i = 0; i < latin1StrLength; i++) {\n words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << 24 - i % 4 * 8;\n }\n\n return new WordArray.init(words, latin1StrLength);\n }\n };\n /**\n * UTF-8 encoding strategy.\n */\n\n var Utf8 = C_enc.Utf8 = {\n /**\n * Converts a word array to a UTF-8 string.\n *\n * @param {WordArray} wordArray The word array.\n *\n * @return {string} The UTF-8 string.\n *\n * @static\n *\n * @example\n *\n * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);\n */\n stringify: function stringify(wordArray) {\n try {\n return decodeURIComponent(escape(Latin1.stringify(wordArray)));\n } catch (e) {\n throw new Error('Malformed UTF-8 data');\n }\n },\n\n /**\n * Converts a UTF-8 string to a word array.\n *\n * @param {string} utf8Str The UTF-8 string.\n *\n * @return {WordArray} The word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);\n */\n parse: function parse(utf8Str) {\n return Latin1.parse(unescape(encodeURIComponent(utf8Str)));\n }\n };\n /**\n * Abstract buffered block algorithm template.\n *\n * The property blockSize must be implemented in a concrete subtype.\n *\n * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0\n */\n\n var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({\n /**\n * Resets this block algorithm's data buffer to its initial state.\n *\n * @example\n *\n * bufferedBlockAlgorithm.reset();\n */\n reset: function reset() {\n // Initial values\n this._data = new WordArray.init();\n this._nDataBytes = 0;\n },\n\n /**\n * Adds new data to this block algorithm's buffer.\n *\n * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.\n *\n * @example\n *\n * bufferedBlockAlgorithm._append('data');\n * bufferedBlockAlgorithm._append(wordArray);\n */\n _append: function _append(data) {\n // Convert string to WordArray, else assume WordArray already\n if (typeof data == 'string') {\n data = Utf8.parse(data);\n } // Append\n\n\n this._data.concat(data);\n\n this._nDataBytes += data.sigBytes;\n },\n\n /**\n * Processes available data blocks.\n *\n * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.\n *\n * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.\n *\n * @return {WordArray} The processed data.\n *\n * @example\n *\n * var processedData = bufferedBlockAlgorithm._process();\n * var processedData = bufferedBlockAlgorithm._process(!!'flush');\n */\n _process: function _process(doFlush) {\n // Shortcuts\n var data = this._data;\n var dataWords = data.words;\n var dataSigBytes = data.sigBytes;\n var blockSize = this.blockSize;\n var blockSizeBytes = blockSize * 4; // Count blocks ready\n\n var nBlocksReady = dataSigBytes / blockSizeBytes;\n\n if (doFlush) {\n // Round up to include partial blocks\n nBlocksReady = Math.ceil(nBlocksReady);\n } else {\n // Round down to include only full blocks,\n // less the number of blocks that must remain in the buffer\n nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);\n } // Count words ready\n\n\n var nWordsReady = nBlocksReady * blockSize; // Count bytes ready\n\n var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); // Process blocks\n\n if (nWordsReady) {\n for (var offset = 0; offset < nWordsReady; offset += blockSize) {\n // Perform concrete-algorithm logic\n this._doProcessBlock(dataWords, offset);\n } // Remove processed words\n\n\n var processedWords = dataWords.splice(0, nWordsReady);\n data.sigBytes -= nBytesReady;\n } // Return processed words\n\n\n return new WordArray.init(processedWords, nBytesReady);\n },\n\n /**\n * Creates a copy of this object.\n *\n * @return {Object} The clone.\n *\n * @example\n *\n * var clone = bufferedBlockAlgorithm.clone();\n */\n clone: function clone() {\n var clone = Base.clone.call(this);\n clone._data = this._data.clone();\n return clone;\n },\n _minBufferSize: 0\n });\n /**\n * Abstract hasher template.\n *\n * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)\n */\n\n var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({\n /**\n * Configuration options.\n */\n cfg: Base.extend(),\n\n /**\n * Initializes a newly created hasher.\n *\n * @param {Object} cfg (Optional) The configuration options to use for this hash computation.\n *\n * @example\n *\n * var hasher = CryptoJS.algo.SHA256.create();\n */\n init: function init(cfg) {\n // Apply config defaults\n this.cfg = this.cfg.extend(cfg); // Set initial values\n\n this.reset();\n },\n\n /**\n * Resets this hasher to its initial state.\n *\n * @example\n *\n * hasher.reset();\n */\n reset: function reset() {\n // Reset data buffer\n BufferedBlockAlgorithm.reset.call(this); // Perform concrete-hasher logic\n\n this._doReset();\n },\n\n /**\n * Updates this hasher with a message.\n *\n * @param {WordArray|string} messageUpdate The message to append.\n *\n * @return {Hasher} This hasher.\n *\n * @example\n *\n * hasher.update('message');\n * hasher.update(wordArray);\n */\n update: function update(messageUpdate) {\n // Append\n this._append(messageUpdate); // Update the hash\n\n\n this._process(); // Chainable\n\n\n return this;\n },\n\n /**\n * Finalizes the hash computation.\n * Note that the finalize operation is effectively a destructive, read-once operation.\n *\n * @param {WordArray|string} messageUpdate (Optional) A final message update.\n *\n * @return {WordArray} The hash.\n *\n * @example\n *\n * var hash = hasher.finalize();\n * var hash = hasher.finalize('message');\n * var hash = hasher.finalize(wordArray);\n */\n finalize: function finalize(messageUpdate) {\n // Final message update\n if (messageUpdate) {\n this._append(messageUpdate);\n } // Perform concrete-hasher logic\n\n\n var hash = this._doFinalize();\n\n return hash;\n },\n blockSize: 512 / 32,\n\n /**\n * Creates a shortcut function to a hasher's object interface.\n *\n * @param {Hasher} hasher The hasher to create a helper for.\n *\n * @return {Function} The shortcut function.\n *\n * @static\n *\n * @example\n *\n * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);\n */\n _createHelper: function _createHelper(hasher) {\n return function (message, cfg) {\n return new hasher.init(cfg).finalize(message);\n };\n },\n\n /**\n * Creates a shortcut function to the HMAC's object interface.\n *\n * @param {Hasher} hasher The hasher to use in this HMAC helper.\n *\n * @return {Function} The shortcut function.\n *\n * @static\n *\n * @example\n *\n * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);\n */\n _createHmacHelper: function _createHmacHelper(hasher) {\n return function (message, key) {\n return new C_algo.HMAC.init(hasher, key).finalize(message);\n };\n }\n });\n /**\n * Algorithm namespace.\n */\n\n var C_algo = C.algo = {};\n return C;\n }(Math);\n\n return CryptoJS;\n});","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","import * as React from 'react';\nvar useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n/**\n * https://github.com/facebook/react/issues/14099#issuecomment-440013892\n *\n * @param {function} fn\n */\n\nexport default function useEventCallback(fn) {\n var ref = React.useRef(fn);\n useEnhancedEffect(function () {\n ref.current = fn;\n });\n return React.useCallback(function () {\n return (0, ref.current).apply(void 0, arguments);\n }, []);\n}","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = createSvgIcon;\n\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _SvgIcon = _interopRequireDefault(require(\"@material-ui/core/SvgIcon\"));\n\nfunction createSvgIcon(path, displayName) {\n var Component = _react[\"default\"].memo(_react[\"default\"].forwardRef(function (props, ref) {\n return _react[\"default\"].createElement(_SvgIcon[\"default\"], (0, _extends2[\"default\"])({\n ref: ref\n }, props), path);\n }));\n\n if (process.env.NODE_ENV !== 'production') {\n Component.displayName = \"\".concat(displayName, \"Icon\");\n }\n\n Component.muiName = _SvgIcon[\"default\"].muiName;\n return Component;\n}","\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n// Redux events\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n// ビュー切り替え\r\nexport const FRONTEND_CHANGE_VIEW = \"FRONTEND_CHANGE_VIEW\";\r\n\r\n// 左上ハンバーガメニューのクリック\r\nexport const FRONTEND_APP_BAR_ONCLICK_LEFT_TOP_MENU = \"FRONTEND_APP_BAR_ONCLICK_LEFT_TOP_MENU\";\r\n\r\n// ログインユーザー情報の取得完了\r\nexport const ON_LOAD_USERINFO = \"ON_LOAD_USERINFO\";\r\n\r\nexport const RESET_NOTIFICATIONS = \"RESET_NOTIFICATIONS\";\r\n\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n// 画面\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n// マイ予約\r\nexport const FRONTEND_VIEW_MY_RESERVATION = \"/frontend/reservations\";\r\n// 利用中\r\nexport const FRONTEND_VIEW_MY_USING = \"/frontend/rent\";\r\n// 利用履歴\r\nexport const FRONTEND_VIEW_MY_HISTORY = \"/frontend/history\";\r\n// 登録内容\r\nexport const FRONTEND_VIEW_MY_INFO = \"/frontend/profile\";\r\n// 本人確認書類\r\nexport const FRONTEND_VIEW_IDENTIFY = \"/frontend/identification\";\r\n// メッセージ\r\nexport const FRONTEND_VIEW_MY_MESSAGE = \"/frontend/messages\";\r\n\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n// 定数\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\nexport const LEFT_MENU_WIDTH = 250;\r\nexport const RIGHT_CALENDAR_WIDTH = 280;\r\n\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n// API\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n// 予約登録\r\nexport const API_APPLY_EVENT = \"API_APPLY_EVENT\";\r\n// ユーザー情報取得\r\nexport const API_GET_MY_INFORMATION = \"API_GET_MY_INFORMATION\";\r\n// ユーザー予約情報\r\nexport const API_GET_USER_EVENT_LIST = \"API_GET_USER_EVENT_LIST\";\r\n// カスタマー情報の取得\r\nexport const API_GET_CUSTOMER_INFORMATION = \"API_GET_CUSTOMER_INFORMATION\";\r\n// クーポン利用可否の問い合わせ\r\nexport const API_CHECK_COUPON = \"API_CHECK_COUPON\";\r\n\r\nexport const RESET_ITEMS = \"RESET_ITEMS\";\r\n\r\nexport const RESET_CUSTOMER = \"RESET_CUSTOMER\";","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport isInBrowser from 'is-in-browser';\nimport warning from 'tiny-warning';\nimport _createClass from '@babel/runtime/helpers/esm/createClass';\nimport _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport _assertThisInitialized from '@babel/runtime/helpers/esm/assertThisInitialized';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\nvar plainObjectConstrurctor = {}.constructor;\n\nfunction cloneStyle(style) {\n if (style == null || _typeof(style) !== 'object') return style;\n if (Array.isArray(style)) return style.map(cloneStyle);\n if (style.constructor !== plainObjectConstrurctor) return style;\n var newStyle = {};\n\n for (var name in style) {\n newStyle[name] = cloneStyle(style[name]);\n }\n\n return newStyle;\n}\n/**\n * Create a rule instance.\n */\n\n\nfunction createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Unknown rule \" + name) : void 0;\n }\n\n return null;\n}\n\nvar join = function join(value, by) {\n var result = '';\n\n for (var i = 0; i < value.length; i++) {\n // Remove !important from the value, it will be readded later.\n if (value[i] === '!important') break;\n if (result) result += by;\n result += value[i];\n }\n\n return result;\n};\n/**\n * Converts array values to string.\n *\n * `margin: [['5px', '10px']]` > `margin: 5px 10px;`\n * `border: ['1px', '2px']` > `border: 1px, 2px;`\n * `margin: [['5px', '10px'], '!important']` > `margin: 5px 10px !important;`\n * `color: ['red', !important]` > `color: red !important;`\n */\n\n\nfunction toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}\n/**\n * Indent a string.\n * http://jsperf.com/array-join-vs-for\n */\n\n\nfunction indentStr(str, indent) {\n var result = '';\n\n for (var index = 0; index < indent; index++) {\n result += ' ';\n }\n\n return result + str;\n}\n/**\n * Converts a Rule to CSS string.\n */\n\n\nfunction toCss(selector, style, options) {\n if (options === void 0) {\n options = {};\n }\n\n var result = '';\n if (!style) return result;\n var _options = options,\n _options$indent = _options.indent,\n indent = _options$indent === void 0 ? 0 : _options$indent;\n var fallbacks = style.fallbacks;\n if (selector) indent++; // Apply fallbacks first.\n\n if (fallbacks) {\n // Array syntax {fallbacks: [{prop: value}]}\n if (Array.isArray(fallbacks)) {\n for (var index = 0; index < fallbacks.length; index++) {\n var fallback = fallbacks[index];\n\n for (var prop in fallback) {\n var value = fallback[prop];\n\n if (value != null) {\n if (result) result += '\\n';\n result += \"\" + indentStr(prop + \": \" + toCssValue(value) + \";\", indent);\n }\n }\n }\n } else {\n // Object syntax {fallbacks: {prop: value}}\n for (var _prop in fallbacks) {\n var _value = fallbacks[_prop];\n\n if (_value != null) {\n if (result) result += '\\n';\n result += \"\" + indentStr(_prop + \": \" + toCssValue(_value) + \";\", indent);\n }\n }\n }\n }\n\n for (var _prop2 in style) {\n var _value2 = style[_prop2];\n\n if (_value2 != null && _prop2 !== 'fallbacks') {\n if (result) result += '\\n';\n result += \"\" + indentStr(_prop2 + \": \" + toCssValue(_value2) + \";\", indent);\n }\n } // Allow empty style in this case, because properties will be added dynamically.\n\n\n if (!result && !options.allowEmpty) return result; // When rule is being stringified before selector was defined.\n\n if (!selector) return result;\n indent--;\n if (result) result = \"\\n\" + result + \"\\n\";\n return indentStr(selector + \" {\" + result, indent) + indentStr('}', indent);\n}\n\nvar escapeRegex = /([[\\].#*$><+~=|^:(),\"'`\\s])/g;\nvar nativeEscape = typeof CSS !== 'undefined' && CSS.escape;\n\nvar escape = function escape(str) {\n return nativeEscape ? nativeEscape(str) : str.replace(escapeRegex, '\\\\$1');\n};\n\nvar BaseStyleRule = /*#__PURE__*/function () {\n function BaseStyleRule(key, style, options) {\n this.type = 'style';\n this.key = void 0;\n this.isProcessed = false;\n this.style = void 0;\n this.renderer = void 0;\n this.renderable = void 0;\n this.options = void 0;\n var sheet = options.sheet,\n Renderer = options.Renderer;\n this.key = key;\n this.options = options;\n this.style = style;\n if (sheet) this.renderer = sheet.renderer;else if (Renderer) this.renderer = new Renderer();\n }\n /**\n * Get or set a style property.\n */\n\n\n var _proto = BaseStyleRule.prototype;\n\n _proto.prop = function prop(name, value, options) {\n // It's a getter.\n if (value === undefined) return this.style[name]; // Don't do anything if the value has not changed.\n\n var force = options ? options.force : false;\n if (!force && this.style[name] === value) return this;\n var newValue = value;\n\n if (!options || options.process !== false) {\n newValue = this.options.jss.plugins.onChangeValue(value, name, this);\n }\n\n var isEmpty = newValue == null || newValue === false;\n var isDefined = (name in this.style); // Value is empty and wasn't defined before.\n\n if (isEmpty && !isDefined && !force) return this; // We are going to remove this value.\n\n var remove = isEmpty && isDefined;\n if (remove) delete this.style[name];else this.style[name] = newValue; // Renderable is defined if StyleSheet option `link` is true.\n\n if (this.renderable && this.renderer) {\n if (remove) this.renderer.removeProperty(this.renderable, name);else this.renderer.setProperty(this.renderable, name, newValue);\n return this;\n }\n\n var sheet = this.options.sheet;\n\n if (sheet && sheet.attached) {\n process.env.NODE_ENV !== \"production\" ? warning(false, '[JSS] Rule is not linked. Missing sheet option \"link: true\".') : void 0;\n }\n\n return this;\n };\n\n return BaseStyleRule;\n}();\n\nvar StyleRule = /*#__PURE__*/function (_BaseStyleRule) {\n _inheritsLoose(StyleRule, _BaseStyleRule);\n\n function StyleRule(key, style, options) {\n var _this;\n\n _this = _BaseStyleRule.call(this, key, style, options) || this;\n _this.selectorText = void 0;\n _this.id = void 0;\n _this.renderable = void 0;\n var selector = options.selector,\n scoped = options.scoped,\n sheet = options.sheet,\n generateId = options.generateId;\n\n if (selector) {\n _this.selectorText = selector;\n } else if (scoped !== false) {\n _this.id = generateId(_assertThisInitialized(_assertThisInitialized(_this)), sheet);\n _this.selectorText = \".\" + escape(_this.id);\n }\n\n return _this;\n }\n /**\n * Set selector string.\n * Attention: use this with caution. Most browsers didn't implement\n * selectorText setter, so this may result in rerendering of entire Style Sheet.\n */\n\n\n var _proto2 = StyleRule.prototype;\n /**\n * Apply rule to an element inline.\n */\n\n _proto2.applyTo = function applyTo(renderable) {\n var renderer = this.renderer;\n\n if (renderer) {\n var json = this.toJSON();\n\n for (var prop in json) {\n renderer.setProperty(renderable, prop, json[prop]);\n }\n }\n\n return this;\n }\n /**\n * Returns JSON representation of the rule.\n * Fallbacks are not supported.\n * Useful for inline styles.\n */\n ;\n\n _proto2.toJSON = function toJSON() {\n var json = {};\n\n for (var prop in this.style) {\n var value = this.style[prop];\n if (_typeof(value) !== 'object') json[prop] = value;else if (Array.isArray(value)) json[prop] = toCssValue(value);\n }\n\n return json;\n }\n /**\n * Generates a CSS string.\n */\n ;\n\n _proto2.toString = function toString(options) {\n var sheet = this.options.sheet;\n var link = sheet ? sheet.options.link : false;\n var opts = link ? _extends({}, options, {\n allowEmpty: true\n }) : options;\n return toCss(this.selectorText, this.style, opts);\n };\n\n _createClass(StyleRule, [{\n key: \"selector\",\n set: function set(selector) {\n if (selector === this.selectorText) return;\n this.selectorText = selector;\n var renderer = this.renderer,\n renderable = this.renderable;\n if (!renderable || !renderer) return;\n var hasChanged = renderer.setSelector(renderable, selector); // If selector setter is not implemented, rerender the rule.\n\n if (!hasChanged) {\n renderer.replaceRule(renderable, this);\n }\n }\n /**\n * Get selector string.\n */\n ,\n get: function get() {\n return this.selectorText;\n }\n }]);\n\n return StyleRule;\n}(BaseStyleRule);\n\nvar pluginStyleRule = {\n onCreateRule: function onCreateRule(name, style, options) {\n if (name[0] === '@' || options.parent && options.parent.type === 'keyframes') {\n return null;\n }\n\n return new StyleRule(name, style, options);\n }\n};\nvar defaultToStringOptions = {\n indent: 1,\n children: true\n};\nvar atRegExp = /@([\\w-]+)/;\n/**\n * Conditional rule for @media, @supports\n */\n\nvar ConditionalRule = /*#__PURE__*/function () {\n function ConditionalRule(key, styles, options) {\n this.type = 'conditional';\n this.at = void 0;\n this.key = void 0;\n this.query = void 0;\n this.rules = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n this.key = key; // Key might contain a unique suffix in case the `name` passed by user was duplicate.\n\n this.query = options.name;\n var atMatch = key.match(atRegExp);\n this.at = atMatch ? atMatch[1] : 'unknown';\n this.options = options;\n this.rules = new RuleList(_extends({}, options, {\n parent: this\n }));\n\n for (var name in styles) {\n this.rules.add(name, styles[name]);\n }\n\n this.rules.process();\n }\n /**\n * Get a rule.\n */\n\n\n var _proto = ConditionalRule.prototype;\n\n _proto.getRule = function getRule(name) {\n return this.rules.get(name);\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.rules.indexOf(rule);\n }\n /**\n * Create and register rule, run plugins.\n */\n ;\n\n _proto.addRule = function addRule(name, style, options) {\n var rule = this.rules.add(name, style, options);\n if (!rule) return null;\n this.options.jss.plugins.onProcessRule(rule);\n return rule;\n }\n /**\n * Generates a CSS string.\n */\n ;\n\n _proto.toString = function toString(options) {\n if (options === void 0) {\n options = defaultToStringOptions;\n }\n\n if (options.indent == null) options.indent = defaultToStringOptions.indent;\n if (options.children == null) options.children = defaultToStringOptions.children;\n\n if (options.children === false) {\n return this.query + \" {}\";\n }\n\n var children = this.rules.toString(options);\n return children ? this.query + \" {\\n\" + children + \"\\n}\" : '';\n };\n\n return ConditionalRule;\n}();\n\nvar keyRegExp = /@media|@supports\\s+/;\nvar pluginConditionalRule = {\n onCreateRule: function onCreateRule(key, styles, options) {\n return keyRegExp.test(key) ? new ConditionalRule(key, styles, options) : null;\n }\n};\nvar defaultToStringOptions$1 = {\n indent: 1,\n children: true\n};\nvar nameRegExp = /@keyframes\\s+([\\w-]+)/;\n/**\n * Rule for @keyframes\n */\n\nvar KeyframesRule = /*#__PURE__*/function () {\n function KeyframesRule(key, frames, options) {\n this.type = 'keyframes';\n this.at = '@keyframes';\n this.key = void 0;\n this.name = void 0;\n this.id = void 0;\n this.rules = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n var nameMatch = key.match(nameRegExp);\n\n if (nameMatch && nameMatch[1]) {\n this.name = nameMatch[1];\n } else {\n this.name = 'noname';\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Bad keyframes name \" + key) : void 0;\n }\n\n this.key = this.type + \"-\" + this.name;\n this.options = options;\n var scoped = options.scoped,\n sheet = options.sheet,\n generateId = options.generateId;\n this.id = scoped === false ? this.name : escape(generateId(this, sheet));\n this.rules = new RuleList(_extends({}, options, {\n parent: this\n }));\n\n for (var name in frames) {\n this.rules.add(name, frames[name], _extends({}, options, {\n parent: this\n }));\n }\n\n this.rules.process();\n }\n /**\n * Generates a CSS string.\n */\n\n\n var _proto = KeyframesRule.prototype;\n\n _proto.toString = function toString(options) {\n if (options === void 0) {\n options = defaultToStringOptions$1;\n }\n\n if (options.indent == null) options.indent = defaultToStringOptions$1.indent;\n if (options.children == null) options.children = defaultToStringOptions$1.children;\n\n if (options.children === false) {\n return this.at + \" \" + this.id + \" {}\";\n }\n\n var children = this.rules.toString(options);\n if (children) children = \"\\n\" + children + \"\\n\";\n return this.at + \" \" + this.id + \" {\" + children + \"}\";\n };\n\n return KeyframesRule;\n}();\n\nvar keyRegExp$1 = /@keyframes\\s+/;\nvar refRegExp = /\\$([\\w-]+)/g;\n\nvar findReferencedKeyframe = function findReferencedKeyframe(val, keyframes) {\n if (typeof val === 'string') {\n return val.replace(refRegExp, function (match, name) {\n if (name in keyframes) {\n return keyframes[name];\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Referenced keyframes rule \\\"\" + name + \"\\\" is not defined.\") : void 0;\n return match;\n });\n }\n\n return val;\n};\n/**\n * Replace the reference for a animation name.\n */\n\n\nvar replaceRef = function replaceRef(style, prop, keyframes) {\n var value = style[prop];\n var refKeyframe = findReferencedKeyframe(value, keyframes);\n\n if (refKeyframe !== value) {\n style[prop] = refKeyframe;\n }\n};\n\nvar plugin = {\n onCreateRule: function onCreateRule(key, frames, options) {\n return typeof key === 'string' && keyRegExp$1.test(key) ? new KeyframesRule(key, frames, options) : null;\n },\n // Animation name ref replacer.\n onProcessStyle: function onProcessStyle(style, rule, sheet) {\n if (rule.type !== 'style' || !sheet) return style;\n if ('animation-name' in style) replaceRef(style, 'animation-name', sheet.keyframes);\n if ('animation' in style) replaceRef(style, 'animation', sheet.keyframes);\n return style;\n },\n onChangeValue: function onChangeValue(val, prop, rule) {\n var sheet = rule.options.sheet;\n\n if (!sheet) {\n return val;\n }\n\n switch (prop) {\n case 'animation':\n return findReferencedKeyframe(val, sheet.keyframes);\n\n case 'animation-name':\n return findReferencedKeyframe(val, sheet.keyframes);\n\n default:\n return val;\n }\n }\n};\n\nvar KeyframeRule = /*#__PURE__*/function (_BaseStyleRule) {\n _inheritsLoose(KeyframeRule, _BaseStyleRule);\n\n function KeyframeRule() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _BaseStyleRule.call.apply(_BaseStyleRule, [this].concat(args)) || this;\n _this.renderable = void 0;\n return _this;\n }\n\n var _proto = KeyframeRule.prototype;\n /**\n * Generates a CSS string.\n */\n\n _proto.toString = function toString(options) {\n var sheet = this.options.sheet;\n var link = sheet ? sheet.options.link : false;\n var opts = link ? _extends({}, options, {\n allowEmpty: true\n }) : options;\n return toCss(this.key, this.style, opts);\n };\n\n return KeyframeRule;\n}(BaseStyleRule);\n\nvar pluginKeyframeRule = {\n onCreateRule: function onCreateRule(key, style, options) {\n if (options.parent && options.parent.type === 'keyframes') {\n return new KeyframeRule(key, style, options);\n }\n\n return null;\n }\n};\n\nvar FontFaceRule = /*#__PURE__*/function () {\n function FontFaceRule(key, style, options) {\n this.type = 'font-face';\n this.at = '@font-face';\n this.key = void 0;\n this.style = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n this.key = key;\n this.style = style;\n this.options = options;\n }\n /**\n * Generates a CSS string.\n */\n\n\n var _proto = FontFaceRule.prototype;\n\n _proto.toString = function toString(options) {\n if (Array.isArray(this.style)) {\n var str = '';\n\n for (var index = 0; index < this.style.length; index++) {\n str += toCss(this.at, this.style[index]);\n if (this.style[index + 1]) str += '\\n';\n }\n\n return str;\n }\n\n return toCss(this.at, this.style, options);\n };\n\n return FontFaceRule;\n}();\n\nvar keyRegExp$2 = /@font-face/;\nvar pluginFontFaceRule = {\n onCreateRule: function onCreateRule(key, style, options) {\n return keyRegExp$2.test(key) ? new FontFaceRule(key, style, options) : null;\n }\n};\n\nvar ViewportRule = /*#__PURE__*/function () {\n function ViewportRule(key, style, options) {\n this.type = 'viewport';\n this.at = '@viewport';\n this.key = void 0;\n this.style = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n this.key = key;\n this.style = style;\n this.options = options;\n }\n /**\n * Generates a CSS string.\n */\n\n\n var _proto = ViewportRule.prototype;\n\n _proto.toString = function toString(options) {\n return toCss(this.key, this.style, options);\n };\n\n return ViewportRule;\n}();\n\nvar pluginViewportRule = {\n onCreateRule: function onCreateRule(key, style, options) {\n return key === '@viewport' || key === '@-ms-viewport' ? new ViewportRule(key, style, options) : null;\n }\n};\n\nvar SimpleRule = /*#__PURE__*/function () {\n function SimpleRule(key, value, options) {\n this.type = 'simple';\n this.key = void 0;\n this.value = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n this.key = key;\n this.value = value;\n this.options = options;\n }\n /**\n * Generates a CSS string.\n */\n // eslint-disable-next-line no-unused-vars\n\n\n var _proto = SimpleRule.prototype;\n\n _proto.toString = function toString(options) {\n if (Array.isArray(this.value)) {\n var str = '';\n\n for (var index = 0; index < this.value.length; index++) {\n str += this.key + \" \" + this.value[index] + \";\";\n if (this.value[index + 1]) str += '\\n';\n }\n\n return str;\n }\n\n return this.key + \" \" + this.value + \";\";\n };\n\n return SimpleRule;\n}();\n\nvar keysMap = {\n '@charset': true,\n '@import': true,\n '@namespace': true\n};\nvar pluginSimpleRule = {\n onCreateRule: function onCreateRule(key, value, options) {\n return key in keysMap ? new SimpleRule(key, value, options) : null;\n }\n};\nvar plugins = [pluginStyleRule, pluginConditionalRule, plugin, pluginKeyframeRule, pluginFontFaceRule, pluginViewportRule, pluginSimpleRule];\nvar defaultUpdateOptions = {\n process: true\n};\nvar forceUpdateOptions = {\n force: true,\n process: true\n /**\n * Contains rules objects and allows adding/removing etc.\n * Is used for e.g. by `StyleSheet` or `ConditionalRule`.\n */\n\n};\n\nvar RuleList = /*#__PURE__*/function () {\n // Rules registry for access by .get() method.\n // It contains the same rule registered by name and by selector.\n // Original styles object.\n // Used to ensure correct rules order.\n function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }\n /**\n * Create and register rule.\n *\n * Will not render after Style Sheet was rendered the first time.\n */\n\n\n var _proto = RuleList.prototype;\n\n _proto.add = function add(name, decl, ruleOptions) {\n var _this$options = this.options,\n parent = _this$options.parent,\n sheet = _this$options.sheet,\n jss = _this$options.jss,\n Renderer = _this$options.Renderer,\n generateId = _this$options.generateId,\n scoped = _this$options.scoped;\n\n var options = _extends({\n classes: this.classes,\n parent: parent,\n sheet: sheet,\n jss: jss,\n Renderer: Renderer,\n generateId: generateId,\n scoped: scoped,\n name: name\n }, ruleOptions); // When user uses .createStyleSheet(), duplicate names are not possible, but\n // `sheet.addRule()` opens the door for any duplicate rule name. When this happens\n // we need to make the key unique within this RuleList instance scope.\n\n\n var key = name;\n\n if (name in this.raw) {\n key = name + \"-d\" + this.counter++;\n } // We need to save the original decl before creating the rule\n // because cache plugin needs to use it as a key to return a cached rule.\n\n\n this.raw[key] = decl;\n\n if (key in this.classes) {\n // E.g. rules inside of @media container\n options.selector = \".\" + escape(this.classes[key]);\n }\n\n var rule = createRule(key, decl, options);\n if (!rule) return null;\n this.register(rule);\n var index = options.index === undefined ? this.index.length : options.index;\n this.index.splice(index, 0, rule);\n return rule;\n }\n /**\n * Get a rule.\n */\n ;\n\n _proto.get = function get(name) {\n return this.map[name];\n }\n /**\n * Delete a rule.\n */\n ;\n\n _proto.remove = function remove(rule) {\n this.unregister(rule);\n delete this.raw[rule.key];\n this.index.splice(this.index.indexOf(rule), 1);\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.index.indexOf(rule);\n }\n /**\n * Run `onProcessRule()` plugins on every rule.\n */\n ;\n\n _proto.process = function process() {\n var plugins$$1 = this.options.jss.plugins; // We need to clone array because if we modify the index somewhere else during a loop\n // we end up with very hard-to-track-down side effects.\n\n this.index.slice(0).forEach(plugins$$1.onProcessRule, plugins$$1);\n }\n /**\n * Register a rule in `.map`, `.classes` and `.keyframes` maps.\n */\n ;\n\n _proto.register = function register(rule) {\n this.map[rule.key] = rule;\n\n if (rule instanceof StyleRule) {\n this.map[rule.selector] = rule;\n if (rule.id) this.classes[rule.key] = rule.id;\n } else if (rule instanceof KeyframesRule && this.keyframes) {\n this.keyframes[rule.name] = rule.id;\n }\n }\n /**\n * Unregister a rule.\n */\n ;\n\n _proto.unregister = function unregister(rule) {\n delete this.map[rule.key];\n\n if (rule instanceof StyleRule) {\n delete this.map[rule.selector];\n delete this.classes[rule.key];\n } else if (rule instanceof KeyframesRule) {\n delete this.keyframes[rule.name];\n }\n }\n /**\n * Update the function values with a new data.\n */\n ;\n\n _proto.update = function update() {\n var name;\n var data;\n var options;\n\n if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'string') {\n name = arguments.length <= 0 ? undefined : arguments[0]; // $FlowFixMe\n\n data = arguments.length <= 1 ? undefined : arguments[1]; // $FlowFixMe\n\n options = arguments.length <= 2 ? undefined : arguments[2];\n } else {\n data = arguments.length <= 0 ? undefined : arguments[0]; // $FlowFixMe\n\n options = arguments.length <= 1 ? undefined : arguments[1];\n name = null;\n }\n\n if (name) {\n this.updateOne(this.map[name], data, options);\n } else {\n for (var index = 0; index < this.index.length; index++) {\n this.updateOne(this.index[index], data, options);\n }\n }\n }\n /**\n * Execute plugins, update rule props.\n */\n ;\n\n _proto.updateOne = function updateOne(rule, data, options) {\n if (options === void 0) {\n options = defaultUpdateOptions;\n }\n\n var _this$options2 = this.options,\n plugins$$1 = _this$options2.jss.plugins,\n sheet = _this$options2.sheet; // It is a rules container like for e.g. ConditionalRule.\n\n if (rule.rules instanceof RuleList) {\n rule.rules.update(data, options);\n return;\n }\n\n var styleRule = rule;\n var style = styleRule.style;\n plugins$$1.onUpdate(data, rule, sheet, options); // We rely on a new `style` ref in case it was mutated during onUpdate hook.\n\n if (options.process && style && style !== styleRule.style) {\n // We need to run the plugins in case new `style` relies on syntax plugins.\n plugins$$1.onProcessStyle(styleRule.style, styleRule, sheet); // Update and add props.\n\n for (var prop in styleRule.style) {\n var nextValue = styleRule.style[prop];\n var prevValue = style[prop]; // We need to use `force: true` because `rule.style` has been updated during onUpdate hook, so `rule.prop()` will not update the CSSOM rule.\n // We do this comparison to avoid unneeded `rule.prop()` calls, since we have the old `style` object here.\n\n if (nextValue !== prevValue) {\n styleRule.prop(prop, nextValue, forceUpdateOptions);\n }\n } // Remove props.\n\n\n for (var _prop in style) {\n var _nextValue = styleRule.style[_prop];\n var _prevValue = style[_prop]; // We need to use `force: true` because `rule.style` has been updated during onUpdate hook, so `rule.prop()` will not update the CSSOM rule.\n // We do this comparison to avoid unneeded `rule.prop()` calls, since we have the old `style` object here.\n\n if (_nextValue == null && _nextValue !== _prevValue) {\n styleRule.prop(_prop, null, forceUpdateOptions);\n }\n }\n }\n }\n /**\n * Convert rules to a CSS string.\n */\n ;\n\n _proto.toString = function toString(options) {\n var str = '';\n var sheet = this.options.sheet;\n var link = sheet ? sheet.options.link : false;\n\n for (var index = 0; index < this.index.length; index++) {\n var rule = this.index[index];\n var css = rule.toString(options); // No need to render an empty rule.\n\n if (!css && !link) continue;\n if (str) str += '\\n';\n str += css;\n }\n\n return str;\n };\n\n return RuleList;\n}();\n\nvar StyleSheet = /*#__PURE__*/function () {\n function StyleSheet(styles, options) {\n this.options = void 0;\n this.deployed = void 0;\n this.attached = void 0;\n this.rules = void 0;\n this.renderer = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.queue = void 0;\n this.attached = false;\n this.deployed = false;\n this.classes = {};\n this.keyframes = {};\n this.options = _extends({}, options, {\n sheet: this,\n parent: this,\n classes: this.classes,\n keyframes: this.keyframes\n });\n\n if (options.Renderer) {\n this.renderer = new options.Renderer(this);\n }\n\n this.rules = new RuleList(this.options);\n\n for (var name in styles) {\n this.rules.add(name, styles[name]);\n }\n\n this.rules.process();\n }\n /**\n * Attach renderable to the render tree.\n */\n\n\n var _proto = StyleSheet.prototype;\n\n _proto.attach = function attach() {\n if (this.attached) return this;\n if (this.renderer) this.renderer.attach();\n this.attached = true; // Order is important, because we can't use insertRule API if style element is not attached.\n\n if (!this.deployed) this.deploy();\n return this;\n }\n /**\n * Remove renderable from render tree.\n */\n ;\n\n _proto.detach = function detach() {\n if (!this.attached) return this;\n if (this.renderer) this.renderer.detach();\n this.attached = false;\n return this;\n }\n /**\n * Add a rule to the current stylesheet.\n * Will insert a rule also after the stylesheet has been rendered first time.\n */\n ;\n\n _proto.addRule = function addRule(name, decl, options) {\n var queue = this.queue; // Plugins can create rules.\n // In order to preserve the right order, we need to queue all `.addRule` calls,\n // which happen after the first `rules.add()` call.\n\n if (this.attached && !queue) this.queue = [];\n var rule = this.rules.add(name, decl, options);\n if (!rule) return null;\n this.options.jss.plugins.onProcessRule(rule);\n\n if (this.attached) {\n if (!this.deployed) return rule; // Don't insert rule directly if there is no stringified version yet.\n // It will be inserted all together when .attach is called.\n\n if (queue) queue.push(rule);else {\n this.insertRule(rule);\n\n if (this.queue) {\n this.queue.forEach(this.insertRule, this);\n this.queue = undefined;\n }\n }\n return rule;\n } // We can't add rules to a detached style node.\n // We will redeploy the sheet once user will attach it.\n\n\n this.deployed = false;\n return rule;\n }\n /**\n * Insert rule into the StyleSheet\n */\n ;\n\n _proto.insertRule = function insertRule(rule) {\n if (this.renderer) {\n this.renderer.insertRule(rule);\n }\n }\n /**\n * Create and add rules.\n * Will render also after Style Sheet was rendered the first time.\n */\n ;\n\n _proto.addRules = function addRules(styles, options) {\n var added = [];\n\n for (var name in styles) {\n var rule = this.addRule(name, styles[name], options);\n if (rule) added.push(rule);\n }\n\n return added;\n }\n /**\n * Get a rule by name.\n */\n ;\n\n _proto.getRule = function getRule(name) {\n return this.rules.get(name);\n }\n /**\n * Delete a rule by name.\n * Returns `true`: if rule has been deleted from the DOM.\n */\n ;\n\n _proto.deleteRule = function deleteRule(name) {\n var rule = _typeof(name) === 'object' ? name : this.rules.get(name);\n if (!rule) return false;\n this.rules.remove(rule);\n\n if (this.attached && rule.renderable && this.renderer) {\n return this.renderer.deleteRule(rule.renderable);\n }\n\n return true;\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.rules.indexOf(rule);\n }\n /**\n * Deploy pure CSS string to a renderable.\n */\n ;\n\n _proto.deploy = function deploy() {\n if (this.renderer) this.renderer.deploy();\n this.deployed = true;\n return this;\n }\n /**\n * Update the function values with a new data.\n */\n ;\n\n _proto.update = function update() {\n var _this$rules;\n\n (_this$rules = this.rules).update.apply(_this$rules, arguments);\n\n return this;\n }\n /**\n * Updates a single rule.\n */\n ;\n\n _proto.updateOne = function updateOne(rule, data, options) {\n this.rules.updateOne(rule, data, options);\n return this;\n }\n /**\n * Convert rules to a CSS string.\n */\n ;\n\n _proto.toString = function toString(options) {\n return this.rules.toString(options);\n };\n\n return StyleSheet;\n}();\n\nvar PluginsRegistry = /*#__PURE__*/function () {\n function PluginsRegistry() {\n this.plugins = {\n internal: [],\n external: []\n };\n this.registry = void 0;\n }\n\n var _proto = PluginsRegistry.prototype;\n /**\n * Call `onCreateRule` hooks and return an object if returned by a hook.\n */\n\n _proto.onCreateRule = function onCreateRule(name, decl, options) {\n for (var i = 0; i < this.registry.onCreateRule.length; i++) {\n var rule = this.registry.onCreateRule[i](name, decl, options);\n if (rule) return rule;\n }\n\n return null;\n }\n /**\n * Call `onProcessRule` hooks.\n */\n ;\n\n _proto.onProcessRule = function onProcessRule(rule) {\n if (rule.isProcessed) return;\n var sheet = rule.options.sheet;\n\n for (var i = 0; i < this.registry.onProcessRule.length; i++) {\n this.registry.onProcessRule[i](rule, sheet);\n }\n\n if (rule.style) this.onProcessStyle(rule.style, rule, sheet);\n rule.isProcessed = true;\n }\n /**\n * Call `onProcessStyle` hooks.\n */\n ;\n\n _proto.onProcessStyle = function onProcessStyle(style, rule, sheet) {\n for (var i = 0; i < this.registry.onProcessStyle.length; i++) {\n // $FlowFixMe\n rule.style = this.registry.onProcessStyle[i](rule.style, rule, sheet);\n }\n }\n /**\n * Call `onProcessSheet` hooks.\n */\n ;\n\n _proto.onProcessSheet = function onProcessSheet(sheet) {\n for (var i = 0; i < this.registry.onProcessSheet.length; i++) {\n this.registry.onProcessSheet[i](sheet);\n }\n }\n /**\n * Call `onUpdate` hooks.\n */\n ;\n\n _proto.onUpdate = function onUpdate(data, rule, sheet, options) {\n for (var i = 0; i < this.registry.onUpdate.length; i++) {\n this.registry.onUpdate[i](data, rule, sheet, options);\n }\n }\n /**\n * Call `onChangeValue` hooks.\n */\n ;\n\n _proto.onChangeValue = function onChangeValue(value, prop, rule) {\n var processedValue = value;\n\n for (var i = 0; i < this.registry.onChangeValue.length; i++) {\n processedValue = this.registry.onChangeValue[i](processedValue, prop, rule);\n }\n\n return processedValue;\n }\n /**\n * Register a plugin.\n */\n ;\n\n _proto.use = function use(newPlugin, options) {\n if (options === void 0) {\n options = {\n queue: 'external'\n };\n }\n\n var plugins = this.plugins[options.queue]; // Avoids applying same plugin twice, at least based on ref.\n\n if (plugins.indexOf(newPlugin) !== -1) {\n return;\n }\n\n plugins.push(newPlugin);\n this.registry = [].concat(this.plugins.external, this.plugins.internal).reduce(function (registry, plugin) {\n for (var name in plugin) {\n if (name in registry) {\n registry[name].push(plugin[name]);\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Unknown hook \\\"\" + name + \"\\\".\") : void 0;\n }\n }\n\n return registry;\n }, {\n onCreateRule: [],\n onProcessRule: [],\n onProcessStyle: [],\n onProcessSheet: [],\n onChangeValue: [],\n onUpdate: []\n });\n };\n\n return PluginsRegistry;\n}();\n/**\n * Sheets registry to access them all at one place.\n */\n\n\nvar SheetsRegistry = /*#__PURE__*/function () {\n function SheetsRegistry() {\n this.registry = [];\n }\n\n var _proto = SheetsRegistry.prototype;\n /**\n * Register a Style Sheet.\n */\n\n _proto.add = function add(sheet) {\n var registry = this.registry;\n var index = sheet.options.index;\n if (registry.indexOf(sheet) !== -1) return;\n\n if (registry.length === 0 || index >= this.index) {\n registry.push(sheet);\n return;\n } // Find a position.\n\n\n for (var i = 0; i < registry.length; i++) {\n if (registry[i].options.index > index) {\n registry.splice(i, 0, sheet);\n return;\n }\n }\n }\n /**\n * Reset the registry.\n */\n ;\n\n _proto.reset = function reset() {\n this.registry = [];\n }\n /**\n * Remove a Style Sheet.\n */\n ;\n\n _proto.remove = function remove(sheet) {\n var index = this.registry.indexOf(sheet);\n this.registry.splice(index, 1);\n }\n /**\n * Convert all attached sheets to a CSS string.\n */\n ;\n\n _proto.toString = function toString(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n attached = _ref.attached,\n options = _objectWithoutPropertiesLoose(_ref, [\"attached\"]);\n\n var css = '';\n\n for (var i = 0; i < this.registry.length; i++) {\n var sheet = this.registry[i];\n\n if (attached != null && sheet.attached !== attached) {\n continue;\n }\n\n if (css) css += '\\n';\n css += sheet.toString(options);\n }\n\n return css;\n };\n\n _createClass(SheetsRegistry, [{\n key: \"index\",\n\n /**\n * Current highest index number.\n */\n get: function get() {\n return this.registry.length === 0 ? 0 : this.registry[this.registry.length - 1].options.index;\n }\n }]);\n\n return SheetsRegistry;\n}();\n/**\n * This is a global sheets registry. Only DomRenderer will add sheets to it.\n * On the server one should use an own SheetsRegistry instance and add the\n * sheets to it, because you need to make sure to create a new registry for\n * each request in order to not leak sheets across requests.\n */\n\n\nvar sheets = new SheetsRegistry();\n/* eslint-disable */\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\n\nvar globalThis = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();\nvar ns = '2f1acc6c3a606b082e5eef5e54414ffb';\nif (globalThis[ns] == null) globalThis[ns] = 0; // Bundle may contain multiple JSS versions at the same time. In order to identify\n// the current version with just one short number and use it for classes generation\n// we use a counter. Also it is more accurate, because user can manually reevaluate\n// the module.\n\nvar moduleId = globalThis[ns]++;\nvar maxRules = 1e10;\n/**\n * Returns a function which generates unique class names based on counters.\n * When new generator function is created, rule counter is reseted.\n * We need to reset the rule counter for SSR for each request.\n */\n\nvar createGenerateId = function createGenerateId(options) {\n if (options === void 0) {\n options = {};\n }\n\n var ruleCounter = 0;\n return function (rule, sheet) {\n ruleCounter += 1;\n\n if (ruleCounter > maxRules) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] You might have a memory leak. Rule counter is at \" + ruleCounter + \".\") : void 0;\n }\n\n var jssId = '';\n var prefix = '';\n\n if (sheet) {\n if (sheet.options.classNamePrefix) {\n prefix = sheet.options.classNamePrefix;\n }\n\n if (sheet.options.jss.id != null) {\n jssId = String(sheet.options.jss.id);\n }\n }\n\n if (options.minify) {\n // Using \"c\" because a number can't be the first char in a class name.\n return \"\" + (prefix || 'c') + moduleId + jssId + ruleCounter;\n }\n\n return prefix + rule.key + \"-\" + moduleId + (jssId ? \"-\" + jssId : '') + \"-\" + ruleCounter;\n };\n};\n/**\n * Cache the value from the first time a function is called.\n */\n\n\nvar memoize = function memoize(fn) {\n var value;\n return function () {\n if (!value) value = fn();\n return value;\n };\n};\n/**\n * Get a style property value.\n */\n\n\nfunction getPropertyValue(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n return cssRule.attributeStyleMap.get(prop);\n }\n\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}\n/**\n * Set a style property.\n */\n\n\nfunction setProperty(cssRule, prop, value) {\n try {\n var cssValue = value;\n\n if (Array.isArray(value)) {\n cssValue = toCssValue(value, true);\n\n if (value[value.length - 1] === '!important') {\n cssRule.style.setProperty(prop, cssValue, 'important');\n return true;\n }\n } // Support CSSTOM.\n\n\n if (cssRule.attributeStyleMap) {\n cssRule.attributeStyleMap.set(prop, cssValue);\n } else {\n cssRule.style.setProperty(prop, cssValue);\n }\n } catch (err) {\n // IE may throw if property is unknown.\n return false;\n }\n\n return true;\n}\n/**\n * Remove a style property.\n */\n\n\nfunction removeProperty(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n cssRule.attributeStyleMap[\"delete\"](prop);\n } else {\n cssRule.style.removeProperty(prop);\n }\n } catch (err) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] DOMException \\\"\" + err.message + \"\\\" was thrown. Tried to remove property \\\"\" + prop + \"\\\".\") : void 0;\n }\n}\n/**\n * Set the selector.\n */\n\n\nfunction setSelector(cssRule, selectorText) {\n cssRule.selectorText = selectorText; // Return false if setter was not successful.\n // Currently works in chrome only.\n\n return cssRule.selectorText === selectorText;\n}\n/**\n * Gets the `head` element upon the first call and caches it.\n * We assume it can't be null.\n */\n\n\nvar getHead = memoize(function () {\n return document.querySelector('head');\n});\n/**\n * Find attached sheet with an index higher than the passed one.\n */\n\nfunction findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n\n return null;\n}\n/**\n * Find attached sheet with the highest index.\n */\n\n\nfunction findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n\n return null;\n}\n/**\n * Find a comment with \"jss\" inside.\n */\n\n\nfunction findCommentNode(text) {\n var head = getHead();\n\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n\n return null;\n}\n/**\n * Find a node before which we can insert the sheet.\n */\n\n\nfunction findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : void 0;\n }\n\n return false;\n}\n/**\n * Insert style element into the DOM.\n */\n\n\nfunction insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else process.env.NODE_ENV !== \"production\" ? warning(false, '[JSS] Insertion point is not in the DOM.') : void 0;\n return;\n }\n\n getHead().appendChild(style);\n}\n/**\n * Read jss nonce setting from the page if the user has set it.\n */\n\n\nvar getNonce = memoize(function () {\n var node = document.querySelector('meta[property=\"csp-nonce\"]');\n return node ? node.getAttribute('content') : null;\n});\n\nvar _insertRule = function insertRule(container, rule, index) {\n var maxIndex = container.cssRules.length; // In case previous insertion fails, passed index might be wrong\n\n if (index === undefined || index > maxIndex) {\n // eslint-disable-next-line no-param-reassign\n index = maxIndex;\n }\n\n try {\n if ('insertRule' in container) {\n var c = container;\n c.insertRule(rule, index);\n } // Keyframes rule.\n else if ('appendRule' in container) {\n var _c = container;\n\n _c.appendRule(rule);\n }\n } catch (err) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] \" + err.message) : void 0;\n return false;\n }\n\n return container.cssRules[index];\n};\n\nvar createStyle = function createStyle() {\n var el = document.createElement('style'); // Without it, IE will have a broken source order specificity if we\n // insert rules after we insert the style tag.\n // It seems to kick-off the source order specificity algorithm.\n\n el.textContent = '\\n';\n return el;\n};\n\nvar DomRenderer = /*#__PURE__*/function () {\n // HTMLStyleElement needs fixing https://github.com/facebook/flow/issues/2696\n function DomRenderer(sheet) {\n this.getPropertyValue = getPropertyValue;\n this.setProperty = setProperty;\n this.removeProperty = removeProperty;\n this.setSelector = setSelector;\n this.element = void 0;\n this.sheet = void 0;\n this.hasInsertedRules = false; // There is no sheet when the renderer is used from a standalone StyleRule.\n\n if (sheet) sheets.add(sheet);\n this.sheet = sheet;\n\n var _ref = this.sheet ? this.sheet.options : {},\n media = _ref.media,\n meta = _ref.meta,\n element = _ref.element;\n\n this.element = element || createStyle();\n this.element.setAttribute('data-jss', '');\n if (media) this.element.setAttribute('media', media);\n if (meta) this.element.setAttribute('data-meta', meta);\n var nonce = getNonce();\n if (nonce) this.element.setAttribute('nonce', nonce);\n }\n /**\n * Insert style element into render tree.\n */\n\n\n var _proto = DomRenderer.prototype;\n\n _proto.attach = function attach() {\n // In the case the element node is external and it is already in the DOM.\n if (this.element.parentNode || !this.sheet) return;\n insertStyle(this.element, this.sheet.options); // When rules are inserted using `insertRule` API, after `sheet.detach().attach()`\n // most browsers create a new CSSStyleSheet, except of all IEs.\n\n var deployed = Boolean(this.sheet && this.sheet.deployed);\n\n if (this.hasInsertedRules && deployed) {\n this.hasInsertedRules = false;\n this.deploy();\n }\n }\n /**\n * Remove style element from render tree.\n */\n ;\n\n _proto.detach = function detach() {\n var parentNode = this.element.parentNode;\n if (parentNode) parentNode.removeChild(this.element);\n }\n /**\n * Inject CSS string into element.\n */\n ;\n\n _proto.deploy = function deploy() {\n var sheet = this.sheet;\n if (!sheet) return;\n\n if (sheet.options.link) {\n this.insertRules(sheet.rules);\n return;\n }\n\n this.element.textContent = \"\\n\" + sheet.toString() + \"\\n\";\n }\n /**\n * Insert RuleList into an element.\n */\n ;\n\n _proto.insertRules = function insertRules(rules, nativeParent) {\n for (var i = 0; i < rules.index.length; i++) {\n this.insertRule(rules.index[i], i, nativeParent);\n }\n }\n /**\n * Insert a rule into element.\n */\n ;\n\n _proto.insertRule = function insertRule(rule, index, nativeParent) {\n if (nativeParent === void 0) {\n nativeParent = this.element.sheet;\n }\n\n if (rule.rules) {\n var parent = rule;\n var latestNativeParent = nativeParent;\n\n if (rule.type === 'conditional' || rule.type === 'keyframes') {\n // We need to render the container without children first.\n latestNativeParent = _insertRule(nativeParent, parent.toString({\n children: false\n }), index);\n\n if (latestNativeParent === false) {\n return false;\n }\n }\n\n this.insertRules(parent.rules, latestNativeParent);\n return latestNativeParent;\n } // IE keeps the CSSStyleSheet after style node has been reattached,\n // so we need to check if the `renderable` reference the right style sheet and not\n // rerender those rules.\n\n\n if (rule.renderable && rule.renderable.parentStyleSheet === this.element.sheet) {\n return rule.renderable;\n }\n\n var ruleStr = rule.toString();\n if (!ruleStr) return false;\n\n var nativeRule = _insertRule(nativeParent, ruleStr, index);\n\n if (nativeRule === false) {\n return false;\n }\n\n this.hasInsertedRules = true;\n rule.renderable = nativeRule;\n return nativeRule;\n }\n /**\n * Delete a rule.\n */\n ;\n\n _proto.deleteRule = function deleteRule(cssRule) {\n var sheet = this.element.sheet;\n var index = this.indexOf(cssRule);\n if (index === -1) return false;\n sheet.deleteRule(index);\n return true;\n }\n /**\n * Get index of a CSS Rule.\n */\n ;\n\n _proto.indexOf = function indexOf(cssRule) {\n var cssRules = this.element.sheet.cssRules;\n\n for (var index = 0; index < cssRules.length; index++) {\n if (cssRule === cssRules[index]) return index;\n }\n\n return -1;\n }\n /**\n * Generate a new CSS rule and replace the existing one.\n *\n * Only used for some old browsers because they can't set a selector.\n */\n ;\n\n _proto.replaceRule = function replaceRule(cssRule, rule) {\n var index = this.indexOf(cssRule);\n if (index === -1) return false;\n this.element.sheet.deleteRule(index);\n return this.insertRule(rule, index);\n }\n /**\n * Get all rules elements.\n */\n ;\n\n _proto.getRules = function getRules() {\n return this.element.sheet.cssRules;\n };\n\n return DomRenderer;\n}();\n\nvar instanceCounter = 0;\n\nvar Jss = /*#__PURE__*/function () {\n function Jss(options) {\n this.id = instanceCounter++;\n this.version = \"10.1.1\";\n this.plugins = new PluginsRegistry();\n this.options = {\n id: {\n minify: false\n },\n createGenerateId: createGenerateId,\n Renderer: isInBrowser ? DomRenderer : null,\n plugins: []\n };\n this.generateId = createGenerateId({\n minify: false\n });\n\n for (var i = 0; i < plugins.length; i++) {\n this.plugins.use(plugins[i], {\n queue: 'internal'\n });\n }\n\n this.setup(options);\n }\n /**\n * Prepares various options, applies plugins.\n * Should not be used twice on the same instance, because there is no plugins\n * deduplication logic.\n */\n\n\n var _proto = Jss.prototype;\n\n _proto.setup = function setup(options) {\n if (options === void 0) {\n options = {};\n }\n\n if (options.createGenerateId) {\n this.options.createGenerateId = options.createGenerateId;\n }\n\n if (options.id) {\n this.options.id = _extends({}, this.options.id, options.id);\n }\n\n if (options.createGenerateId || options.id) {\n this.generateId = this.options.createGenerateId(this.options.id);\n }\n\n if (options.insertionPoint != null) this.options.insertionPoint = options.insertionPoint;\n\n if ('Renderer' in options) {\n this.options.Renderer = options.Renderer;\n } // eslint-disable-next-line prefer-spread\n\n\n if (options.plugins) this.use.apply(this, options.plugins);\n return this;\n }\n /**\n * Create a Style Sheet.\n */\n ;\n\n _proto.createStyleSheet = function createStyleSheet(styles, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n index = _options.index;\n\n if (typeof index !== 'number') {\n index = sheets.index === 0 ? 0 : sheets.index + 1;\n }\n\n var sheet = new StyleSheet(styles, _extends({}, options, {\n jss: this,\n generateId: options.generateId || this.generateId,\n insertionPoint: this.options.insertionPoint,\n Renderer: this.options.Renderer,\n index: index\n }));\n this.plugins.onProcessSheet(sheet);\n return sheet;\n }\n /**\n * Detach the Style Sheet and remove it from the registry.\n */\n ;\n\n _proto.removeStyleSheet = function removeStyleSheet(sheet) {\n sheet.detach();\n sheets.remove(sheet);\n return this;\n }\n /**\n * Create a rule without a Style Sheet.\n * [Deprecated] will be removed in the next major version.\n */\n ;\n\n _proto.createRule = function createRule$$1(name, style, options) {\n if (style === void 0) {\n style = {};\n }\n\n if (options === void 0) {\n options = {};\n } // Enable rule without name for inline styles.\n\n\n if (_typeof(name) === 'object') {\n return this.createRule(undefined, name, style);\n }\n\n var ruleOptions = _extends({}, options, {\n name: name,\n jss: this,\n Renderer: this.options.Renderer\n });\n\n if (!ruleOptions.generateId) ruleOptions.generateId = this.generateId;\n if (!ruleOptions.classes) ruleOptions.classes = {};\n if (!ruleOptions.keyframes) ruleOptions.keyframes = {};\n var rule = createRule(name, style, ruleOptions);\n if (rule) this.plugins.onProcessRule(rule);\n return rule;\n }\n /**\n * Register plugin. Passed function will be invoked with a rule instance.\n */\n ;\n\n _proto.use = function use() {\n var _this = this;\n\n for (var _len = arguments.length, plugins$$1 = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins$$1[_key] = arguments[_key];\n }\n\n plugins$$1.forEach(function (plugin) {\n _this.plugins.use(plugin);\n });\n return this;\n };\n\n return Jss;\n}();\n/**\n * Extracts a styles object with only props that contain function values.\n */\n\n\nfunction getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n\n var type = _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}\n/**\n * SheetsManager is like a WeakMap which is designed to count StyleSheet\n * instances and attach/detach automatically.\n */\n\n\nvar SheetsManager = /*#__PURE__*/function () {\n function SheetsManager() {\n this.length = 0;\n this.sheets = new WeakMap();\n }\n\n var _proto = SheetsManager.prototype;\n\n _proto.get = function get(key) {\n var entry = this.sheets.get(key);\n return entry && entry.sheet;\n };\n\n _proto.add = function add(key, sheet) {\n if (this.sheets.has(key)) return;\n this.length++;\n this.sheets.set(key, {\n sheet: sheet,\n refs: 0\n });\n };\n\n _proto.manage = function manage(key) {\n var entry = this.sheets.get(key);\n\n if (entry) {\n if (entry.refs === 0) {\n entry.sheet.attach();\n }\n\n entry.refs++;\n return entry.sheet;\n }\n\n warning(false, \"[JSS] SheetsManager: can't find sheet to manage\");\n return undefined;\n };\n\n _proto.unmanage = function unmanage(key) {\n var entry = this.sheets.get(key);\n\n if (entry) {\n if (entry.refs > 0) {\n entry.refs--;\n if (entry.refs === 0) entry.sheet.detach();\n }\n } else {\n warning(false, \"SheetsManager: can't find sheet to unmanage\");\n }\n };\n\n _createClass(SheetsManager, [{\n key: \"size\",\n get: function get() {\n return this.length;\n }\n }]);\n\n return SheetsManager;\n}();\n/**\n * A better abstraction over CSS.\n *\n * @copyright Oleg Isonen (Slobodskoi) / Isonen 2014-present\n * @website https://github.com/cssinjs/jss\n * @license MIT\n */\n\n/**\n * Export a constant indicating if this browser has CSSTOM support.\n * https://developers.google.com/web/updates/2018/03/cssom\n */\n\n\nvar hasCSSTOMSupport = typeof CSS !== 'undefined' && CSS && 'number' in CSS;\n/**\n * Creates a new instance of Jss.\n */\n\nvar create = function create(options) {\n return new Jss(options);\n};\n/**\n * A global Jss instance.\n */\n\n\nvar index = create();\nexport default index;\nexport { hasCSSTOMSupport, create, getDynamicStyles, toCssValue, createRule, SheetsRegistry, SheetsManager, RuleList, sheets, createGenerateId };","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","export default function ownerDocument(node) {\n return node && node.ownerDocument || document;\n}","export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}","var red = {\n 50: '#ffebee',\n 100: '#ffcdd2',\n 200: '#ef9a9a',\n 300: '#e57373',\n 400: '#ef5350',\n 500: '#f44336',\n 600: '#e53935',\n 700: '#d32f2f',\n 800: '#c62828',\n 900: '#b71c1c',\n A100: '#ff8a80',\n A200: '#ff5252',\n A400: '#ff1744',\n A700: '#d50000'\n};\nexport default red;","// shim for using process in browser\nvar process = module.exports = {}; // cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\n\nfunction defaultClearTimeout() {\n throw new Error('clearTimeout has not been defined');\n}\n\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n})();\n\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n } // if setTimeout wasn't available but was latter defined\n\n\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n}\n\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n } // if clearTimeout wasn't available but was latter defined\n\n\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n}\n\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n\n draining = false;\n\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n var len = queue.length;\n\n while (len) {\n currentQueue = queue;\n queue = [];\n\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n\n queueIndex = -1;\n len = queue.length;\n }\n\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n\n queue.push(new Item(fun, args));\n\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n}; // v8 likes predictible objects\n\n\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\n\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\n\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\n\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) {\n return [];\n};\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () {\n return '/';\n};\n\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\n\nprocess.umask = function () {\n return 0;\n};","import arrayWithoutHoles from \"./arrayWithoutHoles\";\nimport iterableToArray from \"./iterableToArray\";\nimport nonIterableSpread from \"./nonIterableSpread\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();\n}","export default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}","import _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\"; // Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves\n// to learn the context in which each easing should be used.\n\nexport var easing = {\n // This is the most common easing curve.\n easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',\n // Objects enter the screen at full velocity from off-screen and\n // slowly decelerate to a resting point.\n easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',\n // Objects leave the screen at full velocity. They do not decelerate when off-screen.\n easeIn: 'cubic-bezier(0.4, 0, 1, 1)',\n // The sharp curve is used by objects that may return to the screen at any time.\n sharp: 'cubic-bezier(0.4, 0, 0.6, 1)'\n}; // Follow https://material.io/guidelines/motion/duration-easing.html#duration-easing-common-durations\n// to learn when use what timing\n\nexport var duration = {\n shortest: 150,\n shorter: 200,\n \"short\": 250,\n // most basic recommended timing\n standard: 300,\n // this is to be used in complex animations\n complex: 375,\n // recommended when something is entering screen\n enteringScreen: 225,\n // recommended when something is leaving screen\n leavingScreen: 195\n};\n\nfunction formatMs(milliseconds) {\n return \"\".concat(Math.round(milliseconds), \"ms\");\n}\n/**\n * @param {string|Array} props\n * @param {object} param\n * @param {string} param.prop\n * @param {number} param.duration\n * @param {string} param.easing\n * @param {number} param.delay\n */\n\n\nexport default {\n easing: easing,\n duration: duration,\n create: function create() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['all'];\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var _options$duration = options.duration,\n durationOption = _options$duration === void 0 ? duration.standard : _options$duration,\n _options$easing = options.easing,\n easingOption = _options$easing === void 0 ? easing.easeInOut : _options$easing,\n _options$delay = options.delay,\n delay = _options$delay === void 0 ? 0 : _options$delay,\n other = _objectWithoutProperties(options, [\"duration\", \"easing\", \"delay\"]);\n\n if (process.env.NODE_ENV !== 'production') {\n var isString = function isString(value) {\n return typeof value === 'string';\n };\n\n var isNumber = function isNumber(value) {\n return !isNaN(parseFloat(value));\n };\n\n if (!isString(props) && !Array.isArray(props)) {\n console.error('Material-UI: argument \"props\" must be a string or Array.');\n }\n\n if (!isNumber(durationOption) && !isString(durationOption)) {\n console.error(\"Material-UI: argument \\\"duration\\\" must be a number or a string but found \".concat(durationOption, \".\"));\n }\n\n if (!isString(easingOption)) {\n console.error('Material-UI: argument \"easing\" must be a string.');\n }\n\n if (!isNumber(delay) && !isString(delay)) {\n console.error('Material-UI: argument \"delay\" must be a number or a string.');\n }\n\n if (Object.keys(other).length !== 0) {\n console.error(\"Material-UI: unrecognized argument(s) [\".concat(Object.keys(other).join(','), \"]\"));\n }\n }\n\n return (Array.isArray(props) ? props : [props]).map(function (animatedProp) {\n return \"\".concat(animatedProp, \" \").concat(typeof durationOption === 'string' ? durationOption : formatMs(durationOption), \" \").concat(easingOption, \" \").concat(typeof delay === 'string' ? delay : formatMs(delay));\n }).join(',');\n },\n getAutoHeightDuration: function getAutoHeightDuration(height) {\n if (!height) {\n return 0;\n }\n\n var constant = height / 36; // https://www.wolframalpha.com/input/?i=(4+%2B+15+*+(x+%2F+36+)+**+0.25+%2B+(x+%2F+36)+%2F+5)+*+10\n\n return Math.round((4 + 15 * Math.pow(constant, 0.25) + constant / 5) * 10);\n }\n};","/**\n * Copyright (c) 2016, Lee Byron\n * All rights reserved.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @ignore\n */\n\n/**\n * [Iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterator)\n * is a *protocol* which describes a standard way to produce a sequence of\n * values, typically the values of the Iterable represented by this Iterator.\n *\n * While described by the [ES2015 version of JavaScript](http://www.ecma-international.org/ecma-262/6.0/#sec-iterator-interface)\n * it can be utilized by any version of JavaScript.\n *\n * @external Iterator\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterator|MDN Iteration protocols}\n */\n\n/**\n * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable)\n * is a *protocol* which when implemented allows a JavaScript object to define\n * their iteration behavior, such as what values are looped over in a\n * [`for...of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of)\n * loop or `iterall`'s `forEach` function. Many [built-in types](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#Builtin_iterables)\n * implement the Iterable protocol, including `Array` and `Map`.\n *\n * While described by the [ES2015 version of JavaScript](http://www.ecma-international.org/ecma-262/6.0/#sec-iterable-interface)\n * it can be utilized by any version of JavaScript.\n *\n * @external Iterable\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable|MDN Iteration protocols}\n */\n// In ES2015 (or a polyfilled) environment, this will be Symbol.iterator\nvar SYMBOL_ITERATOR = typeof Symbol === 'function' && Symbol.iterator;\n/**\n * A property name to be used as the name of an Iterable's method responsible\n * for producing an Iterator, referred to as `@@iterator`. Typically represents\n * the value `Symbol.iterator` but falls back to the string `\"@@iterator\"` when\n * `Symbol.iterator` is not defined.\n *\n * Use `$$iterator` for defining new Iterables instead of `Symbol.iterator`,\n * but do not use it for accessing existing Iterables, instead use\n * {@link getIterator} or {@link isIterable}.\n *\n * @example\n *\n * var $$iterator = require('iterall').$$iterator\n *\n * function Counter (to) {\n * this.to = to\n * }\n *\n * Counter.prototype[$$iterator] = function () {\n * return {\n * to: this.to,\n * num: 0,\n * next () {\n * if (this.num >= this.to) {\n * return { value: undefined, done: true }\n * }\n * return { value: this.num++, done: false }\n * }\n * }\n * }\n *\n * var counter = new Counter(3)\n * for (var number of counter) {\n * console.log(number) // 0 ... 1 ... 2\n * }\n *\n * @type {Symbol|string}\n */\n\nvar $$iterator = SYMBOL_ITERATOR || '@@iterator';\nexports.$$iterator = $$iterator;\n/**\n * Returns true if the provided object implements the Iterator protocol via\n * either implementing a `Symbol.iterator` or `\"@@iterator\"` method.\n *\n * @example\n *\n * var isIterable = require('iterall').isIterable\n * isIterable([ 1, 2, 3 ]) // true\n * isIterable('ABC') // true\n * isIterable({ length: 1, 0: 'Alpha' }) // false\n * isIterable({ key: 'value' }) // false\n * isIterable(new Map()) // true\n *\n * @param obj\n * A value which might implement the Iterable protocol.\n * @return {boolean} true if Iterable.\n */\n\nfunction isIterable(obj) {\n return !!getIteratorMethod(obj);\n}\n\nexports.isIterable = isIterable;\n/**\n * Returns true if the provided object implements the Array-like protocol via\n * defining a positive-integer `length` property.\n *\n * @example\n *\n * var isArrayLike = require('iterall').isArrayLike\n * isArrayLike([ 1, 2, 3 ]) // true\n * isArrayLike('ABC') // true\n * isArrayLike({ length: 1, 0: 'Alpha' }) // true\n * isArrayLike({ key: 'value' }) // false\n * isArrayLike(new Map()) // false\n *\n * @param obj\n * A value which might implement the Array-like protocol.\n * @return {boolean} true if Array-like.\n */\n\nfunction isArrayLike(obj) {\n var length = obj != null && obj.length;\n return typeof length === 'number' && length >= 0 && length % 1 === 0;\n}\n\nexports.isArrayLike = isArrayLike;\n/**\n * Returns true if the provided object is an Object (i.e. not a string literal)\n * and is either Iterable or Array-like.\n *\n * This may be used in place of [Array.isArray()][isArray] to determine if an\n * object should be iterated-over. It always excludes string literals and\n * includes Arrays (regardless of if it is Iterable). It also includes other\n * Array-like objects such as NodeList, TypedArray, and Buffer.\n *\n * @example\n *\n * var isCollection = require('iterall').isCollection\n * isCollection([ 1, 2, 3 ]) // true\n * isCollection('ABC') // false\n * isCollection({ length: 1, 0: 'Alpha' }) // true\n * isCollection({ key: 'value' }) // false\n * isCollection(new Map()) // true\n *\n * @example\n *\n * var forEach = require('iterall').forEach\n * if (isCollection(obj)) {\n * forEach(obj, function (value) {\n * console.log(value)\n * })\n * }\n *\n * @param obj\n * An Object value which might implement the Iterable or Array-like protocols.\n * @return {boolean} true if Iterable or Array-like Object.\n */\n\nfunction isCollection(obj) {\n return Object(obj) === obj && (isArrayLike(obj) || isIterable(obj));\n}\n\nexports.isCollection = isCollection;\n/**\n * If the provided object implements the Iterator protocol, its Iterator object\n * is returned. Otherwise returns undefined.\n *\n * @example\n *\n * var getIterator = require('iterall').getIterator\n * var iterator = getIterator([ 1, 2, 3 ])\n * iterator.next() // { value: 1, done: false }\n * iterator.next() // { value: 2, done: false }\n * iterator.next() // { value: 3, done: false }\n * iterator.next() // { value: undefined, done: true }\n *\n * @template T the type of each iterated value\n * @param {Iterable} iterable\n * An Iterable object which is the source of an Iterator.\n * @return {Iterator} new Iterator instance.\n */\n\nfunction getIterator(iterable) {\n var method = getIteratorMethod(iterable);\n\n if (method) {\n return method.call(iterable);\n }\n}\n\nexports.getIterator = getIterator;\n/**\n * If the provided object implements the Iterator protocol, the method\n * responsible for producing its Iterator object is returned.\n *\n * This is used in rare cases for performance tuning. This method must be called\n * with obj as the contextual this-argument.\n *\n * @example\n *\n * var getIteratorMethod = require('iterall').getIteratorMethod\n * var myArray = [ 1, 2, 3 ]\n * var method = getIteratorMethod(myArray)\n * if (method) {\n * var iterator = method.call(myArray)\n * }\n *\n * @template T the type of each iterated value\n * @param {Iterable} iterable\n * An Iterable object which defines an `@@iterator` method.\n * @return {function(): Iterator} `@@iterator` method.\n */\n\nfunction getIteratorMethod(iterable) {\n if (iterable != null) {\n var method = SYMBOL_ITERATOR && iterable[SYMBOL_ITERATOR] || iterable['@@iterator'];\n\n if (typeof method === 'function') {\n return method;\n }\n }\n}\n\nexports.getIteratorMethod = getIteratorMethod;\n/**\n * Similar to {@link getIterator}, this method returns a new Iterator given an\n * Iterable. However it will also create an Iterator for a non-Iterable\n * Array-like collection, such as Array in a non-ES2015 environment.\n *\n * `createIterator` is complimentary to `forEach`, but allows a \"pull\"-based\n * iteration as opposed to `forEach`'s \"push\"-based iteration.\n *\n * `createIterator` produces an Iterator for Array-likes with the same behavior\n * as ArrayIteratorPrototype described in the ECMAScript specification, and\n * does *not* skip over \"holes\".\n *\n * @example\n *\n * var createIterator = require('iterall').createIterator\n *\n * var myArraylike = { length: 3, 0: 'Alpha', 1: 'Bravo', 2: 'Charlie' }\n * var iterator = createIterator(myArraylike)\n * iterator.next() // { value: 'Alpha', done: false }\n * iterator.next() // { value: 'Bravo', done: false }\n * iterator.next() // { value: 'Charlie', done: false }\n * iterator.next() // { value: undefined, done: true }\n *\n * @template T the type of each iterated value\n * @param {Iterable|{ length: number }} collection\n * An Iterable or Array-like object to produce an Iterator.\n * @return {Iterator} new Iterator instance.\n */\n\nfunction createIterator(collection) {\n if (collection != null) {\n var iterator = getIterator(collection);\n\n if (iterator) {\n return iterator;\n }\n\n if (isArrayLike(collection)) {\n return new ArrayLikeIterator(collection);\n }\n }\n}\n\nexports.createIterator = createIterator; // When the object provided to `createIterator` is not Iterable but is\n// Array-like, this simple Iterator is created.\n\nfunction ArrayLikeIterator(obj) {\n this._o = obj;\n this._i = 0;\n} // Note: all Iterators are themselves Iterable.\n\n\nArrayLikeIterator.prototype[$$iterator] = function () {\n return this;\n}; // A simple state-machine determines the IteratorResult returned, yielding\n// each value in the Array-like object in order of their indicies.\n\n\nArrayLikeIterator.prototype.next = function () {\n if (this._o === void 0 || this._i >= this._o.length) {\n this._o = void 0;\n return {\n value: void 0,\n done: true\n };\n }\n\n return {\n value: this._o[this._i++],\n done: false\n };\n};\n/**\n * Given an object which either implements the Iterable protocol or is\n * Array-like, iterate over it, calling the `callback` at each iteration.\n *\n * Use `forEach` where you would expect to use a `for ... of` loop in ES6.\n * However `forEach` adheres to the behavior of [Array#forEach][] described in\n * the ECMAScript specification, skipping over \"holes\" in Array-likes. It will\n * also delegate to a `forEach` method on `collection` if one is defined,\n * ensuring native performance for `Arrays`.\n *\n * Similar to [Array#forEach][], the `callback` function accepts three\n * arguments, and is provided with `thisArg` as the calling context.\n *\n * Note: providing an infinite Iterator to forEach will produce an error.\n *\n * [Array#forEach]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach\n *\n * @example\n *\n * var forEach = require('iterall').forEach\n *\n * forEach(myIterable, function (value, index, iterable) {\n * console.log(value, index, iterable === myIterable)\n * })\n *\n * @example\n *\n * // ES6:\n * for (let value of myIterable) {\n * console.log(value)\n * }\n *\n * // Any JavaScript environment:\n * forEach(myIterable, function (value) {\n * console.log(value)\n * })\n *\n * @template T the type of each iterated value\n * @param {Iterable|{ length: number }} collection\n * The Iterable or array to iterate over.\n * @param {function(T, number, object)} callback\n * Function to execute for each iteration, taking up to three arguments\n * @param [thisArg]\n * Optional. Value to use as `this` when executing `callback`.\n */\n\n\nfunction forEach(collection, callback, thisArg) {\n if (collection != null) {\n if (typeof collection.forEach === 'function') {\n return collection.forEach(callback, thisArg);\n }\n\n var i = 0;\n var iterator = getIterator(collection);\n\n if (iterator) {\n var step;\n\n while (!(step = iterator.next()).done) {\n callback.call(thisArg, step.value, i++, collection); // Infinite Iterators could cause forEach to run forever.\n // After a very large number of iterations, produce an error.\n\n /* istanbul ignore if */\n\n if (i > 9999999) {\n throw new TypeError('Near-infinite iteration.');\n }\n }\n } else if (isArrayLike(collection)) {\n for (; i < collection.length; i++) {\n if (collection.hasOwnProperty(i)) {\n callback.call(thisArg, collection[i], i, collection);\n }\n }\n }\n }\n}\n\nexports.forEach = forEach; /////////////////////////////////////////////////////\n// //\n// ASYNC ITERATORS //\n// //\n/////////////////////////////////////////////////////\n\n/**\n * [AsyncIterable](https://tc39.github.io/proposal-async-iteration/#sec-asynciterable-interface)\n * is a *protocol* which when implemented allows a JavaScript object to define\n * an asynchronous iteration behavior, such as what values are looped over in\n * a [`for-await-of`](https://tc39.github.io/proposal-async-iteration/#sec-for-in-and-for-of-statements)\n * loop or `iterall`'s {@link forAwaitEach} function.\n *\n * While described as a proposed addition to the [ES2017 version of JavaScript](https://tc39.github.io/proposal-async-iteration/)\n * it can be utilized by any version of JavaScript.\n *\n * @external AsyncIterable\n * @see {@link https://tc39.github.io/proposal-async-iteration/#sec-asynciterable-interface|Async Iteration Proposal}\n * @template T The type of each iterated value\n * @property {function (): AsyncIterator} Symbol.asyncIterator\n * A method which produces an AsyncIterator for this AsyncIterable.\n */\n\n/**\n * [AsyncIterator](https://tc39.github.io/proposal-async-iteration/#sec-asynciterator-interface)\n * is a *protocol* which describes a standard way to produce and consume an\n * asynchronous sequence of values, typically the values of the\n * {@link AsyncIterable} represented by this {@link AsyncIterator}.\n *\n * AsyncIterator is similar to Observable or Stream. Like an {@link Iterator} it\n * also as a `next()` method, however instead of an IteratorResult,\n * calling this method returns a {@link Promise} for a IteratorResult.\n *\n * While described as a proposed addition to the [ES2017 version of JavaScript](https://tc39.github.io/proposal-async-iteration/)\n * it can be utilized by any version of JavaScript.\n *\n * @external AsyncIterator\n * @see {@link https://tc39.github.io/proposal-async-iteration/#sec-asynciterator-interface|Async Iteration Proposal}\n */\n// In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator\n\nvar SYMBOL_ASYNC_ITERATOR = typeof Symbol === 'function' && Symbol.asyncIterator;\n/**\n * A property name to be used as the name of an AsyncIterable's method\n * responsible for producing an Iterator, referred to as `@@asyncIterator`.\n * Typically represents the value `Symbol.asyncIterator` but falls back to the\n * string `\"@@asyncIterator\"` when `Symbol.asyncIterator` is not defined.\n *\n * Use `$$asyncIterator` for defining new AsyncIterables instead of\n * `Symbol.asyncIterator`, but do not use it for accessing existing Iterables,\n * instead use {@link getAsyncIterator} or {@link isAsyncIterable}.\n *\n * @example\n *\n * var $$asyncIterator = require('iterall').$$asyncIterator\n *\n * function Chirper (to) {\n * this.to = to\n * }\n *\n * Chirper.prototype[$$asyncIterator] = function () {\n * return {\n * to: this.to,\n * num: 0,\n * next () {\n * return new Promise(resolve => {\n * if (this.num >= this.to) {\n * resolve({ value: undefined, done: true })\n * } else {\n * setTimeout(() => {\n * resolve({ value: this.num++, done: false })\n * }, 1000)\n * }\n * })\n * }\n * }\n * }\n *\n * var chirper = new Chirper(3)\n * for await (var number of chirper) {\n * console.log(number) // 0 ...wait... 1 ...wait... 2\n * }\n *\n * @type {Symbol|string}\n */\n\nvar $$asyncIterator = SYMBOL_ASYNC_ITERATOR || '@@asyncIterator';\nexports.$$asyncIterator = $$asyncIterator;\n/**\n * Returns true if the provided object implements the AsyncIterator protocol via\n * either implementing a `Symbol.asyncIterator` or `\"@@asyncIterator\"` method.\n *\n * @example\n *\n * var isAsyncIterable = require('iterall').isAsyncIterable\n * isAsyncIterable(myStream) // true\n * isAsyncIterable('ABC') // false\n *\n * @param obj\n * A value which might implement the AsyncIterable protocol.\n * @return {boolean} true if AsyncIterable.\n */\n\nfunction isAsyncIterable(obj) {\n return !!getAsyncIteratorMethod(obj);\n}\n\nexports.isAsyncIterable = isAsyncIterable;\n/**\n * If the provided object implements the AsyncIterator protocol, its\n * AsyncIterator object is returned. Otherwise returns undefined.\n *\n * @example\n *\n * var getAsyncIterator = require('iterall').getAsyncIterator\n * var asyncIterator = getAsyncIterator(myStream)\n * asyncIterator.next().then(console.log) // { value: 1, done: false }\n * asyncIterator.next().then(console.log) // { value: 2, done: false }\n * asyncIterator.next().then(console.log) // { value: 3, done: false }\n * asyncIterator.next().then(console.log) // { value: undefined, done: true }\n *\n * @template T the type of each iterated value\n * @param {AsyncIterable} asyncIterable\n * An AsyncIterable object which is the source of an AsyncIterator.\n * @return {AsyncIterator} new AsyncIterator instance.\n */\n\nfunction getAsyncIterator(asyncIterable) {\n var method = getAsyncIteratorMethod(asyncIterable);\n\n if (method) {\n return method.call(asyncIterable);\n }\n}\n\nexports.getAsyncIterator = getAsyncIterator;\n/**\n * If the provided object implements the AsyncIterator protocol, the method\n * responsible for producing its AsyncIterator object is returned.\n *\n * This is used in rare cases for performance tuning. This method must be called\n * with obj as the contextual this-argument.\n *\n * @example\n *\n * var getAsyncIteratorMethod = require('iterall').getAsyncIteratorMethod\n * var method = getAsyncIteratorMethod(myStream)\n * if (method) {\n * var asyncIterator = method.call(myStream)\n * }\n *\n * @template T the type of each iterated value\n * @param {AsyncIterable} asyncIterable\n * An AsyncIterable object which defines an `@@asyncIterator` method.\n * @return {function(): AsyncIterator} `@@asyncIterator` method.\n */\n\nfunction getAsyncIteratorMethod(asyncIterable) {\n if (asyncIterable != null) {\n var method = SYMBOL_ASYNC_ITERATOR && asyncIterable[SYMBOL_ASYNC_ITERATOR] || asyncIterable['@@asyncIterator'];\n\n if (typeof method === 'function') {\n return method;\n }\n }\n}\n\nexports.getAsyncIteratorMethod = getAsyncIteratorMethod;\n/**\n * Similar to {@link getAsyncIterator}, this method returns a new AsyncIterator\n * given an AsyncIterable. However it will also create an AsyncIterator for a\n * non-async Iterable as well as non-Iterable Array-like collection, such as\n * Array in a pre-ES2015 environment.\n *\n * `createAsyncIterator` is complimentary to `forAwaitEach`, but allows a\n * buffering \"pull\"-based iteration as opposed to `forAwaitEach`'s\n * \"push\"-based iteration.\n *\n * `createAsyncIterator` produces an AsyncIterator for non-async Iterables as\n * described in the ECMAScript proposal [Async-from-Sync Iterator Objects](https://tc39.github.io/proposal-async-iteration/#sec-async-from-sync-iterator-objects).\n *\n * > Note: Creating `AsyncIterator`s requires the existence of `Promise`.\n * > While `Promise` has been available in modern browsers for a number of\n * > years, legacy browsers (like IE 11) may require a polyfill.\n *\n * @example\n *\n * var createAsyncIterator = require('iterall').createAsyncIterator\n *\n * var myArraylike = { length: 3, 0: 'Alpha', 1: 'Bravo', 2: 'Charlie' }\n * var iterator = createAsyncIterator(myArraylike)\n * iterator.next().then(console.log) // { value: 'Alpha', done: false }\n * iterator.next().then(console.log) // { value: 'Bravo', done: false }\n * iterator.next().then(console.log) // { value: 'Charlie', done: false }\n * iterator.next().then(console.log) // { value: undefined, done: true }\n *\n * @template T the type of each iterated value\n * @param {AsyncIterable|Iterable|{ length: number }} source\n * An AsyncIterable, Iterable, or Array-like object to produce an Iterator.\n * @return {AsyncIterator} new AsyncIterator instance.\n */\n\nfunction createAsyncIterator(source) {\n if (source != null) {\n var asyncIterator = getAsyncIterator(source);\n\n if (asyncIterator) {\n return asyncIterator;\n }\n\n var iterator = createIterator(source);\n\n if (iterator) {\n return new AsyncFromSyncIterator(iterator);\n }\n }\n}\n\nexports.createAsyncIterator = createAsyncIterator; // When the object provided to `createAsyncIterator` is not AsyncIterable but is\n// sync Iterable, this simple wrapper is created.\n\nfunction AsyncFromSyncIterator(iterator) {\n this._i = iterator;\n} // Note: all AsyncIterators are themselves AsyncIterable.\n\n\nAsyncFromSyncIterator.prototype[$$asyncIterator] = function () {\n return this;\n}; // A simple state-machine determines the IteratorResult returned, yielding\n// each value in the Array-like object in order of their indicies.\n\n\nAsyncFromSyncIterator.prototype.next = function () {\n var step = this._i.next();\n\n return Promise.resolve(step.value).then(function (value) {\n return {\n value: value,\n done: step.done\n };\n });\n};\n/**\n * Given an object which either implements the AsyncIterable protocol or is\n * Array-like, iterate over it, calling the `callback` at each iteration.\n *\n * Use `forAwaitEach` where you would expect to use a [for-await-of](https://tc39.github.io/proposal-async-iteration/#sec-for-in-and-for-of-statements) loop.\n *\n * Similar to [Array#forEach][], the `callback` function accepts three\n * arguments, and is provided with `thisArg` as the calling context.\n *\n * > Note: Using `forAwaitEach` requires the existence of `Promise`.\n * > While `Promise` has been available in modern browsers for a number of\n * > years, legacy browsers (like IE 11) may require a polyfill.\n *\n * @example\n *\n * var forAwaitEach = require('iterall').forAwaitEach\n *\n * forAwaitEach(myIterable, function (value, index, iterable) {\n * console.log(value, index, iterable === myIterable)\n * })\n *\n * @example\n *\n * // ES2017:\n * for await (let value of myAsyncIterable) {\n * console.log(await doSomethingAsync(value))\n * }\n * console.log('done')\n *\n * // Any JavaScript environment:\n * forAwaitEach(myAsyncIterable, function (value) {\n * return doSomethingAsync(value).then(console.log)\n * }).then(function () {\n * console.log('done')\n * })\n *\n * @template T the type of each iterated value\n * @param {AsyncIterable|Iterable | T>|{ length: number }} source\n * The AsyncIterable or array to iterate over.\n * @param {function(T, number, object)} callback\n * Function to execute for each iteration, taking up to three arguments\n * @param [thisArg]\n * Optional. Value to use as `this` when executing `callback`.\n */\n\n\nfunction forAwaitEach(source, callback, thisArg) {\n var asyncIterator = createAsyncIterator(source);\n\n if (asyncIterator) {\n var i = 0;\n return new Promise(function (resolve, reject) {\n function next() {\n asyncIterator.next().then(function (step) {\n if (!step.done) {\n Promise.resolve(callback.call(thisArg, step.value, i++, source)).then(next)[\"catch\"](reject);\n } else {\n resolve();\n } // Explicitly return null, silencing bluebird-style warnings.\n\n\n return null;\n })[\"catch\"](reject); // Explicitly return null, silencing bluebird-style warnings.\n\n return null;\n }\n\n next();\n });\n }\n}\n\nexports.forAwaitEach = forAwaitEach;","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","import { useTheme as useThemeWithoutDefault } from '@material-ui/styles';\nimport React from 'react';\nimport defaultTheme from './defaultTheme';\nexport default function useTheme() {\n var theme = useThemeWithoutDefault() || defaultTheme;\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(theme);\n }\n\n return theme;\n}","function _typeof2(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nexport default function _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport withStyles from '../styles/withStyles';\nimport capitalize from '../utils/capitalize';\nexport var styles = function styles(theme) {\n return {\n /* Styles applied to the root element. */\n root: {\n margin: 0\n },\n\n /* Styles applied to the root element if `variant=\"body2\"`. */\n body2: theme.typography.body2,\n\n /* Styles applied to the root element if `variant=\"body1\"`. */\n body1: theme.typography.body1,\n\n /* Styles applied to the root element if `variant=\"caption\"`. */\n caption: theme.typography.caption,\n\n /* Styles applied to the root element if `variant=\"button\"`. */\n button: theme.typography.button,\n\n /* Styles applied to the root element if `variant=\"h1\"`. */\n h1: theme.typography.h1,\n\n /* Styles applied to the root element if `variant=\"h2\"`. */\n h2: theme.typography.h2,\n\n /* Styles applied to the root element if `variant=\"h3\"`. */\n h3: theme.typography.h3,\n\n /* Styles applied to the root element if `variant=\"h4\"`. */\n h4: theme.typography.h4,\n\n /* Styles applied to the root element if `variant=\"h5\"`. */\n h5: theme.typography.h5,\n\n /* Styles applied to the root element if `variant=\"h6\"`. */\n h6: theme.typography.h6,\n\n /* Styles applied to the root element if `variant=\"subtitle1\"`. */\n subtitle1: theme.typography.subtitle1,\n\n /* Styles applied to the root element if `variant=\"subtitle2\"`. */\n subtitle2: theme.typography.subtitle2,\n\n /* Styles applied to the root element if `variant=\"overline\"`. */\n overline: theme.typography.overline,\n\n /* Styles applied to the root element if `variant=\"srOnly\"`. Only accessible to screen readers. */\n srOnly: {\n position: 'absolute',\n height: 1,\n width: 1,\n overflow: 'hidden'\n },\n\n /* Styles applied to the root element if `align=\"left\"`. */\n alignLeft: {\n textAlign: 'left'\n },\n\n /* Styles applied to the root element if `align=\"center\"`. */\n alignCenter: {\n textAlign: 'center'\n },\n\n /* Styles applied to the root element if `align=\"right\"`. */\n alignRight: {\n textAlign: 'right'\n },\n\n /* Styles applied to the root element if `align=\"justify\"`. */\n alignJustify: {\n textAlign: 'justify'\n },\n\n /* Styles applied to the root element if `nowrap={true}`. */\n noWrap: {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap'\n },\n\n /* Styles applied to the root element if `gutterBottom={true}`. */\n gutterBottom: {\n marginBottom: '0.35em'\n },\n\n /* Styles applied to the root element if `paragraph={true}`. */\n paragraph: {\n marginBottom: 16\n },\n\n /* Styles applied to the root element if `color=\"inherit\"`. */\n colorInherit: {\n color: 'inherit'\n },\n\n /* Styles applied to the root element if `color=\"primary\"`. */\n colorPrimary: {\n color: theme.palette.primary.main\n },\n\n /* Styles applied to the root element if `color=\"secondary\"`. */\n colorSecondary: {\n color: theme.palette.secondary.main\n },\n\n /* Styles applied to the root element if `color=\"textPrimary\"`. */\n colorTextPrimary: {\n color: theme.palette.text.primary\n },\n\n /* Styles applied to the root element if `color=\"textSecondary\"`. */\n colorTextSecondary: {\n color: theme.palette.text.secondary\n },\n\n /* Styles applied to the root element if `color=\"error\"`. */\n colorError: {\n color: theme.palette.error.main\n },\n\n /* Styles applied to the root element if `display=\"inline\"`. */\n displayInline: {\n display: 'inline'\n },\n\n /* Styles applied to the root element if `display=\"block\"`. */\n displayBlock: {\n display: 'block'\n }\n };\n};\nvar defaultVariantMapping = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n h6: 'h6',\n subtitle1: 'h6',\n subtitle2: 'h6',\n body1: 'p',\n body2: 'p'\n};\nvar Typography = /*#__PURE__*/React.forwardRef(function Typography(props, ref) {\n var _props$align = props.align,\n align = _props$align === void 0 ? 'inherit' : _props$align,\n classes = props.classes,\n className = props.className,\n _props$color = props.color,\n color = _props$color === void 0 ? 'initial' : _props$color,\n component = props.component,\n _props$display = props.display,\n display = _props$display === void 0 ? 'initial' : _props$display,\n _props$gutterBottom = props.gutterBottom,\n gutterBottom = _props$gutterBottom === void 0 ? false : _props$gutterBottom,\n _props$noWrap = props.noWrap,\n noWrap = _props$noWrap === void 0 ? false : _props$noWrap,\n _props$paragraph = props.paragraph,\n paragraph = _props$paragraph === void 0 ? false : _props$paragraph,\n _props$variant = props.variant,\n variant = _props$variant === void 0 ? 'body1' : _props$variant,\n _props$variantMapping = props.variantMapping,\n variantMapping = _props$variantMapping === void 0 ? defaultVariantMapping : _props$variantMapping,\n other = _objectWithoutProperties(props, [\"align\", \"classes\", \"className\", \"color\", \"component\", \"display\", \"gutterBottom\", \"noWrap\", \"paragraph\", \"variant\", \"variantMapping\"]);\n\n var Component = component || (paragraph ? 'p' : variantMapping[variant] || defaultVariantMapping[variant]) || 'span';\n return /*#__PURE__*/React.createElement(Component, _extends({\n className: clsx(classes.root, className, variant !== 'inherit' && classes[variant], color !== 'initial' && classes[\"color\".concat(capitalize(color))], noWrap && classes.noWrap, gutterBottom && classes.gutterBottom, paragraph && classes.paragraph, align !== 'inherit' && classes[\"align\".concat(capitalize(align))], display !== 'initial' && classes[\"display\".concat(capitalize(display))]),\n ref: ref\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? void 0 : void 0;\nexport default withStyles(styles, {\n name: 'MuiTypography'\n})(Typography);","var orange = {\n 50: '#fff3e0',\n 100: '#ffe0b2',\n 200: '#ffcc80',\n 300: '#ffb74d',\n 400: '#ffa726',\n 500: '#ff9800',\n 600: '#fb8c00',\n 700: '#f57c00',\n 800: '#ef6c00',\n 900: '#e65100',\n A100: '#ffd180',\n A200: '#ffab40',\n A400: '#ff9100',\n A700: '#ff6d00'\n};\nexport default orange;","'use strict';\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar bind = require('./helpers/bind');\n\nvar isBuffer = require('is-buffer');\n/*global toString:true*/\n// utils is a library of generic helper functions non-specific to axios\n\n\nvar toString = Object.prototype.toString;\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\n\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\n\n\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\n\n\nfunction isFormData(val) {\n return typeof FormData !== 'undefined' && val instanceof FormData;\n}\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\n\n\nfunction isArrayBufferView(val) {\n var result;\n\n if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {\n result = ArrayBuffer.isView(val);\n } else {\n result = val && val.buffer && val.buffer instanceof ArrayBuffer;\n }\n\n return result;\n}\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\n\n\nfunction isString(val) {\n return typeof val === 'string';\n}\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\n\n\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\n\n\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\n\n\nfunction isObject(val) {\n return val !== null && _typeof(val) === 'object';\n}\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\n\n\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\n\n\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\n\n\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\n\n\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\n\n\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\n\n\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\n\n\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\n\n\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\n\n\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n } // Force an array if not already something iterable\n\n\n if (_typeof(obj) !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\n\n\nfunction merge()\n/* obj1, obj2, obj3, ... */\n{\n var result = {};\n\n function assignValue(val, key) {\n if (_typeof(result[key]) === 'object' && _typeof(val) === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n\n return result;\n}\n/**\n * Function equal to merge with the difference being that no reference\n * to original objects is kept.\n *\n * @see merge\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\n\n\nfunction deepMerge()\n/* obj1, obj2, obj3, ... */\n{\n var result = {};\n\n function assignValue(val, key) {\n if (_typeof(result[key]) === 'object' && _typeof(val) === 'object') {\n result[key] = deepMerge(result[key], val);\n } else if (_typeof(val) === 'object') {\n result[key] = deepMerge({}, val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n\n return result;\n}\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\n\n\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n deepMerge: deepMerge,\n extend: extend,\n trim: trim\n};","\"use strict\";\n/*\n * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\n\nfunction __export(m) {\n for (var p in m) {\n if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n }\n}\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\n__export(require(\"./ConsoleLogger\"));","export default process && process.env.NODE_ENV !== 'production' ? // eslint-disable-next-line no-shadow\nfunction instanceOf(value, constructor) {\n if (value instanceof constructor) {\n return true;\n }\n\n if (value) {\n var valueClass = value.constructor;\n var className = constructor.name;\n\n if (valueClass && valueClass.name === className) {\n throw new Error('Cannot use ' + className + ' \"' + value + '\" from another module or realm.\\n\\nEnsure that there is only one instance of \"graphql\" in the node_modules\\ndirectory. If different versions of \"graphql\" are the dependencies of other\\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\\n\\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\\n\\nDuplicate \"graphql\" modules cannot be used at the same time since different\\nversions may have different capabilities and behavior. The data from one\\nversion used in the function from another could produce confusing and\\nspurious results.');\n }\n }\n\n return false;\n} : // eslint-disable-next-line no-shadow\nfunction instanceOf(value, constructor) {\n return value instanceof constructor;\n};\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n/**\n * A replacement for instanceof which includes an error warning when multi-realm\n * constructors are detected.\n */","import arrayWithHoles from \"./arrayWithHoles\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit\";\nimport nonIterableRest from \"./nonIterableRest\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest();\n}","export default function _iterableToArrayLimit(arr, i) {\n if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) {\n return;\n }\n\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}","export const COOKIE_KEY_LOGIN_EMAIL = \"login_email\";\r\nexport const COOKIE_KEY_LOGIN_PASSWORD = \"login_password\";\r\nexport const COOKIE_KEY_LOGIN_REMEMBER = \"login_remember\";\r\nexport const COOKIE_KEY_NO_NOTIFICATION_SOUND = \"no_notification_sound\";\r\nexport const COOKIE_KEY_OMNIAUTH_PATH = \"omniauth_path\";\r\n\r\nexport const CALENDAR_STATUS_CAN_RESERVE = 1;\r\nexport const CALENDAR_STATUS_PARTIAL = 2;\r\nexport const CALENDAR_STATUS_HIDDEN = 3;\r\nexport const CALENDAR_STATUS_HOLIDAY = 4;\r\nexport const CALENDAR_STATUS_FULL = 11;\r\nexport const CALENDAR_STATUS_DISABLE = 21;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar g; // This works in non-strict mode\n\ng = function () {\n return this;\n}();\n\ntry {\n // This works if eval is allowed (see CSP)\n g = g || new Function(\"return this\")();\n} catch (e) {\n // This works if the window reference is available\n if ((typeof window === \"undefined\" ? \"undefined\" : _typeof(window)) === \"object\") g = window;\n} // g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\n\nmodule.exports = g;","var green = {\n 50: '#e8f5e9',\n 100: '#c8e6c9',\n 200: '#a5d6a7',\n 300: '#81c784',\n 400: '#66bb6a',\n 500: '#4caf50',\n 600: '#43a047',\n 700: '#388e3c',\n 800: '#2e7d32',\n 900: '#1b5e20',\n A100: '#b9f6ca',\n A200: '#69f0ae',\n A400: '#00e676',\n A700: '#00c853'\n};\nexport default green;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport React from 'react';\nimport SvgIcon from '../SvgIcon';\n/**\n * Private module reserved for @material-ui/x packages.\n */\n\nexport default function createSvgIcon(path, displayName) {\n var Component = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgIcon, _extends({\n ref: ref\n }, props), path);\n }));\n\n if (process.env.NODE_ENV !== 'production') {\n Component.displayName = \"\".concat(displayName, \"Icon\");\n }\n\n Component.muiName = SvgIcon.muiName;\n return Component;\n}","export var reflow = function reflow(node) {\n return node.scrollTop;\n};\nexport function getTransitionProps(props, options) {\n var timeout = props.timeout,\n _props$style = props.style,\n style = _props$style === void 0 ? {} : _props$style;\n return {\n duration: style.transitionDuration || typeof timeout === 'number' ? timeout : timeout[options.mode] || 0,\n delay: style.transitionDelay\n };\n}","let ja = {\n \"translation\" : {\n \"has already been taken\" : \"アカウントの登録に失敗しました。メールアドレスが利用可能か確認ください。\",\n \"can't be blank\" : \"入力が必要です。\",\n \"login_error\" : \"ログインに失敗しました。メールアドレスが利用可能か確認ください。\",\n }\n};\n\nexport default ja;\n","let en = {\n \"translation\" : {\n \"has already been taken\" : \"Registration failed.\",\n \"can't be blank\" : \"can't be blank\"\n }\n};\n\nexport default en;\n","import React from 'react';\r\nimport {MuiThemeProvider, withStyles} from \"@material-ui/core\";\r\nimport Snackbar from '@material-ui/core/Snackbar';\r\nimport SnackbarContent from '@material-ui/core/SnackbarContent';\r\nimport ErrorIcon from '@material-ui/icons/Error'\r\nimport IconButton from '@material-ui/core/IconButton';\r\nimport CloseIcon from '@material-ui/icons/Close';\r\nimport * as Observable from 'zen-observable';\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n// Theme\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\nimport theme from './../../../theme/theme';\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n// initialize i18n\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\nimport i18n from \"./../../../libs/i18n\";\r\n\r\nimport ja from './locale/ja';\r\nimport en from './locale/en';\r\n\r\nconst style = {\r\n icon: {\r\n verticalAlign: \"middle\",\r\n marginRight: 10\r\n },\r\n};\r\n\r\n\r\ni18n.addResourceBundle(\"en\", \"translation\", en.translation);\r\ni18n.addResourceBundle(\"ja\", \"translation\", ja.translation);\r\n\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\n// component\r\n// ------------------------------------------------------------------------------------------------------------------ //\r\nclass ErrorMessage extends React.Component {\r\n constructor(props) {\r\n super();\r\n\r\n if (props.error_list && Object.keys(props.error_list).length > 0)\r\n {\r\n this.state = {\r\n open: true,\r\n error_list: props.error_list,\r\n error_message: this.error_message(props.error_list),\r\n };\r\n }\r\n else\r\n {\r\n this.state = {\r\n open: false,\r\n error_list: [],\r\n error_message: '',\r\n };\r\n }\r\n\r\n this.handleClose = this.handleClose.bind(this);\r\n\r\n ErrorMessageProtocol.getObservable()\r\n .subscribe({\r\n next: (message) => {\r\n this.openSnackbar(message)\r\n }\r\n });\r\n }\r\n\r\n handleClose(event, reason) {\r\n if (reason === 'clickaway')\r\n {\r\n return;\r\n }\r\n\r\n this.setState({open: false});\r\n }\r\n\r\n error_message(error_list) {\r\n let messages = \"\";\r\n error_list.map(error => {\r\n try\r\n {\r\n let error_message = i18n.t(error[1]);\r\n console.log(\"[ERROR] target=\" + error[1] + \", error_message=\" + error_message);\r\n\r\n messages += error_message;\r\n } catch (e)\r\n {\r\n console.log(\"[ERROR] error occurs at : \" + e);\r\n }\r\n });\r\n\r\n return messages;\r\n }\r\n\r\n openSnackbar = message => {\r\n this.setState({open: true, error_message: message});\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {this.state.error_message}\r\n \r\n \r\n }\r\n action={[\r\n \r\n \r\n ,\r\n ]}\r\n />\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default withStyles(style)(ErrorMessage);\r\n\r\nexport class ErrorMessageProtocol {\r\n static observable = null;\r\n static observer = null;\r\n\r\n static getObservable() {\r\n if (!(this.observable))\r\n this.observable = new Observable(observer => {\r\n this.observer = observer;\r\n });\r\n return this.observable;\r\n }\r\n\r\n static next(message){\r\n this.observer.next(message);\r\n }\r\n}","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","import _typeof from \"../../helpers/esm/typeof\";\nimport assertThisInitialized from \"./assertThisInitialized\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}","// TODO v5: consider to make it private\nexport default function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport merge from './merge';\n\nfunction compose() {\n for (var _len = arguments.length, styles = new Array(_len), _key = 0; _key < _len; _key++) {\n styles[_key] = arguments[_key];\n }\n\n var fn = function fn(props) {\n return styles.reduce(function (acc, style) {\n var output = style(props);\n\n if (output) {\n return merge(acc, output);\n }\n\n return acc;\n }, {});\n }; // Alternative approach that doesn't yield any performance gain.\n // const handlers = styles.reduce((acc, style) => {\n // style.filterProps.forEach(prop => {\n // acc[prop] = style;\n // });\n // return acc;\n // }, {});\n // const fn = props => {\n // return Object.keys(props).reduce((acc, prop) => {\n // if (handlers[prop]) {\n // return merge(acc, handlers[prop](props));\n // }\n // return acc;\n // }, {});\n // };\n\n\n fn.propTypes = process.env.NODE_ENV !== 'production' ? styles.reduce(function (acc, style) {\n return _extends(acc, style.propTypes);\n }, {}) : {};\n fn.filterProps = styles.reduce(function (acc, style) {\n return acc.concat(style.filterProps);\n }, []);\n return fn;\n}\n\nexport default compose;","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","import * as React from 'react';\n/**\n * @ignore - internal component.\n */\n\nvar Tablelvl2Context = /*#__PURE__*/React.createContext();\n\nif (process.env.NODE_ENV !== 'production') {\n Tablelvl2Context.displayName = 'Tablelvl2Context';\n}\n\nexport default Tablelvl2Context;","var isProduction = process.env.NODE_ENV === 'production';\n\nfunction warning(condition, message) {\n if (!isProduction) {\n if (condition) {\n return;\n }\n\n var text = \"Warning: \" + message;\n\n if (typeof console !== 'undefined') {\n console.warn(text);\n }\n\n try {\n throw Error(text);\n } catch (x) {}\n }\n}\n\nexport default warning;","/**\n * Safe chained function\n *\n * Will only create a new function if needed,\n * otherwise will pass back existing functions or null.\n *\n * @param {function} functions to chain\n * @returns {function|null}\n */\nexport default function createChainedFunction() {\n for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n return funcs.reduce(function (acc, func) {\n if (func == null) {\n return acc;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof func !== 'function') {\n console.error('Material-UI: invalid Argument Type, must only provide functions, undefined, or null.');\n }\n }\n\n return function chainedFunction() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n acc.apply(this, args);\n func.apply(this, args);\n };\n }, function () {});\n}","import * as React from 'react';\n/**\n * @ignore - internal component.\n */\n\nvar ListContext = /*#__PURE__*/React.createContext({});\n\nif (process.env.NODE_ENV !== 'production') {\n ListContext.displayName = 'ListContext';\n}\n\nexport default ListContext;","import * as React from 'react';\nimport FormControlContext from './FormControlContext';\nexport default function useFormControl() {\n return React.useContext(FormControlContext);\n}","import React from 'react';\nexport default /*#__PURE__*/React.createContext(null);","function _typeof2(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nvar _typeof = typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\" ? function (obj) {\n return _typeof2(obj);\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n};\n\nexport var isBrowser = (typeof window === \"undefined\" ? \"undefined\" : _typeof(window)) === \"object\" && (typeof document === \"undefined\" ? \"undefined\" : _typeof(document)) === 'object' && document.nodeType === 9;\nexport default isBrowser;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/*!\n * JavaScript Cookie v2.2.1\n * https://github.com/js-cookie/js-cookie\n *\n * Copyright 2006, 2015 Klaus Hartl & Fagner Brack\n * Released under the MIT license\n */\n;\n\n(function (factory) {\n var registeredInModuleLoader;\n\n if (typeof define === 'function' && define.amd) {\n define(factory);\n registeredInModuleLoader = true;\n }\n\n if ((typeof exports === \"undefined\" ? \"undefined\" : _typeof(exports)) === 'object') {\n module.exports = factory();\n registeredInModuleLoader = true;\n }\n\n if (!registeredInModuleLoader) {\n var OldCookies = window.Cookies;\n var api = window.Cookies = factory();\n\n api.noConflict = function () {\n window.Cookies = OldCookies;\n return api;\n };\n }\n})(function () {\n function extend() {\n var i = 0;\n var result = {};\n\n for (; i < arguments.length; i++) {\n var attributes = arguments[i];\n\n for (var key in attributes) {\n result[key] = attributes[key];\n }\n }\n\n return result;\n }\n\n function decode(s) {\n return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);\n }\n\n function init(converter) {\n function api() {}\n\n function set(key, value, attributes) {\n if (typeof document === 'undefined') {\n return;\n }\n\n attributes = extend({\n path: '/'\n }, api.defaults, attributes);\n\n if (typeof attributes.expires === 'number') {\n attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);\n } // We're using \"expires\" because \"max-age\" is not supported by IE\n\n\n attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';\n\n try {\n var result = JSON.stringify(value);\n\n if (/^[\\{\\[]/.test(result)) {\n value = result;\n }\n } catch (e) {}\n\n value = converter.write ? converter.write(value, key) : encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\n key = encodeURIComponent(String(key)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\\(\\)]/g, escape);\n var stringifiedAttributes = '';\n\n for (var attributeName in attributes) {\n if (!attributes[attributeName]) {\n continue;\n }\n\n stringifiedAttributes += '; ' + attributeName;\n\n if (attributes[attributeName] === true) {\n continue;\n } // Considers RFC 6265 section 5.2:\n // ...\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n // character:\n // Consume the characters of the unparsed-attributes up to,\n // not including, the first %x3B (\";\") character.\n // ...\n\n\n stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n }\n\n return document.cookie = key + '=' + value + stringifiedAttributes;\n }\n\n function get(key, json) {\n if (typeof document === 'undefined') {\n return;\n }\n\n var jar = {}; // To prevent the for loop in the first place assign an empty array\n // in case there are no cookies at all.\n\n var cookies = document.cookie ? document.cookie.split('; ') : [];\n var i = 0;\n\n for (; i < cookies.length; i++) {\n var parts = cookies[i].split('=');\n var cookie = parts.slice(1).join('=');\n\n if (!json && cookie.charAt(0) === '\"') {\n cookie = cookie.slice(1, -1);\n }\n\n try {\n var name = decode(parts[0]);\n cookie = (converter.read || converter)(cookie, name) || decode(cookie);\n\n if (json) {\n try {\n cookie = JSON.parse(cookie);\n } catch (e) {}\n }\n\n jar[name] = cookie;\n\n if (key === name) {\n break;\n }\n } catch (e) {}\n }\n\n return key ? jar[key] : jar;\n }\n\n api.set = set;\n\n api.get = function (key) {\n return get(key, false\n /* read as raw */\n );\n };\n\n api.getJSON = function (key) {\n return get(key, true\n /* read as json */\n );\n };\n\n api.remove = function (key, attributes) {\n set(key, '', extend(attributes, {\n expires: -1\n }));\n };\n\n api.defaults = {};\n api.withConverter = init;\n return api;\n }\n\n return init(function () {});\n});","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n'use strict';\n/* eslint-disable no-unused-vars */\n\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n if (val === null || val === undefined) {\n throw new TypeError('Object.assign cannot be called with null or undefined');\n }\n\n return Object(val);\n}\n\nfunction shouldUseNative() {\n try {\n if (!Object.assign) {\n return false;\n } // Detect buggy property enumeration order in older V8 versions.\n // https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\n\n var test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\n test1[5] = 'de';\n\n if (Object.getOwnPropertyNames(test1)[0] === '5') {\n return false;\n } // https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\n\n var test2 = {};\n\n for (var i = 0; i < 10; i++) {\n test2['_' + String.fromCharCode(i)] = i;\n }\n\n var order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n return test2[n];\n });\n\n if (order2.join('') !== '0123456789') {\n return false;\n } // https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\n\n var test3 = {};\n 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n test3[letter] = letter;\n });\n\n if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {\n return false;\n }\n\n return true;\n } catch (err) {\n // We don't expect any of the above to throw, but better to be safe.\n return false;\n }\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n var from;\n var to = toObject(target);\n var symbols;\n\n for (var s = 1; s < arguments.length; s++) {\n from = Object(arguments[s]);\n\n for (var key in from) {\n if (hasOwnProperty.call(from, key)) {\n to[key] = from[key];\n }\n }\n\n if (getOwnPropertySymbols) {\n symbols = getOwnPropertySymbols(from);\n\n for (var i = 0; i < symbols.length; i++) {\n if (propIsEnumerable.call(from, symbols[i])) {\n to[symbols[i]] = from[symbols[i]];\n }\n }\n }\n }\n\n return to;\n};","import createMuiTheme from './createMuiTheme';\nvar defaultTheme = createMuiTheme();\nexport default defaultTheme;","export default function formControlState(_ref) {\n var props = _ref.props,\n states = _ref.states,\n muiFormControl = _ref.muiFormControl;\n return states.reduce(function (acc, state) {\n acc[state] = props[state];\n\n if (muiFormControl) {\n if (typeof props[state] === 'undefined') {\n acc[state] = muiFormControl[state];\n }\n }\n\n return acc;\n }, {});\n}","// Corresponds to 10 frames at 60 Hz.\n// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.\nexport default function debounce(func) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;\n var timeout;\n\n function debounced() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n } // eslint-disable-next-line consistent-this\n\n\n var that = this;\n\n var later = function later() {\n func.apply(that, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = function () {\n clearTimeout(timeout);\n };\n\n return debounced;\n}","import { deepmerge } from '@material-ui/utils';\n\nfunction merge(acc, item) {\n if (!item) {\n return acc;\n }\n\n return deepmerge(acc, item, {\n clone: false // No need to clone deep, it's way faster.\n\n });\n}\n\nexport default merge;","import * as React from 'react';\nexport default function isMuiElement(element, muiNames) {\n return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf(element.type.muiName) !== -1;\n}","/* eslint-disable */\n// this is an auto generated file. This will be overwritten\n\nexport const createReservation = /* GraphQL */ `\n mutation CreateReservation($input: CreateReservationInput!) {\n createReservation(input: $input) {\n id\n customer_id\n order_id\n edit_account_id\n }\n }\n`;\nexport const updateReservation = /* GraphQL */ `\n mutation UpdateReservation($input: UpdateReservationInput!) {\n updateReservation(input: $input) {\n id\n customer_id\n order_id\n edit_account_id\n }\n }\n`;\nexport const deleteReservation = /* GraphQL */ `\n mutation DeleteReservation($input: DeleteReservationInput!) {\n deleteReservation(input: $input) {\n id\n customer_id\n order_id\n edit_account_id\n }\n }\n`;\nexport const createMessage = /* GraphQL */ `\n mutation CreateMessage($input: CreateMessageInput!) {\n createMessage(input: $input) {\n id\n customer_id\n channel\n sender_type\n sender_id\n body\n message_type\n image_base64\n send_at\n createdAt\n }\n }\n`;\nexport const updateMessage = /* GraphQL */ `\n mutation UpdateMessage($input: UpdateMessageInput!) {\n updateMessage(input: $input) {\n id\n customer_id\n channel\n sender_type\n sender_id\n body\n message_type\n image_base64\n send_at\n createdAt\n }\n }\n`;\nexport const deleteMessage = /* GraphQL */ `\n mutation DeleteMessage($input: DeleteMessageInput!) {\n deleteMessage(input: $input) {\n id\n customer_id\n channel\n sender_type\n sender_id\n body\n message_type\n image_base64\n send_at\n createdAt\n }\n }\n`;\n","module.exports = function (module) {\n if (!module.webpackPolyfill) {\n module.deprecate = function () {};\n\n module.paths = []; // module.parent = undefined by default\n\n if (!module.children) module.children = [];\n Object.defineProperty(module, \"loaded\", {\n enumerable: true,\n get: function get() {\n return module.l;\n }\n });\n Object.defineProperty(module, \"id\", {\n enumerable: true,\n get: function get() {\n return module.i;\n }\n });\n module.webpackPolyfill = 1;\n }\n\n return module;\n};","(function (exports) {\n \"use strict\";\n\n function isArray(obj) {\n if (obj !== null) {\n return Object.prototype.toString.call(obj) === \"[object Array]\";\n } else {\n return false;\n }\n }\n\n function isObject(obj) {\n if (obj !== null) {\n return Object.prototype.toString.call(obj) === \"[object Object]\";\n } else {\n return false;\n }\n }\n\n function strictDeepEqual(first, second) {\n // Check the scalar case first.\n if (first === second) {\n return true;\n } // Check if they are the same type.\n\n\n var firstType = Object.prototype.toString.call(first);\n\n if (firstType !== Object.prototype.toString.call(second)) {\n return false;\n } // We know that first and second have the same type so we can just check the\n // first type from now on.\n\n\n if (isArray(first) === true) {\n // Short circuit if they're not the same length;\n if (first.length !== second.length) {\n return false;\n }\n\n for (var i = 0; i < first.length; i++) {\n if (strictDeepEqual(first[i], second[i]) === false) {\n return false;\n }\n }\n\n return true;\n }\n\n if (isObject(first) === true) {\n // An object is equal if it has the same key/value pairs.\n var keysSeen = {};\n\n for (var key in first) {\n if (hasOwnProperty.call(first, key)) {\n if (strictDeepEqual(first[key], second[key]) === false) {\n return false;\n }\n\n keysSeen[key] = true;\n }\n } // Now check that there aren't any keys in second that weren't\n // in first.\n\n\n for (var key2 in second) {\n if (hasOwnProperty.call(second, key2)) {\n if (keysSeen[key2] !== true) {\n return false;\n }\n }\n }\n\n return true;\n }\n\n return false;\n }\n\n function isFalse(obj) {\n // From the spec:\n // A false value corresponds to the following values:\n // Empty list\n // Empty object\n // Empty string\n // False boolean\n // null value\n // First check the scalar values.\n if (obj === \"\" || obj === false || obj === null) {\n return true;\n } else if (isArray(obj) && obj.length === 0) {\n // Check for an empty array.\n return true;\n } else if (isObject(obj)) {\n // Check for an empty object.\n for (var key in obj) {\n // If there are any keys, then\n // the object is not empty so the object\n // is not false.\n if (obj.hasOwnProperty(key)) {\n return false;\n }\n }\n\n return true;\n } else {\n return false;\n }\n }\n\n function objValues(obj) {\n var keys = Object.keys(obj);\n var values = [];\n\n for (var i = 0; i < keys.length; i++) {\n values.push(obj[keys[i]]);\n }\n\n return values;\n }\n\n function merge(a, b) {\n var merged = {};\n\n for (var key in a) {\n merged[key] = a[key];\n }\n\n for (var key2 in b) {\n merged[key2] = b[key2];\n }\n\n return merged;\n }\n\n var trimLeft;\n\n if (typeof String.prototype.trimLeft === \"function\") {\n trimLeft = function trimLeft(str) {\n return str.trimLeft();\n };\n } else {\n trimLeft = function trimLeft(str) {\n return str.match(/^\\s*(.*)/)[1];\n };\n } // Type constants used to define functions.\n\n\n var TYPE_NUMBER = 0;\n var TYPE_ANY = 1;\n var TYPE_STRING = 2;\n var TYPE_ARRAY = 3;\n var TYPE_OBJECT = 4;\n var TYPE_BOOLEAN = 5;\n var TYPE_EXPREF = 6;\n var TYPE_NULL = 7;\n var TYPE_ARRAY_NUMBER = 8;\n var TYPE_ARRAY_STRING = 9;\n var TOK_EOF = \"EOF\";\n var TOK_UNQUOTEDIDENTIFIER = \"UnquotedIdentifier\";\n var TOK_QUOTEDIDENTIFIER = \"QuotedIdentifier\";\n var TOK_RBRACKET = \"Rbracket\";\n var TOK_RPAREN = \"Rparen\";\n var TOK_COMMA = \"Comma\";\n var TOK_COLON = \"Colon\";\n var TOK_RBRACE = \"Rbrace\";\n var TOK_NUMBER = \"Number\";\n var TOK_CURRENT = \"Current\";\n var TOK_EXPREF = \"Expref\";\n var TOK_PIPE = \"Pipe\";\n var TOK_OR = \"Or\";\n var TOK_AND = \"And\";\n var TOK_EQ = \"EQ\";\n var TOK_GT = \"GT\";\n var TOK_LT = \"LT\";\n var TOK_GTE = \"GTE\";\n var TOK_LTE = \"LTE\";\n var TOK_NE = \"NE\";\n var TOK_FLATTEN = \"Flatten\";\n var TOK_STAR = \"Star\";\n var TOK_FILTER = \"Filter\";\n var TOK_DOT = \"Dot\";\n var TOK_NOT = \"Not\";\n var TOK_LBRACE = \"Lbrace\";\n var TOK_LBRACKET = \"Lbracket\";\n var TOK_LPAREN = \"Lparen\";\n var TOK_LITERAL = \"Literal\"; // The \"&\", \"[\", \"<\", \">\" tokens\n // are not in basicToken because\n // there are two token variants\n // (\"&&\", \"[?\", \"<=\", \">=\"). This is specially handled\n // below.\n\n var basicTokens = {\n \".\": TOK_DOT,\n \"*\": TOK_STAR,\n \",\": TOK_COMMA,\n \":\": TOK_COLON,\n \"{\": TOK_LBRACE,\n \"}\": TOK_RBRACE,\n \"]\": TOK_RBRACKET,\n \"(\": TOK_LPAREN,\n \")\": TOK_RPAREN,\n \"@\": TOK_CURRENT\n };\n var operatorStartToken = {\n \"<\": true,\n \">\": true,\n \"=\": true,\n \"!\": true\n };\n var skipChars = {\n \" \": true,\n \"\\t\": true,\n \"\\n\": true\n };\n\n function isAlpha(ch) {\n return ch >= \"a\" && ch <= \"z\" || ch >= \"A\" && ch <= \"Z\" || ch === \"_\";\n }\n\n function isNum(ch) {\n return ch >= \"0\" && ch <= \"9\" || ch === \"-\";\n }\n\n function isAlphaNum(ch) {\n return ch >= \"a\" && ch <= \"z\" || ch >= \"A\" && ch <= \"Z\" || ch >= \"0\" && ch <= \"9\" || ch === \"_\";\n }\n\n function Lexer() {}\n\n Lexer.prototype = {\n tokenize: function tokenize(stream) {\n var tokens = [];\n this._current = 0;\n var start;\n var identifier;\n var token;\n\n while (this._current < stream.length) {\n if (isAlpha(stream[this._current])) {\n start = this._current;\n identifier = this._consumeUnquotedIdentifier(stream);\n tokens.push({\n type: TOK_UNQUOTEDIDENTIFIER,\n value: identifier,\n start: start\n });\n } else if (basicTokens[stream[this._current]] !== undefined) {\n tokens.push({\n type: basicTokens[stream[this._current]],\n value: stream[this._current],\n start: this._current\n });\n this._current++;\n } else if (isNum(stream[this._current])) {\n token = this._consumeNumber(stream);\n tokens.push(token);\n } else if (stream[this._current] === \"[\") {\n // No need to increment this._current. This happens\n // in _consumeLBracket\n token = this._consumeLBracket(stream);\n tokens.push(token);\n } else if (stream[this._current] === \"\\\"\") {\n start = this._current;\n identifier = this._consumeQuotedIdentifier(stream);\n tokens.push({\n type: TOK_QUOTEDIDENTIFIER,\n value: identifier,\n start: start\n });\n } else if (stream[this._current] === \"'\") {\n start = this._current;\n identifier = this._consumeRawStringLiteral(stream);\n tokens.push({\n type: TOK_LITERAL,\n value: identifier,\n start: start\n });\n } else if (stream[this._current] === \"`\") {\n start = this._current;\n\n var literal = this._consumeLiteral(stream);\n\n tokens.push({\n type: TOK_LITERAL,\n value: literal,\n start: start\n });\n } else if (operatorStartToken[stream[this._current]] !== undefined) {\n tokens.push(this._consumeOperator(stream));\n } else if (skipChars[stream[this._current]] !== undefined) {\n // Ignore whitespace.\n this._current++;\n } else if (stream[this._current] === \"&\") {\n start = this._current;\n this._current++;\n\n if (stream[this._current] === \"&\") {\n this._current++;\n tokens.push({\n type: TOK_AND,\n value: \"&&\",\n start: start\n });\n } else {\n tokens.push({\n type: TOK_EXPREF,\n value: \"&\",\n start: start\n });\n }\n } else if (stream[this._current] === \"|\") {\n start = this._current;\n this._current++;\n\n if (stream[this._current] === \"|\") {\n this._current++;\n tokens.push({\n type: TOK_OR,\n value: \"||\",\n start: start\n });\n } else {\n tokens.push({\n type: TOK_PIPE,\n value: \"|\",\n start: start\n });\n }\n } else {\n var error = new Error(\"Unknown character:\" + stream[this._current]);\n error.name = \"LexerError\";\n throw error;\n }\n }\n\n return tokens;\n },\n _consumeUnquotedIdentifier: function _consumeUnquotedIdentifier(stream) {\n var start = this._current;\n this._current++;\n\n while (this._current < stream.length && isAlphaNum(stream[this._current])) {\n this._current++;\n }\n\n return stream.slice(start, this._current);\n },\n _consumeQuotedIdentifier: function _consumeQuotedIdentifier(stream) {\n var start = this._current;\n this._current++;\n var maxLength = stream.length;\n\n while (stream[this._current] !== \"\\\"\" && this._current < maxLength) {\n // You can escape a double quote and you can escape an escape.\n var current = this._current;\n\n if (stream[current] === \"\\\\\" && (stream[current + 1] === \"\\\\\" || stream[current + 1] === \"\\\"\")) {\n current += 2;\n } else {\n current++;\n }\n\n this._current = current;\n }\n\n this._current++;\n return JSON.parse(stream.slice(start, this._current));\n },\n _consumeRawStringLiteral: function _consumeRawStringLiteral(stream) {\n var start = this._current;\n this._current++;\n var maxLength = stream.length;\n\n while (stream[this._current] !== \"'\" && this._current < maxLength) {\n // You can escape a single quote and you can escape an escape.\n var current = this._current;\n\n if (stream[current] === \"\\\\\" && (stream[current + 1] === \"\\\\\" || stream[current + 1] === \"'\")) {\n current += 2;\n } else {\n current++;\n }\n\n this._current = current;\n }\n\n this._current++;\n var literal = stream.slice(start + 1, this._current - 1);\n return literal.replace(\"\\\\'\", \"'\");\n },\n _consumeNumber: function _consumeNumber(stream) {\n var start = this._current;\n this._current++;\n var maxLength = stream.length;\n\n while (isNum(stream[this._current]) && this._current < maxLength) {\n this._current++;\n }\n\n var value = parseInt(stream.slice(start, this._current));\n return {\n type: TOK_NUMBER,\n value: value,\n start: start\n };\n },\n _consumeLBracket: function _consumeLBracket(stream) {\n var start = this._current;\n this._current++;\n\n if (stream[this._current] === \"?\") {\n this._current++;\n return {\n type: TOK_FILTER,\n value: \"[?\",\n start: start\n };\n } else if (stream[this._current] === \"]\") {\n this._current++;\n return {\n type: TOK_FLATTEN,\n value: \"[]\",\n start: start\n };\n } else {\n return {\n type: TOK_LBRACKET,\n value: \"[\",\n start: start\n };\n }\n },\n _consumeOperator: function _consumeOperator(stream) {\n var start = this._current;\n var startingChar = stream[start];\n this._current++;\n\n if (startingChar === \"!\") {\n if (stream[this._current] === \"=\") {\n this._current++;\n return {\n type: TOK_NE,\n value: \"!=\",\n start: start\n };\n } else {\n return {\n type: TOK_NOT,\n value: \"!\",\n start: start\n };\n }\n } else if (startingChar === \"<\") {\n if (stream[this._current] === \"=\") {\n this._current++;\n return {\n type: TOK_LTE,\n value: \"<=\",\n start: start\n };\n } else {\n return {\n type: TOK_LT,\n value: \"<\",\n start: start\n };\n }\n } else if (startingChar === \">\") {\n if (stream[this._current] === \"=\") {\n this._current++;\n return {\n type: TOK_GTE,\n value: \">=\",\n start: start\n };\n } else {\n return {\n type: TOK_GT,\n value: \">\",\n start: start\n };\n }\n } else if (startingChar === \"=\") {\n if (stream[this._current] === \"=\") {\n this._current++;\n return {\n type: TOK_EQ,\n value: \"==\",\n start: start\n };\n }\n }\n },\n _consumeLiteral: function _consumeLiteral(stream) {\n this._current++;\n var start = this._current;\n var maxLength = stream.length;\n var literal;\n\n while (stream[this._current] !== \"`\" && this._current < maxLength) {\n // You can escape a literal char or you can escape the escape.\n var current = this._current;\n\n if (stream[current] === \"\\\\\" && (stream[current + 1] === \"\\\\\" || stream[current + 1] === \"`\")) {\n current += 2;\n } else {\n current++;\n }\n\n this._current = current;\n }\n\n var literalString = trimLeft(stream.slice(start, this._current));\n literalString = literalString.replace(\"\\\\`\", \"`\");\n\n if (this._looksLikeJSON(literalString)) {\n literal = JSON.parse(literalString);\n } else {\n // Try to JSON parse it as \"\"\n literal = JSON.parse(\"\\\"\" + literalString + \"\\\"\");\n } // +1 gets us to the ending \"`\", +1 to move on to the next char.\n\n\n this._current++;\n return literal;\n },\n _looksLikeJSON: function _looksLikeJSON(literalString) {\n var startingChars = \"[{\\\"\";\n var jsonLiterals = [\"true\", \"false\", \"null\"];\n var numberLooking = \"-0123456789\";\n\n if (literalString === \"\") {\n return false;\n } else if (startingChars.indexOf(literalString[0]) >= 0) {\n return true;\n } else if (jsonLiterals.indexOf(literalString) >= 0) {\n return true;\n } else if (numberLooking.indexOf(literalString[0]) >= 0) {\n try {\n JSON.parse(literalString);\n return true;\n } catch (ex) {\n return false;\n }\n } else {\n return false;\n }\n }\n };\n var bindingPower = {};\n bindingPower[TOK_EOF] = 0;\n bindingPower[TOK_UNQUOTEDIDENTIFIER] = 0;\n bindingPower[TOK_QUOTEDIDENTIFIER] = 0;\n bindingPower[TOK_RBRACKET] = 0;\n bindingPower[TOK_RPAREN] = 0;\n bindingPower[TOK_COMMA] = 0;\n bindingPower[TOK_RBRACE] = 0;\n bindingPower[TOK_NUMBER] = 0;\n bindingPower[TOK_CURRENT] = 0;\n bindingPower[TOK_EXPREF] = 0;\n bindingPower[TOK_PIPE] = 1;\n bindingPower[TOK_OR] = 2;\n bindingPower[TOK_AND] = 3;\n bindingPower[TOK_EQ] = 5;\n bindingPower[TOK_GT] = 5;\n bindingPower[TOK_LT] = 5;\n bindingPower[TOK_GTE] = 5;\n bindingPower[TOK_LTE] = 5;\n bindingPower[TOK_NE] = 5;\n bindingPower[TOK_FLATTEN] = 9;\n bindingPower[TOK_STAR] = 20;\n bindingPower[TOK_FILTER] = 21;\n bindingPower[TOK_DOT] = 40;\n bindingPower[TOK_NOT] = 45;\n bindingPower[TOK_LBRACE] = 50;\n bindingPower[TOK_LBRACKET] = 55;\n bindingPower[TOK_LPAREN] = 60;\n\n function Parser() {}\n\n Parser.prototype = {\n parse: function parse(expression) {\n this._loadTokens(expression);\n\n this.index = 0;\n var ast = this.expression(0);\n\n if (this._lookahead(0) !== TOK_EOF) {\n var t = this._lookaheadToken(0);\n\n var error = new Error(\"Unexpected token type: \" + t.type + \", value: \" + t.value);\n error.name = \"ParserError\";\n throw error;\n }\n\n return ast;\n },\n _loadTokens: function _loadTokens(expression) {\n var lexer = new Lexer();\n var tokens = lexer.tokenize(expression);\n tokens.push({\n type: TOK_EOF,\n value: \"\",\n start: expression.length\n });\n this.tokens = tokens;\n },\n expression: function expression(rbp) {\n var leftToken = this._lookaheadToken(0);\n\n this._advance();\n\n var left = this.nud(leftToken);\n\n var currentToken = this._lookahead(0);\n\n while (rbp < bindingPower[currentToken]) {\n this._advance();\n\n left = this.led(currentToken, left);\n currentToken = this._lookahead(0);\n }\n\n return left;\n },\n _lookahead: function _lookahead(number) {\n return this.tokens[this.index + number].type;\n },\n _lookaheadToken: function _lookaheadToken(number) {\n return this.tokens[this.index + number];\n },\n _advance: function _advance() {\n this.index++;\n },\n nud: function nud(token) {\n var left;\n var right;\n var expression;\n\n switch (token.type) {\n case TOK_LITERAL:\n return {\n type: \"Literal\",\n value: token.value\n };\n\n case TOK_UNQUOTEDIDENTIFIER:\n return {\n type: \"Field\",\n name: token.value\n };\n\n case TOK_QUOTEDIDENTIFIER:\n var node = {\n type: \"Field\",\n name: token.value\n };\n\n if (this._lookahead(0) === TOK_LPAREN) {\n throw new Error(\"Quoted identifier not allowed for function names.\");\n } else {\n return node;\n }\n\n break;\n\n case TOK_NOT:\n right = this.expression(bindingPower.Not);\n return {\n type: \"NotExpression\",\n children: [right]\n };\n\n case TOK_STAR:\n left = {\n type: \"Identity\"\n };\n right = null;\n\n if (this._lookahead(0) === TOK_RBRACKET) {\n // This can happen in a multiselect,\n // [a, b, *]\n right = {\n type: \"Identity\"\n };\n } else {\n right = this._parseProjectionRHS(bindingPower.Star);\n }\n\n return {\n type: \"ValueProjection\",\n children: [left, right]\n };\n\n case TOK_FILTER:\n return this.led(token.type, {\n type: \"Identity\"\n });\n\n case TOK_LBRACE:\n return this._parseMultiselectHash();\n\n case TOK_FLATTEN:\n left = {\n type: TOK_FLATTEN,\n children: [{\n type: \"Identity\"\n }]\n };\n right = this._parseProjectionRHS(bindingPower.Flatten);\n return {\n type: \"Projection\",\n children: [left, right]\n };\n\n case TOK_LBRACKET:\n if (this._lookahead(0) === TOK_NUMBER || this._lookahead(0) === TOK_COLON) {\n right = this._parseIndexExpression();\n return this._projectIfSlice({\n type: \"Identity\"\n }, right);\n } else if (this._lookahead(0) === TOK_STAR && this._lookahead(1) === TOK_RBRACKET) {\n this._advance();\n\n this._advance();\n\n right = this._parseProjectionRHS(bindingPower.Star);\n return {\n type: \"Projection\",\n children: [{\n type: \"Identity\"\n }, right]\n };\n } else {\n return this._parseMultiselectList();\n }\n\n break;\n\n case TOK_CURRENT:\n return {\n type: TOK_CURRENT\n };\n\n case TOK_EXPREF:\n expression = this.expression(bindingPower.Expref);\n return {\n type: \"ExpressionReference\",\n children: [expression]\n };\n\n case TOK_LPAREN:\n var args = [];\n\n while (this._lookahead(0) !== TOK_RPAREN) {\n if (this._lookahead(0) === TOK_CURRENT) {\n expression = {\n type: TOK_CURRENT\n };\n\n this._advance();\n } else {\n expression = this.expression(0);\n }\n\n args.push(expression);\n }\n\n this._match(TOK_RPAREN);\n\n return args[0];\n\n default:\n this._errorToken(token);\n\n }\n },\n led: function led(tokenName, left) {\n var right;\n\n switch (tokenName) {\n case TOK_DOT:\n var rbp = bindingPower.Dot;\n\n if (this._lookahead(0) !== TOK_STAR) {\n right = this._parseDotRHS(rbp);\n return {\n type: \"Subexpression\",\n children: [left, right]\n };\n } else {\n // Creating a projection.\n this._advance();\n\n right = this._parseProjectionRHS(rbp);\n return {\n type: \"ValueProjection\",\n children: [left, right]\n };\n }\n\n break;\n\n case TOK_PIPE:\n right = this.expression(bindingPower.Pipe);\n return {\n type: TOK_PIPE,\n children: [left, right]\n };\n\n case TOK_OR:\n right = this.expression(bindingPower.Or);\n return {\n type: \"OrExpression\",\n children: [left, right]\n };\n\n case TOK_AND:\n right = this.expression(bindingPower.And);\n return {\n type: \"AndExpression\",\n children: [left, right]\n };\n\n case TOK_LPAREN:\n var name = left.name;\n var args = [];\n var expression, node;\n\n while (this._lookahead(0) !== TOK_RPAREN) {\n if (this._lookahead(0) === TOK_CURRENT) {\n expression = {\n type: TOK_CURRENT\n };\n\n this._advance();\n } else {\n expression = this.expression(0);\n }\n\n if (this._lookahead(0) === TOK_COMMA) {\n this._match(TOK_COMMA);\n }\n\n args.push(expression);\n }\n\n this._match(TOK_RPAREN);\n\n node = {\n type: \"Function\",\n name: name,\n children: args\n };\n return node;\n\n case TOK_FILTER:\n var condition = this.expression(0);\n\n this._match(TOK_RBRACKET);\n\n if (this._lookahead(0) === TOK_FLATTEN) {\n right = {\n type: \"Identity\"\n };\n } else {\n right = this._parseProjectionRHS(bindingPower.Filter);\n }\n\n return {\n type: \"FilterProjection\",\n children: [left, right, condition]\n };\n\n case TOK_FLATTEN:\n var leftNode = {\n type: TOK_FLATTEN,\n children: [left]\n };\n\n var rightNode = this._parseProjectionRHS(bindingPower.Flatten);\n\n return {\n type: \"Projection\",\n children: [leftNode, rightNode]\n };\n\n case TOK_EQ:\n case TOK_NE:\n case TOK_GT:\n case TOK_GTE:\n case TOK_LT:\n case TOK_LTE:\n return this._parseComparator(left, tokenName);\n\n case TOK_LBRACKET:\n var token = this._lookaheadToken(0);\n\n if (token.type === TOK_NUMBER || token.type === TOK_COLON) {\n right = this._parseIndexExpression();\n return this._projectIfSlice(left, right);\n } else {\n this._match(TOK_STAR);\n\n this._match(TOK_RBRACKET);\n\n right = this._parseProjectionRHS(bindingPower.Star);\n return {\n type: \"Projection\",\n children: [left, right]\n };\n }\n\n break;\n\n default:\n this._errorToken(this._lookaheadToken(0));\n\n }\n },\n _match: function _match(tokenType) {\n if (this._lookahead(0) === tokenType) {\n this._advance();\n } else {\n var t = this._lookaheadToken(0);\n\n var error = new Error(\"Expected \" + tokenType + \", got: \" + t.type);\n error.name = \"ParserError\";\n throw error;\n }\n },\n _errorToken: function _errorToken(token) {\n var error = new Error(\"Invalid token (\" + token.type + \"): \\\"\" + token.value + \"\\\"\");\n error.name = \"ParserError\";\n throw error;\n },\n _parseIndexExpression: function _parseIndexExpression() {\n if (this._lookahead(0) === TOK_COLON || this._lookahead(1) === TOK_COLON) {\n return this._parseSliceExpression();\n } else {\n var node = {\n type: \"Index\",\n value: this._lookaheadToken(0).value\n };\n\n this._advance();\n\n this._match(TOK_RBRACKET);\n\n return node;\n }\n },\n _projectIfSlice: function _projectIfSlice(left, right) {\n var indexExpr = {\n type: \"IndexExpression\",\n children: [left, right]\n };\n\n if (right.type === \"Slice\") {\n return {\n type: \"Projection\",\n children: [indexExpr, this._parseProjectionRHS(bindingPower.Star)]\n };\n } else {\n return indexExpr;\n }\n },\n _parseSliceExpression: function _parseSliceExpression() {\n // [start:end:step] where each part is optional, as well as the last\n // colon.\n var parts = [null, null, null];\n var index = 0;\n\n var currentToken = this._lookahead(0);\n\n while (currentToken !== TOK_RBRACKET && index < 3) {\n if (currentToken === TOK_COLON) {\n index++;\n\n this._advance();\n } else if (currentToken === TOK_NUMBER) {\n parts[index] = this._lookaheadToken(0).value;\n\n this._advance();\n } else {\n var t = this._lookahead(0);\n\n var error = new Error(\"Syntax error, unexpected token: \" + t.value + \"(\" + t.type + \")\");\n error.name = \"Parsererror\";\n throw error;\n }\n\n currentToken = this._lookahead(0);\n }\n\n this._match(TOK_RBRACKET);\n\n return {\n type: \"Slice\",\n children: parts\n };\n },\n _parseComparator: function _parseComparator(left, comparator) {\n var right = this.expression(bindingPower[comparator]);\n return {\n type: \"Comparator\",\n name: comparator,\n children: [left, right]\n };\n },\n _parseDotRHS: function _parseDotRHS(rbp) {\n var lookahead = this._lookahead(0);\n\n var exprTokens = [TOK_UNQUOTEDIDENTIFIER, TOK_QUOTEDIDENTIFIER, TOK_STAR];\n\n if (exprTokens.indexOf(lookahead) >= 0) {\n return this.expression(rbp);\n } else if (lookahead === TOK_LBRACKET) {\n this._match(TOK_LBRACKET);\n\n return this._parseMultiselectList();\n } else if (lookahead === TOK_LBRACE) {\n this._match(TOK_LBRACE);\n\n return this._parseMultiselectHash();\n }\n },\n _parseProjectionRHS: function _parseProjectionRHS(rbp) {\n var right;\n\n if (bindingPower[this._lookahead(0)] < 10) {\n right = {\n type: \"Identity\"\n };\n } else if (this._lookahead(0) === TOK_LBRACKET) {\n right = this.expression(rbp);\n } else if (this._lookahead(0) === TOK_FILTER) {\n right = this.expression(rbp);\n } else if (this._lookahead(0) === TOK_DOT) {\n this._match(TOK_DOT);\n\n right = this._parseDotRHS(rbp);\n } else {\n var t = this._lookaheadToken(0);\n\n var error = new Error(\"Sytanx error, unexpected token: \" + t.value + \"(\" + t.type + \")\");\n error.name = \"ParserError\";\n throw error;\n }\n\n return right;\n },\n _parseMultiselectList: function _parseMultiselectList() {\n var expressions = [];\n\n while (this._lookahead(0) !== TOK_RBRACKET) {\n var expression = this.expression(0);\n expressions.push(expression);\n\n if (this._lookahead(0) === TOK_COMMA) {\n this._match(TOK_COMMA);\n\n if (this._lookahead(0) === TOK_RBRACKET) {\n throw new Error(\"Unexpected token Rbracket\");\n }\n }\n }\n\n this._match(TOK_RBRACKET);\n\n return {\n type: \"MultiSelectList\",\n children: expressions\n };\n },\n _parseMultiselectHash: function _parseMultiselectHash() {\n var pairs = [];\n var identifierTypes = [TOK_UNQUOTEDIDENTIFIER, TOK_QUOTEDIDENTIFIER];\n var keyToken, keyName, value, node;\n\n for (;;) {\n keyToken = this._lookaheadToken(0);\n\n if (identifierTypes.indexOf(keyToken.type) < 0) {\n throw new Error(\"Expecting an identifier token, got: \" + keyToken.type);\n }\n\n keyName = keyToken.value;\n\n this._advance();\n\n this._match(TOK_COLON);\n\n value = this.expression(0);\n node = {\n type: \"KeyValuePair\",\n name: keyName,\n value: value\n };\n pairs.push(node);\n\n if (this._lookahead(0) === TOK_COMMA) {\n this._match(TOK_COMMA);\n } else if (this._lookahead(0) === TOK_RBRACE) {\n this._match(TOK_RBRACE);\n\n break;\n }\n }\n\n return {\n type: \"MultiSelectHash\",\n children: pairs\n };\n }\n };\n\n function TreeInterpreter(runtime) {\n this.runtime = runtime;\n }\n\n TreeInterpreter.prototype = {\n search: function search(node, value) {\n return this.visit(node, value);\n },\n visit: function visit(node, value) {\n var matched, current, result, first, second, field, left, right, collected, i;\n\n switch (node.type) {\n case \"Field\":\n if (value === null) {\n return null;\n } else if (isObject(value)) {\n field = value[node.name];\n\n if (field === undefined) {\n return null;\n } else {\n return field;\n }\n } else {\n return null;\n }\n\n break;\n\n case \"Subexpression\":\n result = this.visit(node.children[0], value);\n\n for (i = 1; i < node.children.length; i++) {\n result = this.visit(node.children[1], result);\n\n if (result === null) {\n return null;\n }\n }\n\n return result;\n\n case \"IndexExpression\":\n left = this.visit(node.children[0], value);\n right = this.visit(node.children[1], left);\n return right;\n\n case \"Index\":\n if (!isArray(value)) {\n return null;\n }\n\n var index = node.value;\n\n if (index < 0) {\n index = value.length + index;\n }\n\n result = value[index];\n\n if (result === undefined) {\n result = null;\n }\n\n return result;\n\n case \"Slice\":\n if (!isArray(value)) {\n return null;\n }\n\n var sliceParams = node.children.slice(0);\n var computed = this.computeSliceParams(value.length, sliceParams);\n var start = computed[0];\n var stop = computed[1];\n var step = computed[2];\n result = [];\n\n if (step > 0) {\n for (i = start; i < stop; i += step) {\n result.push(value[i]);\n }\n } else {\n for (i = start; i > stop; i += step) {\n result.push(value[i]);\n }\n }\n\n return result;\n\n case \"Projection\":\n // Evaluate left child.\n var base = this.visit(node.children[0], value);\n\n if (!isArray(base)) {\n return null;\n }\n\n collected = [];\n\n for (i = 0; i < base.length; i++) {\n current = this.visit(node.children[1], base[i]);\n\n if (current !== null) {\n collected.push(current);\n }\n }\n\n return collected;\n\n case \"ValueProjection\":\n // Evaluate left child.\n base = this.visit(node.children[0], value);\n\n if (!isObject(base)) {\n return null;\n }\n\n collected = [];\n var values = objValues(base);\n\n for (i = 0; i < values.length; i++) {\n current = this.visit(node.children[1], values[i]);\n\n if (current !== null) {\n collected.push(current);\n }\n }\n\n return collected;\n\n case \"FilterProjection\":\n base = this.visit(node.children[0], value);\n\n if (!isArray(base)) {\n return null;\n }\n\n var filtered = [];\n var finalResults = [];\n\n for (i = 0; i < base.length; i++) {\n matched = this.visit(node.children[2], base[i]);\n\n if (!isFalse(matched)) {\n filtered.push(base[i]);\n }\n }\n\n for (var j = 0; j < filtered.length; j++) {\n current = this.visit(node.children[1], filtered[j]);\n\n if (current !== null) {\n finalResults.push(current);\n }\n }\n\n return finalResults;\n\n case \"Comparator\":\n first = this.visit(node.children[0], value);\n second = this.visit(node.children[1], value);\n\n switch (node.name) {\n case TOK_EQ:\n result = strictDeepEqual(first, second);\n break;\n\n case TOK_NE:\n result = !strictDeepEqual(first, second);\n break;\n\n case TOK_GT:\n result = first > second;\n break;\n\n case TOK_GTE:\n result = first >= second;\n break;\n\n case TOK_LT:\n result = first < second;\n break;\n\n case TOK_LTE:\n result = first <= second;\n break;\n\n default:\n throw new Error(\"Unknown comparator: \" + node.name);\n }\n\n return result;\n\n case TOK_FLATTEN:\n var original = this.visit(node.children[0], value);\n\n if (!isArray(original)) {\n return null;\n }\n\n var merged = [];\n\n for (i = 0; i < original.length; i++) {\n current = original[i];\n\n if (isArray(current)) {\n merged.push.apply(merged, current);\n } else {\n merged.push(current);\n }\n }\n\n return merged;\n\n case \"Identity\":\n return value;\n\n case \"MultiSelectList\":\n if (value === null) {\n return null;\n }\n\n collected = [];\n\n for (i = 0; i < node.children.length; i++) {\n collected.push(this.visit(node.children[i], value));\n }\n\n return collected;\n\n case \"MultiSelectHash\":\n if (value === null) {\n return null;\n }\n\n collected = {};\n var child;\n\n for (i = 0; i < node.children.length; i++) {\n child = node.children[i];\n collected[child.name] = this.visit(child.value, value);\n }\n\n return collected;\n\n case \"OrExpression\":\n matched = this.visit(node.children[0], value);\n\n if (isFalse(matched)) {\n matched = this.visit(node.children[1], value);\n }\n\n return matched;\n\n case \"AndExpression\":\n first = this.visit(node.children[0], value);\n\n if (isFalse(first) === true) {\n return first;\n }\n\n return this.visit(node.children[1], value);\n\n case \"NotExpression\":\n first = this.visit(node.children[0], value);\n return isFalse(first);\n\n case \"Literal\":\n return node.value;\n\n case TOK_PIPE:\n left = this.visit(node.children[0], value);\n return this.visit(node.children[1], left);\n\n case TOK_CURRENT:\n return value;\n\n case \"Function\":\n var resolvedArgs = [];\n\n for (i = 0; i < node.children.length; i++) {\n resolvedArgs.push(this.visit(node.children[i], value));\n }\n\n return this.runtime.callFunction(node.name, resolvedArgs);\n\n case \"ExpressionReference\":\n var refNode = node.children[0]; // Tag the node with a specific attribute so the type\n // checker verify the type.\n\n refNode.jmespathType = TOK_EXPREF;\n return refNode;\n\n default:\n throw new Error(\"Unknown node type: \" + node.type);\n }\n },\n computeSliceParams: function computeSliceParams(arrayLength, sliceParams) {\n var start = sliceParams[0];\n var stop = sliceParams[1];\n var step = sliceParams[2];\n var computed = [null, null, null];\n\n if (step === null) {\n step = 1;\n } else if (step === 0) {\n var error = new Error(\"Invalid slice, step cannot be 0\");\n error.name = \"RuntimeError\";\n throw error;\n }\n\n var stepValueNegative = step < 0 ? true : false;\n\n if (start === null) {\n start = stepValueNegative ? arrayLength - 1 : 0;\n } else {\n start = this.capSliceRange(arrayLength, start, step);\n }\n\n if (stop === null) {\n stop = stepValueNegative ? -1 : arrayLength;\n } else {\n stop = this.capSliceRange(arrayLength, stop, step);\n }\n\n computed[0] = start;\n computed[1] = stop;\n computed[2] = step;\n return computed;\n },\n capSliceRange: function capSliceRange(arrayLength, actualValue, step) {\n if (actualValue < 0) {\n actualValue += arrayLength;\n\n if (actualValue < 0) {\n actualValue = step < 0 ? -1 : 0;\n }\n } else if (actualValue >= arrayLength) {\n actualValue = step < 0 ? arrayLength - 1 : arrayLength;\n }\n\n return actualValue;\n }\n };\n\n function Runtime(interpreter) {\n this._interpreter = interpreter;\n this.functionTable = {\n // name: [function, ]\n // The can be:\n //\n // {\n // args: [[type1, type2], [type1, type2]],\n // variadic: true|false\n // }\n //\n // Each arg in the arg list is a list of valid types\n // (if the function is overloaded and supports multiple\n // types. If the type is \"any\" then no type checking\n // occurs on the argument. Variadic is optional\n // and if not provided is assumed to be false.\n abs: {\n _func: this._functionAbs,\n _signature: [{\n types: [TYPE_NUMBER]\n }]\n },\n avg: {\n _func: this._functionAvg,\n _signature: [{\n types: [TYPE_ARRAY_NUMBER]\n }]\n },\n ceil: {\n _func: this._functionCeil,\n _signature: [{\n types: [TYPE_NUMBER]\n }]\n },\n contains: {\n _func: this._functionContains,\n _signature: [{\n types: [TYPE_STRING, TYPE_ARRAY]\n }, {\n types: [TYPE_ANY]\n }]\n },\n \"ends_with\": {\n _func: this._functionEndsWith,\n _signature: [{\n types: [TYPE_STRING]\n }, {\n types: [TYPE_STRING]\n }]\n },\n floor: {\n _func: this._functionFloor,\n _signature: [{\n types: [TYPE_NUMBER]\n }]\n },\n length: {\n _func: this._functionLength,\n _signature: [{\n types: [TYPE_STRING, TYPE_ARRAY, TYPE_OBJECT]\n }]\n },\n map: {\n _func: this._functionMap,\n _signature: [{\n types: [TYPE_EXPREF]\n }, {\n types: [TYPE_ARRAY]\n }]\n },\n max: {\n _func: this._functionMax,\n _signature: [{\n types: [TYPE_ARRAY_NUMBER, TYPE_ARRAY_STRING]\n }]\n },\n \"merge\": {\n _func: this._functionMerge,\n _signature: [{\n types: [TYPE_OBJECT],\n variadic: true\n }]\n },\n \"max_by\": {\n _func: this._functionMaxBy,\n _signature: [{\n types: [TYPE_ARRAY]\n }, {\n types: [TYPE_EXPREF]\n }]\n },\n sum: {\n _func: this._functionSum,\n _signature: [{\n types: [TYPE_ARRAY_NUMBER]\n }]\n },\n \"starts_with\": {\n _func: this._functionStartsWith,\n _signature: [{\n types: [TYPE_STRING]\n }, {\n types: [TYPE_STRING]\n }]\n },\n min: {\n _func: this._functionMin,\n _signature: [{\n types: [TYPE_ARRAY_NUMBER, TYPE_ARRAY_STRING]\n }]\n },\n \"min_by\": {\n _func: this._functionMinBy,\n _signature: [{\n types: [TYPE_ARRAY]\n }, {\n types: [TYPE_EXPREF]\n }]\n },\n type: {\n _func: this._functionType,\n _signature: [{\n types: [TYPE_ANY]\n }]\n },\n keys: {\n _func: this._functionKeys,\n _signature: [{\n types: [TYPE_OBJECT]\n }]\n },\n values: {\n _func: this._functionValues,\n _signature: [{\n types: [TYPE_OBJECT]\n }]\n },\n sort: {\n _func: this._functionSort,\n _signature: [{\n types: [TYPE_ARRAY_STRING, TYPE_ARRAY_NUMBER]\n }]\n },\n \"sort_by\": {\n _func: this._functionSortBy,\n _signature: [{\n types: [TYPE_ARRAY]\n }, {\n types: [TYPE_EXPREF]\n }]\n },\n join: {\n _func: this._functionJoin,\n _signature: [{\n types: [TYPE_STRING]\n }, {\n types: [TYPE_ARRAY_STRING]\n }]\n },\n reverse: {\n _func: this._functionReverse,\n _signature: [{\n types: [TYPE_STRING, TYPE_ARRAY]\n }]\n },\n \"to_array\": {\n _func: this._functionToArray,\n _signature: [{\n types: [TYPE_ANY]\n }]\n },\n \"to_string\": {\n _func: this._functionToString,\n _signature: [{\n types: [TYPE_ANY]\n }]\n },\n \"to_number\": {\n _func: this._functionToNumber,\n _signature: [{\n types: [TYPE_ANY]\n }]\n },\n \"not_null\": {\n _func: this._functionNotNull,\n _signature: [{\n types: [TYPE_ANY],\n variadic: true\n }]\n }\n };\n }\n\n Runtime.prototype = {\n callFunction: function callFunction(name, resolvedArgs) {\n var functionEntry = this.functionTable[name];\n\n if (functionEntry === undefined) {\n throw new Error(\"Unknown function: \" + name + \"()\");\n }\n\n this._validateArgs(name, resolvedArgs, functionEntry._signature);\n\n return functionEntry._func.call(this, resolvedArgs);\n },\n _validateArgs: function _validateArgs(name, args, signature) {\n // Validating the args requires validating\n // the correct arity and the correct type of each arg.\n // If the last argument is declared as variadic, then we need\n // a minimum number of args to be required. Otherwise it has to\n // be an exact amount.\n var pluralized;\n\n if (signature[signature.length - 1].variadic) {\n if (args.length < signature.length) {\n pluralized = signature.length === 1 ? \" argument\" : \" arguments\";\n throw new Error(\"ArgumentError: \" + name + \"() \" + \"takes at least\" + signature.length + pluralized + \" but received \" + args.length);\n }\n } else if (args.length !== signature.length) {\n pluralized = signature.length === 1 ? \" argument\" : \" arguments\";\n throw new Error(\"ArgumentError: \" + name + \"() \" + \"takes \" + signature.length + pluralized + \" but received \" + args.length);\n }\n\n var currentSpec;\n var actualType;\n var typeMatched;\n\n for (var i = 0; i < signature.length; i++) {\n typeMatched = false;\n currentSpec = signature[i].types;\n actualType = this._getTypeName(args[i]);\n\n for (var j = 0; j < currentSpec.length; j++) {\n if (this._typeMatches(actualType, currentSpec[j], args[i])) {\n typeMatched = true;\n break;\n }\n }\n\n if (!typeMatched) {\n throw new Error(\"TypeError: \" + name + \"() \" + \"expected argument \" + (i + 1) + \" to be type \" + currentSpec + \" but received type \" + actualType + \" instead.\");\n }\n }\n },\n _typeMatches: function _typeMatches(actual, expected, argValue) {\n if (expected === TYPE_ANY) {\n return true;\n }\n\n if (expected === TYPE_ARRAY_STRING || expected === TYPE_ARRAY_NUMBER || expected === TYPE_ARRAY) {\n // The expected type can either just be array,\n // or it can require a specific subtype (array of numbers).\n //\n // The simplest case is if \"array\" with no subtype is specified.\n if (expected === TYPE_ARRAY) {\n return actual === TYPE_ARRAY;\n } else if (actual === TYPE_ARRAY) {\n // Otherwise we need to check subtypes.\n // I think this has potential to be improved.\n var subtype;\n\n if (expected === TYPE_ARRAY_NUMBER) {\n subtype = TYPE_NUMBER;\n } else if (expected === TYPE_ARRAY_STRING) {\n subtype = TYPE_STRING;\n }\n\n for (var i = 0; i < argValue.length; i++) {\n if (!this._typeMatches(this._getTypeName(argValue[i]), subtype, argValue[i])) {\n return false;\n }\n }\n\n return true;\n }\n } else {\n return actual === expected;\n }\n },\n _getTypeName: function _getTypeName(obj) {\n switch (Object.prototype.toString.call(obj)) {\n case \"[object String]\":\n return TYPE_STRING;\n\n case \"[object Number]\":\n return TYPE_NUMBER;\n\n case \"[object Array]\":\n return TYPE_ARRAY;\n\n case \"[object Boolean]\":\n return TYPE_BOOLEAN;\n\n case \"[object Null]\":\n return TYPE_NULL;\n\n case \"[object Object]\":\n // Check if it's an expref. If it has, it's been\n // tagged with a jmespathType attr of 'Expref';\n if (obj.jmespathType === TOK_EXPREF) {\n return TYPE_EXPREF;\n } else {\n return TYPE_OBJECT;\n }\n\n }\n },\n _functionStartsWith: function _functionStartsWith(resolvedArgs) {\n return resolvedArgs[0].lastIndexOf(resolvedArgs[1]) === 0;\n },\n _functionEndsWith: function _functionEndsWith(resolvedArgs) {\n var searchStr = resolvedArgs[0];\n var suffix = resolvedArgs[1];\n return searchStr.indexOf(suffix, searchStr.length - suffix.length) !== -1;\n },\n _functionReverse: function _functionReverse(resolvedArgs) {\n var typeName = this._getTypeName(resolvedArgs[0]);\n\n if (typeName === TYPE_STRING) {\n var originalStr = resolvedArgs[0];\n var reversedStr = \"\";\n\n for (var i = originalStr.length - 1; i >= 0; i--) {\n reversedStr += originalStr[i];\n }\n\n return reversedStr;\n } else {\n var reversedArray = resolvedArgs[0].slice(0);\n reversedArray.reverse();\n return reversedArray;\n }\n },\n _functionAbs: function _functionAbs(resolvedArgs) {\n return Math.abs(resolvedArgs[0]);\n },\n _functionCeil: function _functionCeil(resolvedArgs) {\n return Math.ceil(resolvedArgs[0]);\n },\n _functionAvg: function _functionAvg(resolvedArgs) {\n var sum = 0;\n var inputArray = resolvedArgs[0];\n\n for (var i = 0; i < inputArray.length; i++) {\n sum += inputArray[i];\n }\n\n return sum / inputArray.length;\n },\n _functionContains: function _functionContains(resolvedArgs) {\n return resolvedArgs[0].indexOf(resolvedArgs[1]) >= 0;\n },\n _functionFloor: function _functionFloor(resolvedArgs) {\n return Math.floor(resolvedArgs[0]);\n },\n _functionLength: function _functionLength(resolvedArgs) {\n if (!isObject(resolvedArgs[0])) {\n return resolvedArgs[0].length;\n } else {\n // As far as I can tell, there's no way to get the length\n // of an object without O(n) iteration through the object.\n return Object.keys(resolvedArgs[0]).length;\n }\n },\n _functionMap: function _functionMap(resolvedArgs) {\n var mapped = [];\n var interpreter = this._interpreter;\n var exprefNode = resolvedArgs[0];\n var elements = resolvedArgs[1];\n\n for (var i = 0; i < elements.length; i++) {\n mapped.push(interpreter.visit(exprefNode, elements[i]));\n }\n\n return mapped;\n },\n _functionMerge: function _functionMerge(resolvedArgs) {\n var merged = {};\n\n for (var i = 0; i < resolvedArgs.length; i++) {\n var current = resolvedArgs[i];\n\n for (var key in current) {\n merged[key] = current[key];\n }\n }\n\n return merged;\n },\n _functionMax: function _functionMax(resolvedArgs) {\n if (resolvedArgs[0].length > 0) {\n var typeName = this._getTypeName(resolvedArgs[0][0]);\n\n if (typeName === TYPE_NUMBER) {\n return Math.max.apply(Math, resolvedArgs[0]);\n } else {\n var elements = resolvedArgs[0];\n var maxElement = elements[0];\n\n for (var i = 1; i < elements.length; i++) {\n if (maxElement.localeCompare(elements[i]) < 0) {\n maxElement = elements[i];\n }\n }\n\n return maxElement;\n }\n } else {\n return null;\n }\n },\n _functionMin: function _functionMin(resolvedArgs) {\n if (resolvedArgs[0].length > 0) {\n var typeName = this._getTypeName(resolvedArgs[0][0]);\n\n if (typeName === TYPE_NUMBER) {\n return Math.min.apply(Math, resolvedArgs[0]);\n } else {\n var elements = resolvedArgs[0];\n var minElement = elements[0];\n\n for (var i = 1; i < elements.length; i++) {\n if (elements[i].localeCompare(minElement) < 0) {\n minElement = elements[i];\n }\n }\n\n return minElement;\n }\n } else {\n return null;\n }\n },\n _functionSum: function _functionSum(resolvedArgs) {\n var sum = 0;\n var listToSum = resolvedArgs[0];\n\n for (var i = 0; i < listToSum.length; i++) {\n sum += listToSum[i];\n }\n\n return sum;\n },\n _functionType: function _functionType(resolvedArgs) {\n switch (this._getTypeName(resolvedArgs[0])) {\n case TYPE_NUMBER:\n return \"number\";\n\n case TYPE_STRING:\n return \"string\";\n\n case TYPE_ARRAY:\n return \"array\";\n\n case TYPE_OBJECT:\n return \"object\";\n\n case TYPE_BOOLEAN:\n return \"boolean\";\n\n case TYPE_EXPREF:\n return \"expref\";\n\n case TYPE_NULL:\n return \"null\";\n }\n },\n _functionKeys: function _functionKeys(resolvedArgs) {\n return Object.keys(resolvedArgs[0]);\n },\n _functionValues: function _functionValues(resolvedArgs) {\n var obj = resolvedArgs[0];\n var keys = Object.keys(obj);\n var values = [];\n\n for (var i = 0; i < keys.length; i++) {\n values.push(obj[keys[i]]);\n }\n\n return values;\n },\n _functionJoin: function _functionJoin(resolvedArgs) {\n var joinChar = resolvedArgs[0];\n var listJoin = resolvedArgs[1];\n return listJoin.join(joinChar);\n },\n _functionToArray: function _functionToArray(resolvedArgs) {\n if (this._getTypeName(resolvedArgs[0]) === TYPE_ARRAY) {\n return resolvedArgs[0];\n } else {\n return [resolvedArgs[0]];\n }\n },\n _functionToString: function _functionToString(resolvedArgs) {\n if (this._getTypeName(resolvedArgs[0]) === TYPE_STRING) {\n return resolvedArgs[0];\n } else {\n return JSON.stringify(resolvedArgs[0]);\n }\n },\n _functionToNumber: function _functionToNumber(resolvedArgs) {\n var typeName = this._getTypeName(resolvedArgs[0]);\n\n var convertedValue;\n\n if (typeName === TYPE_NUMBER) {\n return resolvedArgs[0];\n } else if (typeName === TYPE_STRING) {\n convertedValue = +resolvedArgs[0];\n\n if (!isNaN(convertedValue)) {\n return convertedValue;\n }\n }\n\n return null;\n },\n _functionNotNull: function _functionNotNull(resolvedArgs) {\n for (var i = 0; i < resolvedArgs.length; i++) {\n if (this._getTypeName(resolvedArgs[i]) !== TYPE_NULL) {\n return resolvedArgs[i];\n }\n }\n\n return null;\n },\n _functionSort: function _functionSort(resolvedArgs) {\n var sortedArray = resolvedArgs[0].slice(0);\n sortedArray.sort();\n return sortedArray;\n },\n _functionSortBy: function _functionSortBy(resolvedArgs) {\n var sortedArray = resolvedArgs[0].slice(0);\n\n if (sortedArray.length === 0) {\n return sortedArray;\n }\n\n var interpreter = this._interpreter;\n var exprefNode = resolvedArgs[1];\n\n var requiredType = this._getTypeName(interpreter.visit(exprefNode, sortedArray[0]));\n\n if ([TYPE_NUMBER, TYPE_STRING].indexOf(requiredType) < 0) {\n throw new Error(\"TypeError\");\n }\n\n var that = this; // In order to get a stable sort out of an unstable\n // sort algorithm, we decorate/sort/undecorate (DSU)\n // by creating a new list of [index, element] pairs.\n // In the cmp function, if the evaluated elements are\n // equal, then the index will be used as the tiebreaker.\n // After the decorated list has been sorted, it will be\n // undecorated to extract the original elements.\n\n var decorated = [];\n\n for (var i = 0; i < sortedArray.length; i++) {\n decorated.push([i, sortedArray[i]]);\n }\n\n decorated.sort(function (a, b) {\n var exprA = interpreter.visit(exprefNode, a[1]);\n var exprB = interpreter.visit(exprefNode, b[1]);\n\n if (that._getTypeName(exprA) !== requiredType) {\n throw new Error(\"TypeError: expected \" + requiredType + \", received \" + that._getTypeName(exprA));\n } else if (that._getTypeName(exprB) !== requiredType) {\n throw new Error(\"TypeError: expected \" + requiredType + \", received \" + that._getTypeName(exprB));\n }\n\n if (exprA > exprB) {\n return 1;\n } else if (exprA < exprB) {\n return -1;\n } else {\n // If they're equal compare the items by their\n // order to maintain relative order of equal keys\n // (i.e. to get a stable sort).\n return a[0] - b[0];\n }\n }); // Undecorate: extract out the original list elements.\n\n for (var j = 0; j < decorated.length; j++) {\n sortedArray[j] = decorated[j][1];\n }\n\n return sortedArray;\n },\n _functionMaxBy: function _functionMaxBy(resolvedArgs) {\n var exprefNode = resolvedArgs[1];\n var resolvedArray = resolvedArgs[0];\n var keyFunction = this.createKeyFunction(exprefNode, [TYPE_NUMBER, TYPE_STRING]);\n var maxNumber = -Infinity;\n var maxRecord;\n var current;\n\n for (var i = 0; i < resolvedArray.length; i++) {\n current = keyFunction(resolvedArray[i]);\n\n if (current > maxNumber) {\n maxNumber = current;\n maxRecord = resolvedArray[i];\n }\n }\n\n return maxRecord;\n },\n _functionMinBy: function _functionMinBy(resolvedArgs) {\n var exprefNode = resolvedArgs[1];\n var resolvedArray = resolvedArgs[0];\n var keyFunction = this.createKeyFunction(exprefNode, [TYPE_NUMBER, TYPE_STRING]);\n var minNumber = Infinity;\n var minRecord;\n var current;\n\n for (var i = 0; i < resolvedArray.length; i++) {\n current = keyFunction(resolvedArray[i]);\n\n if (current < minNumber) {\n minNumber = current;\n minRecord = resolvedArray[i];\n }\n }\n\n return minRecord;\n },\n createKeyFunction: function createKeyFunction(exprefNode, allowedTypes) {\n var that = this;\n var interpreter = this._interpreter;\n\n var keyFunc = function keyFunc(x) {\n var current = interpreter.visit(exprefNode, x);\n\n if (allowedTypes.indexOf(that._getTypeName(current)) < 0) {\n var msg = \"TypeError: expected one of \" + allowedTypes + \", received \" + that._getTypeName(current);\n\n throw new Error(msg);\n }\n\n return current;\n };\n\n return keyFunc;\n }\n };\n\n function compile(stream) {\n var parser = new Parser();\n var ast = parser.parse(stream);\n return ast;\n }\n\n function tokenize(stream) {\n var lexer = new Lexer();\n return lexer.tokenize(stream);\n }\n\n function search(data, expression) {\n var parser = new Parser(); // This needs to be improved. Both the interpreter and runtime depend on\n // each other. The runtime needs the interpreter to support exprefs.\n // There's likely a clean way to avoid the cyclic dependency.\n\n var runtime = new Runtime();\n var interpreter = new TreeInterpreter(runtime);\n runtime._interpreter = interpreter;\n var node = parser.parse(expression);\n return interpreter.search(node, data);\n }\n\n exports.tokenize = tokenize;\n exports.compile = compile;\n exports.search = search;\n exports.strictDeepEqual = strictDeepEqual;\n})(typeof exports === \"undefined\" ? this.jmespath = {} : exports);","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n'use strict';\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar punycode = require('punycode');\n\nvar util = require('./util');\n\nexports.parse = urlParse;\nexports.resolve = urlResolve;\nexports.resolveObject = urlResolveObject;\nexports.format = urlFormat;\nexports.Url = Url;\n\nfunction Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.host = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.query = null;\n this.pathname = null;\n this.path = null;\n this.href = null;\n} // Reference: RFC 3986, RFC 1808, RFC 2396\n// define these here so at least they only have to be\n// compiled once on the first module load.\n\n\nvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n portPattern = /:[0-9]*$/,\n // Special case for a simple path URL\nsimplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n // RFC 2396: characters reserved for delimiting URLs.\n// We actually just auto-escape these.\ndelims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n // RFC 2396: characters not allowed for various reasons.\nunwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n // Allowed by RFCs, but cause of XSS attacks. Always escape these.\nautoEscape = ['\\''].concat(unwise),\n // Characters that are never ever allowed in a hostname.\n// Note that any invalid chars are also handled, but these\n// are the ones that are *expected* to be seen, so we fast-path\n// them.\nnonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n hostEndingChars = ['/', '?', '#'],\n hostnameMaxLen = 255,\n hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n // protocols that can allow \"unsafe\" and \"unwise\" chars.\nunsafeProtocol = {\n 'javascript': true,\n 'javascript:': true\n},\n // protocols that never have a hostname.\nhostlessProtocol = {\n 'javascript': true,\n 'javascript:': true\n},\n // protocols that always contain a // bit.\nslashedProtocol = {\n 'http': true,\n 'https': true,\n 'ftp': true,\n 'gopher': true,\n 'file': true,\n 'http:': true,\n 'https:': true,\n 'ftp:': true,\n 'gopher:': true,\n 'file:': true\n},\n querystring = require('querystring');\n\nfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n if (url && util.isObject(url) && url instanceof Url) return url;\n var u = new Url();\n u.parse(url, parseQueryString, slashesDenoteHost);\n return u;\n}\n\nUrl.prototype.parse = function (url, parseQueryString, slashesDenoteHost) {\n if (!util.isString(url)) {\n throw new TypeError(\"Parameter 'url' must be a string, not \" + _typeof(url));\n } // Copy chrome, IE, opera backslash-handling behavior.\n // Back slashes before the query string get converted to forward slashes\n // See: https://code.google.com/p/chromium/issues/detail?id=25916\n\n\n var queryIndex = url.indexOf('?'),\n splitter = queryIndex !== -1 && queryIndex < url.indexOf('#') ? '?' : '#',\n uSplit = url.split(splitter),\n slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, '/');\n url = uSplit.join(splitter);\n var rest = url; // trim before proceeding.\n // This is to support parse stuff like \" http://foo.com \\n\"\n\n rest = rest.trim();\n\n if (!slashesDenoteHost && url.split('#').length === 1) {\n // Try fast path regexp\n var simplePath = simplePathPattern.exec(rest);\n\n if (simplePath) {\n this.path = rest;\n this.href = rest;\n this.pathname = simplePath[1];\n\n if (simplePath[2]) {\n this.search = simplePath[2];\n\n if (parseQueryString) {\n this.query = querystring.parse(this.search.substr(1));\n } else {\n this.query = this.search.substr(1);\n }\n } else if (parseQueryString) {\n this.search = '';\n this.query = {};\n }\n\n return this;\n }\n }\n\n var proto = protocolPattern.exec(rest);\n\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto;\n rest = rest.substr(proto.length);\n } // figure out if it's got a host\n // user@server is *always* interpreted as a hostname, and url\n // resolution will treat //foo/bar as host=foo,path=bar because that's\n // how the browser resolves relative URLs.\n\n\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n var slashes = rest.substr(0, 2) === '//';\n\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2);\n this.slashes = true;\n }\n }\n\n if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {\n // there's a hostname.\n // the first instance of /, ?, ;, or # ends the host.\n //\n // If there is an @ in the hostname, then non-host chars *are* allowed\n // to the left of the last @ sign, unless some host-ending character\n // comes *before* the @-sign.\n // URLs are obnoxious.\n //\n // ex:\n // http://a@b@c/ => user:a@b host:c\n // http://a@b?@c => user:a host:c path:/?@c\n // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n // Review our test case against browsers more comprehensively.\n // find the first instance of any hostEndingChars\n var hostEnd = -1;\n\n for (var i = 0; i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec;\n } // at this point, either we have an explicit point where the\n // auth portion cannot go past, or the last @ char is the decider.\n\n\n var auth, atSign;\n\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf('@');\n } else {\n // atSign must be in auth portion.\n // http://a@b/c@d => host:b auth:a path:/c@d\n atSign = rest.lastIndexOf('@', hostEnd);\n } // Now we have a portion which is definitely the auth.\n // Pull that off.\n\n\n if (atSign !== -1) {\n auth = rest.slice(0, atSign);\n rest = rest.slice(atSign + 1);\n this.auth = decodeURIComponent(auth);\n } // the host is the remaining to the left of the first non-host char\n\n\n hostEnd = -1;\n\n for (var i = 0; i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec;\n } // if we still have not hit it, then the entire thing is a host.\n\n\n if (hostEnd === -1) hostEnd = rest.length;\n this.host = rest.slice(0, hostEnd);\n rest = rest.slice(hostEnd); // pull out port.\n\n this.parseHost(); // we've indicated that there is a hostname,\n // so even if it's empty, it has to be present.\n\n this.hostname = this.hostname || ''; // if hostname begins with [ and ends with ]\n // assume that it's an IPv6 address.\n\n var ipv6Hostname = this.hostname[0] === '[' && this.hostname[this.hostname.length - 1] === ']'; // validate a little.\n\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n\n for (var i = 0, l = hostparts.length; i < l; i++) {\n var part = hostparts[i];\n if (!part) continue;\n\n if (!part.match(hostnamePartPattern)) {\n var newpart = '';\n\n for (var j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n // we replace non-ASCII char with a temporary placeholder\n // we need this to make sure size of hostname is not\n // broken by replacing non-ASCII by nothing\n newpart += 'x';\n } else {\n newpart += part[j];\n }\n } // we test again with ASCII char only\n\n\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i);\n var notHost = hostparts.slice(i + 1);\n var bit = part.match(hostnamePartStart);\n\n if (bit) {\n validParts.push(bit[1]);\n notHost.unshift(bit[2]);\n }\n\n if (notHost.length) {\n rest = '/' + notHost.join('.') + rest;\n }\n\n this.hostname = validParts.join('.');\n break;\n }\n }\n }\n }\n\n if (this.hostname.length > hostnameMaxLen) {\n this.hostname = '';\n } else {\n // hostnames are always lower case.\n this.hostname = this.hostname.toLowerCase();\n }\n\n if (!ipv6Hostname) {\n // IDNA Support: Returns a punycoded representation of \"domain\".\n // It only converts parts of the domain name that\n // have non-ASCII characters, i.e. it doesn't matter if\n // you call it with a domain that already is ASCII-only.\n this.hostname = punycode.toASCII(this.hostname);\n }\n\n var p = this.port ? ':' + this.port : '';\n var h = this.hostname || '';\n this.host = h + p;\n this.href += this.host; // strip [ and ] from the hostname\n // the host field still retains them, though\n\n if (ipv6Hostname) {\n this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n\n if (rest[0] !== '/') {\n rest = '/' + rest;\n }\n }\n } // now rest is set to the post-host stuff.\n // chop off any delim chars.\n\n\n if (!unsafeProtocol[lowerProto]) {\n // First, make 100% sure that any \"autoEscape\" chars get\n // escaped, even if encodeURIComponent doesn't think they\n // need to be.\n for (var i = 0, l = autoEscape.length; i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1) continue;\n var esc = encodeURIComponent(ae);\n\n if (esc === ae) {\n esc = escape(ae);\n }\n\n rest = rest.split(ae).join(esc);\n }\n } // chop off from the tail first.\n\n\n var hash = rest.indexOf('#');\n\n if (hash !== -1) {\n // got a fragment string.\n this.hash = rest.substr(hash);\n rest = rest.slice(0, hash);\n }\n\n var qm = rest.indexOf('?');\n\n if (qm !== -1) {\n this.search = rest.substr(qm);\n this.query = rest.substr(qm + 1);\n\n if (parseQueryString) {\n this.query = querystring.parse(this.query);\n }\n\n rest = rest.slice(0, qm);\n } else if (parseQueryString) {\n // no query string, but parseQueryString still requested\n this.search = '';\n this.query = {};\n }\n\n if (rest) this.pathname = rest;\n\n if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) {\n this.pathname = '/';\n } //to support http.request\n\n\n if (this.pathname || this.search) {\n var p = this.pathname || '';\n var s = this.search || '';\n this.path = p + s;\n } // finally, reconstruct the href based on what has been validated.\n\n\n this.href = this.format();\n return this;\n}; // format a parsed object into a url string\n\n\nfunction urlFormat(obj) {\n // ensure it's an object, and not a string url.\n // If it's an obj, this is a no-op.\n // this way, you can call url_format() on strings\n // to clean up potentially wonky urls.\n if (util.isString(obj)) obj = urlParse(obj);\n if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n return obj.format();\n}\n\nUrl.prototype.format = function () {\n var auth = this.auth || '';\n\n if (auth) {\n auth = encodeURIComponent(auth);\n auth = auth.replace(/%3A/i, ':');\n auth += '@';\n }\n\n var protocol = this.protocol || '',\n pathname = this.pathname || '',\n hash = this.hash || '',\n host = false,\n query = '';\n\n if (this.host) {\n host = auth + this.host;\n } else if (this.hostname) {\n host = auth + (this.hostname.indexOf(':') === -1 ? this.hostname : '[' + this.hostname + ']');\n\n if (this.port) {\n host += ':' + this.port;\n }\n }\n\n if (this.query && util.isObject(this.query) && Object.keys(this.query).length) {\n query = querystring.stringify(this.query);\n }\n\n var search = this.search || query && '?' + query || '';\n if (protocol && protocol.substr(-1) !== ':') protocol += ':'; // only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n // unless they had them to begin with.\n\n if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) {\n host = '//' + (host || '');\n if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n } else if (!host) {\n host = '';\n }\n\n if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n if (search && search.charAt(0) !== '?') search = '?' + search;\n pathname = pathname.replace(/[?#]/g, function (match) {\n return encodeURIComponent(match);\n });\n search = search.replace('#', '%23');\n return protocol + host + pathname + search + hash;\n};\n\nfunction urlResolve(source, relative) {\n return urlParse(source, false, true).resolve(relative);\n}\n\nUrl.prototype.resolve = function (relative) {\n return this.resolveObject(urlParse(relative, false, true)).format();\n};\n\nfunction urlResolveObject(source, relative) {\n if (!source) return relative;\n return urlParse(source, false, true).resolveObject(relative);\n}\n\nUrl.prototype.resolveObject = function (relative) {\n if (util.isString(relative)) {\n var rel = new Url();\n rel.parse(relative, false, true);\n relative = rel;\n }\n\n var result = new Url();\n var tkeys = Object.keys(this);\n\n for (var tk = 0; tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n } // hash is always overridden, no matter what.\n // even href=\"\" will remove it.\n\n\n result.hash = relative.hash; // if the relative url is empty, then there's nothing left to do here.\n\n if (relative.href === '') {\n result.href = result.format();\n return result;\n } // hrefs like //foo/bar always cut to the protocol.\n\n\n if (relative.slashes && !relative.protocol) {\n // take everything except the protocol from relative\n var rkeys = Object.keys(relative);\n\n for (var rk = 0; rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== 'protocol') result[rkey] = relative[rkey];\n } //urlParse appends trailing / to urls like http://www.example.com\n\n\n if (slashedProtocol[result.protocol] && result.hostname && !result.pathname) {\n result.path = result.pathname = '/';\n }\n\n result.href = result.format();\n return result;\n }\n\n if (relative.protocol && relative.protocol !== result.protocol) {\n // if it's a known url protocol, then changing\n // the protocol does weird things\n // first, if it's not file:, then we MUST have a host,\n // and if there was a path\n // to begin with, then we MUST have a path.\n // if it is file:, then the host is dropped,\n // because that's known to be hostless.\n // anything else is assumed to be absolute.\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n\n for (var v = 0; v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n\n result.href = result.format();\n return result;\n }\n\n result.protocol = relative.protocol;\n\n if (!relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || '').split('/');\n\n while (relPath.length && !(relative.host = relPath.shift())) {\n ;\n }\n\n if (!relative.host) relative.host = '';\n if (!relative.hostname) relative.hostname = '';\n if (relPath[0] !== '') relPath.unshift('');\n if (relPath.length < 2) relPath.unshift('');\n result.pathname = relPath.join('/');\n } else {\n result.pathname = relative.pathname;\n }\n\n result.search = relative.search;\n result.query = relative.query;\n result.host = relative.host || '';\n result.auth = relative.auth;\n result.hostname = relative.hostname || relative.host;\n result.port = relative.port; // to support http.request\n\n if (result.pathname || result.search) {\n var p = result.pathname || '';\n var s = result.search || '';\n result.path = p + s;\n }\n\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n }\n\n var isSourceAbs = result.pathname && result.pathname.charAt(0) === '/',\n isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === '/',\n mustEndAbs = isRelAbs || isSourceAbs || result.host && relative.pathname,\n removeAllDots = mustEndAbs,\n srcPath = result.pathname && result.pathname.split('/') || [],\n relPath = relative.pathname && relative.pathname.split('/') || [],\n psychotic = result.protocol && !slashedProtocol[result.protocol]; // if the url is a non-slashed url, then relative\n // links like ../.. should be able\n // to crawl up to the hostname, as well. This is strange.\n // result.protocol has already been set by now.\n // Later on, put the first path part into the host field.\n\n if (psychotic) {\n result.hostname = '';\n result.port = null;\n\n if (result.host) {\n if (srcPath[0] === '') srcPath[0] = result.host;else srcPath.unshift(result.host);\n }\n\n result.host = '';\n\n if (relative.protocol) {\n relative.hostname = null;\n relative.port = null;\n\n if (relative.host) {\n if (relPath[0] === '') relPath[0] = relative.host;else relPath.unshift(relative.host);\n }\n\n relative.host = null;\n }\n\n mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n }\n\n if (isRelAbs) {\n // it's absolute.\n result.host = relative.host || relative.host === '' ? relative.host : result.host;\n result.hostname = relative.hostname || relative.hostname === '' ? relative.hostname : result.hostname;\n result.search = relative.search;\n result.query = relative.query;\n srcPath = relPath; // fall through to the dot-handling below.\n } else if (relPath.length) {\n // it's relative\n // throw away the existing file, and take the new path instead.\n if (!srcPath) srcPath = [];\n srcPath.pop();\n srcPath = srcPath.concat(relPath);\n result.search = relative.search;\n result.query = relative.query;\n } else if (!util.isNullOrUndefined(relative.search)) {\n // just pull out the search.\n // like href='?foo'.\n // Put this after the other two cases because it simplifies the booleans\n if (psychotic) {\n result.hostname = result.host = srcPath.shift(); //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\n var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false;\n\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n\n result.search = relative.search;\n result.query = relative.query; //to support http.request\n\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : '');\n }\n\n result.href = result.format();\n return result;\n }\n\n if (!srcPath.length) {\n // no path at all. easy.\n // we've already handled the other stuff above.\n result.pathname = null; //to support http.request\n\n if (result.search) {\n result.path = '/' + result.search;\n } else {\n result.path = null;\n }\n\n result.href = result.format();\n return result;\n } // if a url ENDs in . or .., then it must get a trailing slash.\n // however, if it ends in anything else non-slashy,\n // then it must NOT get a trailing slash.\n\n\n var last = srcPath.slice(-1)[0];\n var hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === '.' || last === '..') || last === ''; // strip single dots, resolve double dots to parent dir\n // if the path tries to go above the root, `up` ends up > 0\n\n var up = 0;\n\n for (var i = srcPath.length; i >= 0; i--) {\n last = srcPath[i];\n\n if (last === '.') {\n srcPath.splice(i, 1);\n } else if (last === '..') {\n srcPath.splice(i, 1);\n up++;\n } else if (up) {\n srcPath.splice(i, 1);\n up--;\n }\n } // if the path is allowed to go above the root, restore leading ..s\n\n\n if (!mustEndAbs && !removeAllDots) {\n for (; up--; up) {\n srcPath.unshift('..');\n }\n }\n\n if (mustEndAbs && srcPath[0] !== '' && (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n srcPath.unshift('');\n }\n\n if (hasTrailingSlash && srcPath.join('/').substr(-1) !== '/') {\n srcPath.push('');\n }\n\n var isAbsolute = srcPath[0] === '' || srcPath[0] && srcPath[0].charAt(0) === '/'; // put the host back\n\n if (psychotic) {\n result.hostname = result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : ''; //occationaly the auth can get stuck only in host\n //this especially happens in cases like\n //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n\n var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false;\n\n if (authInHost) {\n result.auth = authInHost.shift();\n result.host = result.hostname = authInHost.shift();\n }\n }\n\n mustEndAbs = mustEndAbs || result.host && srcPath.length;\n\n if (mustEndAbs && !isAbsolute) {\n srcPath.unshift('');\n }\n\n if (!srcPath.length) {\n result.pathname = null;\n result.path = null;\n } else {\n result.pathname = srcPath.join('/');\n } //to support request.http\n\n\n if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : '');\n }\n\n result.auth = relative.auth || result.auth;\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n};\n\nUrl.prototype.parseHost = function () {\n var host = this.host;\n var port = portPattern.exec(host);\n\n if (port) {\n port = port[0];\n\n if (port !== ':') {\n this.port = port.substr(1);\n }\n\n host = host.substr(0, host.length - port.length);\n }\n\n if (host) this.hostname = host;\n};","\"use strict\";\n/*\n * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar MIME_MAP = [{\n type: 'text/plain',\n ext: 'txt'\n}, {\n type: 'text/html',\n ext: 'html'\n}, {\n type: 'text/javascript',\n ext: 'js'\n}, {\n type: 'text/css',\n ext: 'css'\n}, {\n type: 'text/csv',\n ext: 'csv'\n}, {\n type: 'text/yaml',\n ext: 'yml'\n}, {\n type: 'text/yaml',\n ext: 'yaml'\n}, {\n type: 'text/calendar',\n ext: 'ics'\n}, {\n type: 'text/calendar',\n ext: 'ical'\n}, {\n type: 'image/png',\n ext: 'png'\n}, {\n type: 'image/gif',\n ext: 'gif'\n}, {\n type: 'image/jpeg',\n ext: 'jpg'\n}, {\n type: 'image/jpeg',\n ext: 'jpeg'\n}, {\n type: 'image/bmp',\n ext: 'bmp'\n}, {\n type: 'image/x-icon',\n ext: 'ico'\n}, {\n type: 'image/tiff',\n ext: 'tif'\n}, {\n type: 'image/tiff',\n ext: 'tiff'\n}, {\n type: 'image/svg+xml',\n ext: 'svg'\n}, {\n type: 'application/json',\n ext: 'json'\n}, {\n type: 'application/xml',\n ext: 'xml'\n}, {\n type: 'application/x-sh',\n ext: 'sh'\n}, {\n type: 'application/zip',\n ext: 'zip'\n}, {\n type: 'application/x-rar-compressed',\n ext: 'rar'\n}, {\n type: 'application/x-tar',\n ext: 'tar'\n}, {\n type: 'application/x-bzip',\n ext: 'bz'\n}, {\n type: 'application/x-bzip2',\n ext: 'bz2'\n}, {\n type: 'application/pdf',\n ext: 'pdf'\n}, {\n type: 'application/java-archive',\n ext: 'jar'\n}, {\n type: 'application/msword',\n ext: 'doc'\n}, {\n type: 'application/vnd.ms-excel',\n ext: 'xls'\n}, {\n type: 'application/vnd.ms-excel',\n ext: 'xlsx'\n}, {\n type: 'message/rfc822',\n ext: 'eml'\n}];\n\nvar JS =\n/** @class */\nfunction () {\n function JS() {}\n\n JS.isEmpty = function (obj) {\n return Object.keys(obj).length === 0;\n };\n\n JS.sortByField = function (list, field, dir) {\n if (!list || !list.sort) {\n return false;\n }\n\n var dirX = dir && dir === 'desc' ? -1 : 1;\n list.sort(function (a, b) {\n var a_val = a[field];\n var b_val = b[field];\n\n if (typeof b_val === 'undefined') {\n return typeof a_val === 'undefined' ? 0 : 1 * dirX;\n }\n\n if (typeof a_val === 'undefined') {\n return -1 * dirX;\n }\n\n if (a_val < b_val) {\n return -1 * dirX;\n }\n\n if (a_val > b_val) {\n return 1 * dirX;\n }\n\n return 0;\n });\n return true;\n };\n\n JS.objectLessAttributes = function (obj, less) {\n var ret = Object.assign({}, obj);\n\n if (less) {\n if (typeof less === 'string') {\n delete ret[less];\n } else {\n less.forEach(function (attr) {\n delete ret[attr];\n });\n }\n }\n\n return ret;\n };\n\n JS.filenameToContentType = function (filename, defVal) {\n if (defVal === void 0) {\n defVal = 'application/octet-stream';\n }\n\n var name = filename.toLowerCase();\n var filtered = MIME_MAP.filter(function (mime) {\n return name.endsWith('.' + mime.ext);\n });\n return filtered.length > 0 ? filtered[0].type : defVal;\n };\n\n JS.isTextFile = function (contentType) {\n var type = contentType.toLowerCase();\n\n if (type.startsWith('text/')) {\n return true;\n }\n\n return 'application/json' === type || 'application/xml' === type || 'application/sh' === type;\n };\n /**\n * generate random string\n */\n\n\n JS.generateRandomString = function () {\n var result = '';\n var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\n for (var i = 32; i > 0; i -= 1) {\n result += chars[Math.floor(Math.random() * chars.length)];\n }\n\n return result;\n };\n\n JS.makeQuerablePromise = function (promise) {\n if (promise.isResolved) return promise;\n var isPending = true;\n var isRejected = false;\n var isFullfilled = false;\n var result = promise.then(function (data) {\n isFullfilled = true;\n isPending = false;\n return data;\n }, function (e) {\n isRejected = true;\n isPending = false;\n throw e;\n });\n\n result.isFullfilled = function () {\n return isFullfilled;\n };\n\n result.isPending = function () {\n return isPending;\n };\n\n result.isRejected = function () {\n return isRejected;\n };\n\n return result;\n };\n\n JS.browserOrNode = function () {\n var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';\n var isNode = typeof process !== 'undefined' && process.versions != null && process.versions.node != null;\n return {\n isBrowser: isBrowser,\n isNode: isNode\n };\n };\n /**\n * transfer the first letter of the keys to lowercase\n * @param {Object} obj - the object need to be transferred\n * @param {Array} whiteListForItself - whitelist itself from being transferred\n * @param {Array} whiteListForChildren - whitelist its children keys from being transferred\n */\n\n\n JS.transferKeyToLowerCase = function (obj, whiteListForItself, whiteListForChildren) {\n if (whiteListForItself === void 0) {\n whiteListForItself = [];\n }\n\n if (whiteListForChildren === void 0) {\n whiteListForChildren = [];\n }\n\n if (!JS.isStrictObject(obj)) return obj;\n var ret = {};\n\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n var transferedKey = whiteListForItself.includes(key) ? key : key[0].toLowerCase() + key.slice(1);\n ret[transferedKey] = whiteListForChildren.includes(key) ? obj[key] : JS.transferKeyToLowerCase(obj[key], whiteListForItself, whiteListForChildren);\n }\n }\n\n return ret;\n };\n /**\n * transfer the first letter of the keys to lowercase\n * @param {Object} obj - the object need to be transferred\n * @param {Array} whiteListForItself - whitelist itself from being transferred\n * @param {Array} whiteListForChildren - whitelist its children keys from being transferred\n */\n\n\n JS.transferKeyToUpperCase = function (obj, whiteListForItself, whiteListForChildren) {\n if (whiteListForItself === void 0) {\n whiteListForItself = [];\n }\n\n if (whiteListForChildren === void 0) {\n whiteListForChildren = [];\n }\n\n if (!JS.isStrictObject(obj)) return obj;\n var ret = {};\n\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n var transferedKey = whiteListForItself.includes(key) ? key : key[0].toUpperCase() + key.slice(1);\n ret[transferedKey] = whiteListForChildren.includes(key) ? obj[key] : JS.transferKeyToUpperCase(obj[key], whiteListForItself, whiteListForChildren);\n }\n }\n\n return ret;\n };\n /**\n * Return true if the object is a strict object\n * which means it's not Array, Function, Number, String, Boolean or Null\n * @param obj the Object\n */\n\n\n JS.isStrictObject = function (obj) {\n return obj instanceof Object && !(obj instanceof Array) && !(obj instanceof Function) && !(obj instanceof Number) && !(obj instanceof String) && !(obj instanceof Boolean);\n };\n\n return JS;\n}();\n\nexports[\"default\"] = JS;","require('../lib/node_loader');\n\nvar AWS = require('../lib/core');\n\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\napiLoader.services['sts'] = {};\nAWS.STS = Service.defineService('sts', ['2011-06-15']);\n\nrequire('../lib/services/sts');\n\nObject.defineProperty(apiLoader.services['sts'], '2011-06-15', {\n get: function get() {\n var model = require('../apis/sts-2011-06-15.min.json');\n\n model.paginators = require('../apis/sts-2011-06-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nmodule.exports = AWS.STS;","\"use strict\";\n\nfunction __export(m) {\n for (var p in m) {\n if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n }\n}\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\n__export(require(\"./AbstractPredictionsProvider\"));\n\n__export(require(\"./AbstractConvertPredictionsProvider\"));\n\n__export(require(\"./AbstractIdentifyPredictionsProvider\"));\n\n__export(require(\"./AbstractInterpretPredictionsProvider\"));","module.exports = require('./lib/Observable.js').Observable;","var objectWithoutPropertiesLoose = require(\"./objectWithoutPropertiesLoose\");\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutProperties;","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n;\n\n(function (root, factory, undef) {\n if ((typeof exports === \"undefined\" ? \"undefined\" : _typeof(exports)) === \"object\") {\n // CommonJS\n module.exports = exports = factory(require(\"./core\"), require(\"./sha256\"), require(\"./hmac\"));\n } else if (typeof define === \"function\" && define.amd) {\n // AMD\n define([\"./core\", \"./sha256\", \"./hmac\"], factory);\n } else {\n // Global (browser)\n factory(root.CryptoJS);\n }\n})(this, function (CryptoJS) {\n return CryptoJS.HmacSHA256;\n});","var common = {\n black: '#000',\n white: '#fff'\n};\nexport default common;","import _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport withStyles from '../styles/withStyles';\nimport { fade } from '../styles/colorManipulator';\nimport ButtonBase from '../ButtonBase';\nimport capitalize from '../utils/capitalize';\nexport var styles = function styles(theme) {\n return {\n /* Styles applied to the root element. */\n root: _extends({}, theme.typography.button, {\n boxSizing: 'border-box',\n minWidth: 64,\n padding: '6px 16px',\n borderRadius: theme.shape.borderRadius,\n color: theme.palette.text.primary,\n transition: theme.transitions.create(['background-color', 'box-shadow', 'border'], {\n duration: theme.transitions.duration[\"short\"]\n }),\n '&:hover': {\n textDecoration: 'none',\n backgroundColor: fade(theme.palette.text.primary, theme.palette.action.hoverOpacity),\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n },\n '&$disabled': {\n backgroundColor: 'transparent'\n }\n },\n '&$disabled': {\n color: theme.palette.action.disabled\n }\n }),\n\n /* Styles applied to the span element that wraps the children. */\n label: {\n width: '100%',\n // Ensure the correct width for iOS Safari\n display: 'inherit',\n alignItems: 'inherit',\n justifyContent: 'inherit'\n },\n\n /* Styles applied to the root element if `variant=\"text\"`. */\n text: {\n padding: '6px 8px'\n },\n\n /* Styles applied to the root element if `variant=\"text\"` and `color=\"primary\"`. */\n textPrimary: {\n color: theme.palette.primary.main,\n '&:hover': {\n backgroundColor: fade(theme.palette.primary.main, theme.palette.action.hoverOpacity),\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n }\n },\n\n /* Styles applied to the root element if `variant=\"text\"` and `color=\"secondary\"`. */\n textSecondary: {\n color: theme.palette.secondary.main,\n '&:hover': {\n backgroundColor: fade(theme.palette.secondary.main, theme.palette.action.hoverOpacity),\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n }\n },\n\n /* Styles applied to the root element if `variant=\"outlined\"`. */\n outlined: {\n padding: '5px 15px',\n border: \"1px solid \".concat(theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'),\n '&$disabled': {\n border: \"1px solid \".concat(theme.palette.action.disabledBackground)\n }\n },\n\n /* Styles applied to the root element if `variant=\"outlined\"` and `color=\"primary\"`. */\n outlinedPrimary: {\n color: theme.palette.primary.main,\n border: \"1px solid \".concat(fade(theme.palette.primary.main, 0.5)),\n '&:hover': {\n border: \"1px solid \".concat(theme.palette.primary.main),\n backgroundColor: fade(theme.palette.primary.main, theme.palette.action.hoverOpacity),\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n }\n },\n\n /* Styles applied to the root element if `variant=\"outlined\"` and `color=\"secondary\"`. */\n outlinedSecondary: {\n color: theme.palette.secondary.main,\n border: \"1px solid \".concat(fade(theme.palette.secondary.main, 0.5)),\n '&:hover': {\n border: \"1px solid \".concat(theme.palette.secondary.main),\n backgroundColor: fade(theme.palette.secondary.main, theme.palette.action.hoverOpacity),\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n },\n '&$disabled': {\n border: \"1px solid \".concat(theme.palette.action.disabled)\n }\n },\n\n /* Styles applied to the root element if `variant=\"contained\"`. */\n contained: {\n color: theme.palette.getContrastText(theme.palette.grey[300]),\n backgroundColor: theme.palette.grey[300],\n boxShadow: theme.shadows[2],\n '&:hover': {\n backgroundColor: theme.palette.grey.A100,\n boxShadow: theme.shadows[4],\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n boxShadow: theme.shadows[2],\n backgroundColor: theme.palette.grey[300]\n },\n '&$disabled': {\n backgroundColor: theme.palette.action.disabledBackground\n }\n },\n '&$focusVisible': {\n boxShadow: theme.shadows[6]\n },\n '&:active': {\n boxShadow: theme.shadows[8]\n },\n '&$disabled': {\n color: theme.palette.action.disabled,\n boxShadow: theme.shadows[0],\n backgroundColor: theme.palette.action.disabledBackground\n }\n },\n\n /* Styles applied to the root element if `variant=\"contained\"` and `color=\"primary\"`. */\n containedPrimary: {\n color: theme.palette.primary.contrastText,\n backgroundColor: theme.palette.primary.main,\n '&:hover': {\n backgroundColor: theme.palette.primary.dark,\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main\n }\n }\n },\n\n /* Styles applied to the root element if `variant=\"contained\"` and `color=\"secondary\"`. */\n containedSecondary: {\n color: theme.palette.secondary.contrastText,\n backgroundColor: theme.palette.secondary.main,\n '&:hover': {\n backgroundColor: theme.palette.secondary.dark,\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: theme.palette.secondary.main\n }\n }\n },\n\n /* Styles applied to the root element if `disableElevation={true}`. */\n disableElevation: {\n boxShadow: 'none',\n '&:hover': {\n boxShadow: 'none'\n },\n '&$focusVisible': {\n boxShadow: 'none'\n },\n '&:active': {\n boxShadow: 'none'\n },\n '&$disabled': {\n boxShadow: 'none'\n }\n },\n\n /* Pseudo-class applied to the ButtonBase root element if the button is keyboard focused. */\n focusVisible: {},\n\n /* Pseudo-class applied to the root element if `disabled={true}`. */\n disabled: {},\n\n /* Styles applied to the root element if `color=\"inherit\"`. */\n colorInherit: {\n color: 'inherit',\n borderColor: 'currentColor'\n },\n\n /* Styles applied to the root element if `size=\"small\"` and `variant=\"text\"`. */\n textSizeSmall: {\n padding: '4px 5px',\n fontSize: theme.typography.pxToRem(13)\n },\n\n /* Styles applied to the root element if `size=\"large\"` and `variant=\"text\"`. */\n textSizeLarge: {\n padding: '8px 11px',\n fontSize: theme.typography.pxToRem(15)\n },\n\n /* Styles applied to the root element if `size=\"small\"` and `variant=\"outlined\"`. */\n outlinedSizeSmall: {\n padding: '3px 9px',\n fontSize: theme.typography.pxToRem(13)\n },\n\n /* Styles applied to the root element if `size=\"large\"` and `variant=\"outlined\"`. */\n outlinedSizeLarge: {\n padding: '7px 21px',\n fontSize: theme.typography.pxToRem(15)\n },\n\n /* Styles applied to the root element if `size=\"small\"` and `variant=\"contained\"`. */\n containedSizeSmall: {\n padding: '4px 10px',\n fontSize: theme.typography.pxToRem(13)\n },\n\n /* Styles applied to the root element if `size=\"large\"` and `variant=\"contained\"`. */\n containedSizeLarge: {\n padding: '8px 22px',\n fontSize: theme.typography.pxToRem(15)\n },\n\n /* Styles applied to the root element if `size=\"small\"`. */\n sizeSmall: {},\n\n /* Styles applied to the root element if `size=\"large\"`. */\n sizeLarge: {},\n\n /* Styles applied to the root element if `fullWidth={true}`. */\n fullWidth: {\n width: '100%'\n },\n\n /* Styles applied to the startIcon element if supplied. */\n startIcon: {\n display: 'inherit',\n marginRight: 8,\n marginLeft: -4,\n '&$iconSizeSmall': {\n marginLeft: -2\n }\n },\n\n /* Styles applied to the endIcon element if supplied. */\n endIcon: {\n display: 'inherit',\n marginRight: -4,\n marginLeft: 8,\n '&$iconSizeSmall': {\n marginRight: -2\n }\n },\n\n /* Styles applied to the icon element if supplied and `size=\"small\"`. */\n iconSizeSmall: {\n '& > *:first-child': {\n fontSize: 18\n }\n },\n\n /* Styles applied to the icon element if supplied and `size=\"medium\"`. */\n iconSizeMedium: {\n '& > *:first-child': {\n fontSize: 20\n }\n },\n\n /* Styles applied to the icon element if supplied and `size=\"large\"`. */\n iconSizeLarge: {\n '& > *:first-child': {\n fontSize: 22\n }\n }\n };\n};\nvar Button = /*#__PURE__*/React.forwardRef(function Button(props, ref) {\n var children = props.children,\n classes = props.classes,\n className = props.className,\n _props$color = props.color,\n color = _props$color === void 0 ? 'default' : _props$color,\n _props$component = props.component,\n component = _props$component === void 0 ? 'button' : _props$component,\n _props$disabled = props.disabled,\n disabled = _props$disabled === void 0 ? false : _props$disabled,\n _props$disableElevati = props.disableElevation,\n disableElevation = _props$disableElevati === void 0 ? false : _props$disableElevati,\n _props$disableFocusRi = props.disableFocusRipple,\n disableFocusRipple = _props$disableFocusRi === void 0 ? false : _props$disableFocusRi,\n endIconProp = props.endIcon,\n focusVisibleClassName = props.focusVisibleClassName,\n _props$fullWidth = props.fullWidth,\n fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth,\n _props$size = props.size,\n size = _props$size === void 0 ? 'medium' : _props$size,\n startIconProp = props.startIcon,\n _props$type = props.type,\n type = _props$type === void 0 ? 'button' : _props$type,\n _props$variant = props.variant,\n variant = _props$variant === void 0 ? 'text' : _props$variant,\n other = _objectWithoutProperties(props, [\"children\", \"classes\", \"className\", \"color\", \"component\", \"disabled\", \"disableElevation\", \"disableFocusRipple\", \"endIcon\", \"focusVisibleClassName\", \"fullWidth\", \"size\", \"startIcon\", \"type\", \"variant\"]);\n\n var startIcon = startIconProp && /*#__PURE__*/React.createElement(\"span\", {\n className: clsx(classes.startIcon, classes[\"iconSize\".concat(capitalize(size))])\n }, startIconProp);\n var endIcon = endIconProp && /*#__PURE__*/React.createElement(\"span\", {\n className: clsx(classes.endIcon, classes[\"iconSize\".concat(capitalize(size))])\n }, endIconProp);\n return /*#__PURE__*/React.createElement(ButtonBase, _extends({\n className: clsx(classes.root, classes[variant], className, color === 'inherit' ? classes.colorInherit : color !== 'default' && classes[\"\".concat(variant).concat(capitalize(color))], size !== 'medium' && [classes[\"\".concat(variant, \"Size\").concat(capitalize(size))], classes[\"size\".concat(capitalize(size))]], disableElevation && classes.disableElevation, disabled && classes.disabled, fullWidth && classes.fullWidth),\n component: component,\n disabled: disabled,\n focusRipple: !disableFocusRipple,\n focusVisibleClassName: clsx(classes.focusVisible, focusVisibleClassName),\n ref: ref,\n type: type\n }, other), /*#__PURE__*/React.createElement(\"span\", {\n className: classes.label\n }, startIcon, children, endIcon));\n});\nprocess.env.NODE_ENV !== \"production\" ? void 0 : void 0;\nexport default withStyles(styles, {\n name: 'MuiButton'\n})(Button);","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar Collection = require('./collection');\n\nvar util = require('../util');\n\nfunction property(obj, name, value) {\n if (value !== null && value !== undefined) {\n util.property.apply(this, arguments);\n }\n}\n\nfunction memoizedProperty(obj, name) {\n if (!obj.constructor.prototype[name]) {\n util.memoizedProperty.apply(this, arguments);\n }\n}\n\nfunction Shape(shape, options, memberName) {\n options = options || {};\n property(this, 'shape', shape.shape);\n property(this, 'api', options.api, false);\n property(this, 'type', shape.type);\n property(this, 'enum', shape[\"enum\"]);\n property(this, 'min', shape.min);\n property(this, 'max', shape.max);\n property(this, 'pattern', shape.pattern);\n property(this, 'location', shape.location || this.location || 'body');\n property(this, 'name', this.name || shape.xmlName || shape.queryName || shape.locationName || memberName);\n property(this, 'isStreaming', shape.streaming || this.isStreaming || false);\n property(this, 'requiresLength', shape.requiresLength, false);\n property(this, 'isComposite', shape.isComposite || false);\n property(this, 'isShape', true, false);\n property(this, 'isQueryName', Boolean(shape.queryName), false);\n property(this, 'isLocationName', Boolean(shape.locationName), false);\n property(this, 'isIdempotent', shape.idempotencyToken === true);\n property(this, 'isJsonValue', shape.jsonvalue === true);\n property(this, 'isSensitive', shape.sensitive === true || shape.prototype && shape.prototype.sensitive === true);\n property(this, 'isEventStream', Boolean(shape.eventstream), false);\n property(this, 'isEvent', Boolean(shape.event), false);\n property(this, 'isEventPayload', Boolean(shape.eventpayload), false);\n property(this, 'isEventHeader', Boolean(shape.eventheader), false);\n property(this, 'isTimestampFormatSet', Boolean(shape.timestampFormat) || shape.prototype && shape.prototype.isTimestampFormatSet === true, false);\n property(this, 'endpointDiscoveryId', Boolean(shape.endpointdiscoveryid), false);\n property(this, 'hostLabel', Boolean(shape.hostLabel), false);\n\n if (options.documentation) {\n property(this, 'documentation', shape.documentation);\n property(this, 'documentationUrl', shape.documentationUrl);\n }\n\n if (shape.xmlAttribute) {\n property(this, 'isXmlAttribute', shape.xmlAttribute || false);\n } // type conversion and parsing\n\n\n property(this, 'defaultValue', null);\n\n this.toWireFormat = function (value) {\n if (value === null || value === undefined) return '';\n return value;\n };\n\n this.toType = function (value) {\n return value;\n };\n}\n/**\n * @api private\n */\n\n\nShape.normalizedTypes = {\n character: 'string',\n \"double\": 'float',\n \"long\": 'integer',\n \"short\": 'integer',\n biginteger: 'integer',\n bigdecimal: 'float',\n blob: 'binary'\n};\n/**\n * @api private\n */\n\nShape.types = {\n 'structure': StructureShape,\n 'list': ListShape,\n 'map': MapShape,\n 'boolean': BooleanShape,\n 'timestamp': TimestampShape,\n 'float': FloatShape,\n 'integer': IntegerShape,\n 'string': StringShape,\n 'base64': Base64Shape,\n 'binary': BinaryShape\n};\n\nShape.resolve = function resolve(shape, options) {\n if (shape.shape) {\n var refShape = options.api.shapes[shape.shape];\n\n if (!refShape) {\n throw new Error('Cannot find shape reference: ' + shape.shape);\n }\n\n return refShape;\n } else {\n return null;\n }\n};\n\nShape.create = function create(shape, options, memberName) {\n if (shape.isShape) return shape;\n var refShape = Shape.resolve(shape, options);\n\n if (refShape) {\n var filteredKeys = Object.keys(shape);\n\n if (!options.documentation) {\n filteredKeys = filteredKeys.filter(function (name) {\n return !name.match(/documentation/);\n });\n } // create an inline shape with extra members\n\n\n var InlineShape = function InlineShape() {\n refShape.constructor.call(this, shape, options, memberName);\n };\n\n InlineShape.prototype = refShape;\n return new InlineShape();\n } else {\n // set type if not set\n if (!shape.type) {\n if (shape.members) shape.type = 'structure';else if (shape.member) shape.type = 'list';else if (shape.key) shape.type = 'map';else shape.type = 'string';\n } // normalize types\n\n\n var origType = shape.type;\n\n if (Shape.normalizedTypes[shape.type]) {\n shape.type = Shape.normalizedTypes[shape.type];\n }\n\n if (Shape.types[shape.type]) {\n return new Shape.types[shape.type](shape, options, memberName);\n } else {\n throw new Error('Unrecognized shape type: ' + origType);\n }\n }\n};\n\nfunction CompositeShape(shape) {\n Shape.apply(this, arguments);\n property(this, 'isComposite', true);\n\n if (shape.flattened) {\n property(this, 'flattened', shape.flattened || false);\n }\n}\n\nfunction StructureShape(shape, options) {\n var self = this;\n var requiredMap = null,\n firstInit = !this.isShape;\n CompositeShape.apply(this, arguments);\n\n if (firstInit) {\n property(this, 'defaultValue', function () {\n return {};\n });\n property(this, 'members', {});\n property(this, 'memberNames', []);\n property(this, 'required', []);\n property(this, 'isRequired', function () {\n return false;\n });\n }\n\n if (shape.members) {\n property(this, 'members', new Collection(shape.members, options, function (name, member) {\n return Shape.create(member, options, name);\n }));\n memoizedProperty(this, 'memberNames', function () {\n return shape.xmlOrder || Object.keys(shape.members);\n });\n\n if (shape.event) {\n memoizedProperty(this, 'eventPayloadMemberName', function () {\n var members = self.members;\n var memberNames = self.memberNames; // iterate over members to find ones that are event payloads\n\n for (var i = 0, iLen = memberNames.length; i < iLen; i++) {\n if (members[memberNames[i]].isEventPayload) {\n return memberNames[i];\n }\n }\n });\n memoizedProperty(this, 'eventHeaderMemberNames', function () {\n var members = self.members;\n var memberNames = self.memberNames;\n var eventHeaderMemberNames = []; // iterate over members to find ones that are event headers\n\n for (var i = 0, iLen = memberNames.length; i < iLen; i++) {\n if (members[memberNames[i]].isEventHeader) {\n eventHeaderMemberNames.push(memberNames[i]);\n }\n }\n\n return eventHeaderMemberNames;\n });\n }\n }\n\n if (shape.required) {\n property(this, 'required', shape.required);\n property(this, 'isRequired', function (name) {\n if (!requiredMap) {\n requiredMap = {};\n\n for (var i = 0; i < shape.required.length; i++) {\n requiredMap[shape.required[i]] = true;\n }\n }\n\n return requiredMap[name];\n }, false, true);\n }\n\n property(this, 'resultWrapper', shape.resultWrapper || null);\n\n if (shape.payload) {\n property(this, 'payload', shape.payload);\n }\n\n if (typeof shape.xmlNamespace === 'string') {\n property(this, 'xmlNamespaceUri', shape.xmlNamespace);\n } else if (_typeof(shape.xmlNamespace) === 'object') {\n property(this, 'xmlNamespacePrefix', shape.xmlNamespace.prefix);\n property(this, 'xmlNamespaceUri', shape.xmlNamespace.uri);\n }\n}\n\nfunction ListShape(shape, options) {\n var self = this,\n firstInit = !this.isShape;\n CompositeShape.apply(this, arguments);\n\n if (firstInit) {\n property(this, 'defaultValue', function () {\n return [];\n });\n }\n\n if (shape.member) {\n memoizedProperty(this, 'member', function () {\n return Shape.create(shape.member, options);\n });\n }\n\n if (this.flattened) {\n var oldName = this.name;\n memoizedProperty(this, 'name', function () {\n return self.member.name || oldName;\n });\n }\n}\n\nfunction MapShape(shape, options) {\n var firstInit = !this.isShape;\n CompositeShape.apply(this, arguments);\n\n if (firstInit) {\n property(this, 'defaultValue', function () {\n return {};\n });\n property(this, 'key', Shape.create({\n type: 'string'\n }, options));\n property(this, 'value', Shape.create({\n type: 'string'\n }, options));\n }\n\n if (shape.key) {\n memoizedProperty(this, 'key', function () {\n return Shape.create(shape.key, options);\n });\n }\n\n if (shape.value) {\n memoizedProperty(this, 'value', function () {\n return Shape.create(shape.value, options);\n });\n }\n}\n\nfunction TimestampShape(shape) {\n var self = this;\n Shape.apply(this, arguments);\n\n if (shape.timestampFormat) {\n property(this, 'timestampFormat', shape.timestampFormat);\n } else if (self.isTimestampFormatSet && this.timestampFormat) {\n property(this, 'timestampFormat', this.timestampFormat);\n } else if (this.location === 'header') {\n property(this, 'timestampFormat', 'rfc822');\n } else if (this.location === 'querystring') {\n property(this, 'timestampFormat', 'iso8601');\n } else if (this.api) {\n switch (this.api.protocol) {\n case 'json':\n case 'rest-json':\n property(this, 'timestampFormat', 'unixTimestamp');\n break;\n\n case 'rest-xml':\n case 'query':\n case 'ec2':\n property(this, 'timestampFormat', 'iso8601');\n break;\n }\n }\n\n this.toType = function (value) {\n if (value === null || value === undefined) return null;\n if (typeof value.toUTCString === 'function') return value;\n return typeof value === 'string' || typeof value === 'number' ? util.date.parseTimestamp(value) : null;\n };\n\n this.toWireFormat = function (value) {\n return util.date.format(value, self.timestampFormat);\n };\n}\n\nfunction StringShape() {\n Shape.apply(this, arguments);\n var nullLessProtocols = ['rest-xml', 'query', 'ec2'];\n\n this.toType = function (value) {\n value = this.api && nullLessProtocols.indexOf(this.api.protocol) > -1 ? value || '' : value;\n\n if (this.isJsonValue) {\n return JSON.parse(value);\n }\n\n return value && typeof value.toString === 'function' ? value.toString() : value;\n };\n\n this.toWireFormat = function (value) {\n return this.isJsonValue ? JSON.stringify(value) : value;\n };\n}\n\nfunction FloatShape() {\n Shape.apply(this, arguments);\n\n this.toType = function (value) {\n if (value === null || value === undefined) return null;\n return parseFloat(value);\n };\n\n this.toWireFormat = this.toType;\n}\n\nfunction IntegerShape() {\n Shape.apply(this, arguments);\n\n this.toType = function (value) {\n if (value === null || value === undefined) return null;\n return parseInt(value, 10);\n };\n\n this.toWireFormat = this.toType;\n}\n\nfunction BinaryShape() {\n Shape.apply(this, arguments);\n\n this.toType = function (value) {\n var buf = util.base64.decode(value);\n\n if (this.isSensitive && util.isNode() && typeof util.Buffer.alloc === 'function') {\n /* Node.js can create a Buffer that is not isolated.\n * i.e. buf.byteLength !== buf.buffer.byteLength\n * This means that the sensitive data is accessible to anyone with access to buf.buffer.\n * If this is the node shared Buffer, then other code within this process _could_ find this secret.\n * Copy sensitive data to an isolated Buffer and zero the sensitive data.\n * While this is safe to do here, copying this code somewhere else may produce unexpected results.\n */\n var secureBuf = util.Buffer.alloc(buf.length, buf);\n buf.fill(0);\n buf = secureBuf;\n }\n\n return buf;\n };\n\n this.toWireFormat = util.base64.encode;\n}\n\nfunction Base64Shape() {\n BinaryShape.apply(this, arguments);\n}\n\nfunction BooleanShape() {\n Shape.apply(this, arguments);\n\n this.toType = function (value) {\n if (typeof value === 'boolean') return value;\n if (value === null || value === undefined) return null;\n return value === 'true';\n };\n}\n/**\n * @api private\n */\n\n\nShape.shapes = {\n StructureShape: StructureShape,\n ListShape: ListShape,\n MapShape: MapShape,\n StringShape: StringShape,\n BooleanShape: BooleanShape,\n Base64Shape: Base64Shape\n};\n/**\n * @api private\n */\n\nmodule.exports = Shape;","require('../lib/node_loader');\n\nvar AWS = require('../lib/core');\n\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\napiLoader.services['sts'] = {};\nAWS.STS = Service.defineService('sts', ['2011-06-15']);\n\nrequire('../lib/services/sts');\n\nObject.defineProperty(apiLoader.services['sts'], '2011-06-15', {\n get: function get() {\n var model = require('../apis/sts-2011-06-15.min.json');\n\n model.paginators = require('../apis/sts-2011-06-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nmodule.exports = AWS.STS;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar Collection = require('./collection');\n\nvar util = require('../util');\n\nfunction property(obj, name, value) {\n if (value !== null && value !== undefined) {\n util.property.apply(this, arguments);\n }\n}\n\nfunction memoizedProperty(obj, name) {\n if (!obj.constructor.prototype[name]) {\n util.memoizedProperty.apply(this, arguments);\n }\n}\n\nfunction Shape(shape, options, memberName) {\n options = options || {};\n property(this, 'shape', shape.shape);\n property(this, 'api', options.api, false);\n property(this, 'type', shape.type);\n property(this, 'enum', shape[\"enum\"]);\n property(this, 'min', shape.min);\n property(this, 'max', shape.max);\n property(this, 'pattern', shape.pattern);\n property(this, 'location', shape.location || this.location || 'body');\n property(this, 'name', this.name || shape.xmlName || shape.queryName || shape.locationName || memberName);\n property(this, 'isStreaming', shape.streaming || this.isStreaming || false);\n property(this, 'requiresLength', shape.requiresLength, false);\n property(this, 'isComposite', shape.isComposite || false);\n property(this, 'isShape', true, false);\n property(this, 'isQueryName', Boolean(shape.queryName), false);\n property(this, 'isLocationName', Boolean(shape.locationName), false);\n property(this, 'isIdempotent', shape.idempotencyToken === true);\n property(this, 'isJsonValue', shape.jsonvalue === true);\n property(this, 'isSensitive', shape.sensitive === true || shape.prototype && shape.prototype.sensitive === true);\n property(this, 'isEventStream', Boolean(shape.eventstream), false);\n property(this, 'isEvent', Boolean(shape.event), false);\n property(this, 'isEventPayload', Boolean(shape.eventpayload), false);\n property(this, 'isEventHeader', Boolean(shape.eventheader), false);\n property(this, 'isTimestampFormatSet', Boolean(shape.timestampFormat) || shape.prototype && shape.prototype.isTimestampFormatSet === true, false);\n property(this, 'endpointDiscoveryId', Boolean(shape.endpointdiscoveryid), false);\n property(this, 'hostLabel', Boolean(shape.hostLabel), false);\n\n if (options.documentation) {\n property(this, 'documentation', shape.documentation);\n property(this, 'documentationUrl', shape.documentationUrl);\n }\n\n if (shape.xmlAttribute) {\n property(this, 'isXmlAttribute', shape.xmlAttribute || false);\n } // type conversion and parsing\n\n\n property(this, 'defaultValue', null);\n\n this.toWireFormat = function (value) {\n if (value === null || value === undefined) return '';\n return value;\n };\n\n this.toType = function (value) {\n return value;\n };\n}\n/**\n * @api private\n */\n\n\nShape.normalizedTypes = {\n character: 'string',\n \"double\": 'float',\n \"long\": 'integer',\n \"short\": 'integer',\n biginteger: 'integer',\n bigdecimal: 'float',\n blob: 'binary'\n};\n/**\n * @api private\n */\n\nShape.types = {\n 'structure': StructureShape,\n 'list': ListShape,\n 'map': MapShape,\n 'boolean': BooleanShape,\n 'timestamp': TimestampShape,\n 'float': FloatShape,\n 'integer': IntegerShape,\n 'string': StringShape,\n 'base64': Base64Shape,\n 'binary': BinaryShape\n};\n\nShape.resolve = function resolve(shape, options) {\n if (shape.shape) {\n var refShape = options.api.shapes[shape.shape];\n\n if (!refShape) {\n throw new Error('Cannot find shape reference: ' + shape.shape);\n }\n\n return refShape;\n } else {\n return null;\n }\n};\n\nShape.create = function create(shape, options, memberName) {\n if (shape.isShape) return shape;\n var refShape = Shape.resolve(shape, options);\n\n if (refShape) {\n var filteredKeys = Object.keys(shape);\n\n if (!options.documentation) {\n filteredKeys = filteredKeys.filter(function (name) {\n return !name.match(/documentation/);\n });\n } // create an inline shape with extra members\n\n\n var InlineShape = function InlineShape() {\n refShape.constructor.call(this, shape, options, memberName);\n };\n\n InlineShape.prototype = refShape;\n return new InlineShape();\n } else {\n // set type if not set\n if (!shape.type) {\n if (shape.members) shape.type = 'structure';else if (shape.member) shape.type = 'list';else if (shape.key) shape.type = 'map';else shape.type = 'string';\n } // normalize types\n\n\n var origType = shape.type;\n\n if (Shape.normalizedTypes[shape.type]) {\n shape.type = Shape.normalizedTypes[shape.type];\n }\n\n if (Shape.types[shape.type]) {\n return new Shape.types[shape.type](shape, options, memberName);\n } else {\n throw new Error('Unrecognized shape type: ' + origType);\n }\n }\n};\n\nfunction CompositeShape(shape) {\n Shape.apply(this, arguments);\n property(this, 'isComposite', true);\n\n if (shape.flattened) {\n property(this, 'flattened', shape.flattened || false);\n }\n}\n\nfunction StructureShape(shape, options) {\n var self = this;\n var requiredMap = null,\n firstInit = !this.isShape;\n CompositeShape.apply(this, arguments);\n\n if (firstInit) {\n property(this, 'defaultValue', function () {\n return {};\n });\n property(this, 'members', {});\n property(this, 'memberNames', []);\n property(this, 'required', []);\n property(this, 'isRequired', function () {\n return false;\n });\n }\n\n if (shape.members) {\n property(this, 'members', new Collection(shape.members, options, function (name, member) {\n return Shape.create(member, options, name);\n }));\n memoizedProperty(this, 'memberNames', function () {\n return shape.xmlOrder || Object.keys(shape.members);\n });\n\n if (shape.event) {\n memoizedProperty(this, 'eventPayloadMemberName', function () {\n var members = self.members;\n var memberNames = self.memberNames; // iterate over members to find ones that are event payloads\n\n for (var i = 0, iLen = memberNames.length; i < iLen; i++) {\n if (members[memberNames[i]].isEventPayload) {\n return memberNames[i];\n }\n }\n });\n memoizedProperty(this, 'eventHeaderMemberNames', function () {\n var members = self.members;\n var memberNames = self.memberNames;\n var eventHeaderMemberNames = []; // iterate over members to find ones that are event headers\n\n for (var i = 0, iLen = memberNames.length; i < iLen; i++) {\n if (members[memberNames[i]].isEventHeader) {\n eventHeaderMemberNames.push(memberNames[i]);\n }\n }\n\n return eventHeaderMemberNames;\n });\n }\n }\n\n if (shape.required) {\n property(this, 'required', shape.required);\n property(this, 'isRequired', function (name) {\n if (!requiredMap) {\n requiredMap = {};\n\n for (var i = 0; i < shape.required.length; i++) {\n requiredMap[shape.required[i]] = true;\n }\n }\n\n return requiredMap[name];\n }, false, true);\n }\n\n property(this, 'resultWrapper', shape.resultWrapper || null);\n\n if (shape.payload) {\n property(this, 'payload', shape.payload);\n }\n\n if (typeof shape.xmlNamespace === 'string') {\n property(this, 'xmlNamespaceUri', shape.xmlNamespace);\n } else if (_typeof(shape.xmlNamespace) === 'object') {\n property(this, 'xmlNamespacePrefix', shape.xmlNamespace.prefix);\n property(this, 'xmlNamespaceUri', shape.xmlNamespace.uri);\n }\n}\n\nfunction ListShape(shape, options) {\n var self = this,\n firstInit = !this.isShape;\n CompositeShape.apply(this, arguments);\n\n if (firstInit) {\n property(this, 'defaultValue', function () {\n return [];\n });\n }\n\n if (shape.member) {\n memoizedProperty(this, 'member', function () {\n return Shape.create(shape.member, options);\n });\n }\n\n if (this.flattened) {\n var oldName = this.name;\n memoizedProperty(this, 'name', function () {\n return self.member.name || oldName;\n });\n }\n}\n\nfunction MapShape(shape, options) {\n var firstInit = !this.isShape;\n CompositeShape.apply(this, arguments);\n\n if (firstInit) {\n property(this, 'defaultValue', function () {\n return {};\n });\n property(this, 'key', Shape.create({\n type: 'string'\n }, options));\n property(this, 'value', Shape.create({\n type: 'string'\n }, options));\n }\n\n if (shape.key) {\n memoizedProperty(this, 'key', function () {\n return Shape.create(shape.key, options);\n });\n }\n\n if (shape.value) {\n memoizedProperty(this, 'value', function () {\n return Shape.create(shape.value, options);\n });\n }\n}\n\nfunction TimestampShape(shape) {\n var self = this;\n Shape.apply(this, arguments);\n\n if (shape.timestampFormat) {\n property(this, 'timestampFormat', shape.timestampFormat);\n } else if (self.isTimestampFormatSet && this.timestampFormat) {\n property(this, 'timestampFormat', this.timestampFormat);\n } else if (this.location === 'header') {\n property(this, 'timestampFormat', 'rfc822');\n } else if (this.location === 'querystring') {\n property(this, 'timestampFormat', 'iso8601');\n } else if (this.api) {\n switch (this.api.protocol) {\n case 'json':\n case 'rest-json':\n property(this, 'timestampFormat', 'unixTimestamp');\n break;\n\n case 'rest-xml':\n case 'query':\n case 'ec2':\n property(this, 'timestampFormat', 'iso8601');\n break;\n }\n }\n\n this.toType = function (value) {\n if (value === null || value === undefined) return null;\n if (typeof value.toUTCString === 'function') return value;\n return typeof value === 'string' || typeof value === 'number' ? util.date.parseTimestamp(value) : null;\n };\n\n this.toWireFormat = function (value) {\n return util.date.format(value, self.timestampFormat);\n };\n}\n\nfunction StringShape() {\n Shape.apply(this, arguments);\n var nullLessProtocols = ['rest-xml', 'query', 'ec2'];\n\n this.toType = function (value) {\n value = this.api && nullLessProtocols.indexOf(this.api.protocol) > -1 ? value || '' : value;\n\n if (this.isJsonValue) {\n return JSON.parse(value);\n }\n\n return value && typeof value.toString === 'function' ? value.toString() : value;\n };\n\n this.toWireFormat = function (value) {\n return this.isJsonValue ? JSON.stringify(value) : value;\n };\n}\n\nfunction FloatShape() {\n Shape.apply(this, arguments);\n\n this.toType = function (value) {\n if (value === null || value === undefined) return null;\n return parseFloat(value);\n };\n\n this.toWireFormat = this.toType;\n}\n\nfunction IntegerShape() {\n Shape.apply(this, arguments);\n\n this.toType = function (value) {\n if (value === null || value === undefined) return null;\n return parseInt(value, 10);\n };\n\n this.toWireFormat = this.toType;\n}\n\nfunction BinaryShape() {\n Shape.apply(this, arguments);\n\n this.toType = function (value) {\n var buf = util.base64.decode(value);\n\n if (this.isSensitive && util.isNode() && typeof util.Buffer.alloc === 'function') {\n /* Node.js can create a Buffer that is not isolated.\n * i.e. buf.byteLength !== buf.buffer.byteLength\n * This means that the sensitive data is accessible to anyone with access to buf.buffer.\n * If this is the node shared Buffer, then other code within this process _could_ find this secret.\n * Copy sensitive data to an isolated Buffer and zero the sensitive data.\n * While this is safe to do here, copying this code somewhere else may produce unexpected results.\n */\n var secureBuf = util.Buffer.alloc(buf.length, buf);\n buf.fill(0);\n buf = secureBuf;\n }\n\n return buf;\n };\n\n this.toWireFormat = util.base64.encode;\n}\n\nfunction Base64Shape() {\n BinaryShape.apply(this, arguments);\n}\n\nfunction BooleanShape() {\n Shape.apply(this, arguments);\n\n this.toType = function (value) {\n if (typeof value === 'boolean') return value;\n if (value === null || value === undefined) return null;\n return value === 'true';\n };\n}\n/**\n * @api private\n */\n\n\nShape.shapes = {\n StructureShape: StructureShape,\n ListShape: ListShape,\n MapShape: MapShape,\n StringShape: StringShape,\n BooleanShape: BooleanShape,\n Base64Shape: Base64Shape\n};\n/**\n * @api private\n */\n\nmodule.exports = Shape;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n;\n\n(function (root, factory) {\n if ((typeof exports === \"undefined\" ? \"undefined\" : _typeof(exports)) === \"object\") {\n // CommonJS\n module.exports = exports = factory(require(\"./core\"));\n } else if (typeof define === \"function\" && define.amd) {\n // AMD\n define([\"./core\"], factory);\n } else {\n // Global (browser)\n factory(root.CryptoJS);\n }\n})(this, function (CryptoJS) {\n (function (Math) {\n // Shortcuts\n var C = CryptoJS;\n var C_lib = C.lib;\n var WordArray = C_lib.WordArray;\n var Hasher = C_lib.Hasher;\n var C_algo = C.algo; // Initialization and round constants tables\n\n var H = [];\n var K = []; // Compute constants\n\n (function () {\n function isPrime(n) {\n var sqrtN = Math.sqrt(n);\n\n for (var factor = 2; factor <= sqrtN; factor++) {\n if (!(n % factor)) {\n return false;\n }\n }\n\n return true;\n }\n\n function getFractionalBits(n) {\n return (n - (n | 0)) * 0x100000000 | 0;\n }\n\n var n = 2;\n var nPrime = 0;\n\n while (nPrime < 64) {\n if (isPrime(n)) {\n if (nPrime < 8) {\n H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));\n }\n\n K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));\n nPrime++;\n }\n\n n++;\n }\n })(); // Reusable object\n\n\n var W = [];\n /**\n * SHA-256 hash algorithm.\n */\n\n var SHA256 = C_algo.SHA256 = Hasher.extend({\n _doReset: function _doReset() {\n this._hash = new WordArray.init(H.slice(0));\n },\n _doProcessBlock: function _doProcessBlock(M, offset) {\n // Shortcut\n var H = this._hash.words; // Working variables\n\n var a = H[0];\n var b = H[1];\n var c = H[2];\n var d = H[3];\n var e = H[4];\n var f = H[5];\n var g = H[6];\n var h = H[7]; // Computation\n\n for (var i = 0; i < 64; i++) {\n if (i < 16) {\n W[i] = M[offset + i] | 0;\n } else {\n var gamma0x = W[i - 15];\n var gamma0 = (gamma0x << 25 | gamma0x >>> 7) ^ (gamma0x << 14 | gamma0x >>> 18) ^ gamma0x >>> 3;\n var gamma1x = W[i - 2];\n var gamma1 = (gamma1x << 15 | gamma1x >>> 17) ^ (gamma1x << 13 | gamma1x >>> 19) ^ gamma1x >>> 10;\n W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];\n }\n\n var ch = e & f ^ ~e & g;\n var maj = a & b ^ a & c ^ b & c;\n var sigma0 = (a << 30 | a >>> 2) ^ (a << 19 | a >>> 13) ^ (a << 10 | a >>> 22);\n var sigma1 = (e << 26 | e >>> 6) ^ (e << 21 | e >>> 11) ^ (e << 7 | e >>> 25);\n var t1 = h + sigma1 + ch + K[i] + W[i];\n var t2 = sigma0 + maj;\n h = g;\n g = f;\n f = e;\n e = d + t1 | 0;\n d = c;\n c = b;\n b = a;\n a = t1 + t2 | 0;\n } // Intermediate hash value\n\n\n H[0] = H[0] + a | 0;\n H[1] = H[1] + b | 0;\n H[2] = H[2] + c | 0;\n H[3] = H[3] + d | 0;\n H[4] = H[4] + e | 0;\n H[5] = H[5] + f | 0;\n H[6] = H[6] + g | 0;\n H[7] = H[7] + h | 0;\n },\n _doFinalize: function _doFinalize() {\n // Shortcuts\n var data = this._data;\n var dataWords = data.words;\n var nBitsTotal = this._nDataBytes * 8;\n var nBitsLeft = data.sigBytes * 8; // Add padding\n\n dataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32;\n dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\n dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal;\n data.sigBytes = dataWords.length * 4; // Hash final blocks\n\n this._process(); // Return final computed hash\n\n\n return this._hash;\n },\n clone: function clone() {\n var clone = Hasher.clone.call(this);\n clone._hash = this._hash.clone();\n return clone;\n }\n });\n /**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.SHA256('message');\n * var hash = CryptoJS.SHA256(wordArray);\n */\n\n C.SHA256 = Hasher._createHelper(SHA256);\n /**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacSHA256(message, key);\n */\n\n C.HmacSHA256 = Hasher._createHmacHelper(SHA256);\n })(Math);\n\n return CryptoJS.SHA256;\n});","function _typeof2(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","import * as React from 'react';\n/**\n * @ignore - internal component.\n */\n\nvar FormControlContext = /*#__PURE__*/React.createContext();\n\nif (process.env.NODE_ENV !== 'production') {\n FormControlContext.displayName = 'FormControlContext';\n}\n\nexport function useFormControl() {\n return React.useContext(FormControlContext);\n}\nexport default FormControlContext;","/* globals __webpack_amd_options__ */\nmodule.exports = __webpack_amd_options__;\n","import ownerDocument from './ownerDocument';\nexport default function ownerWindow(node) {\n var doc = ownerDocument(node);\n return doc.defaultView || window;\n}","// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nvar hadKeyboardEvent = true;\nvar hadFocusVisibleRecently = false;\nvar hadFocusVisibleRecentlyTimeout = null;\nvar inputTypesWhitelist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n};\n/**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} node\n * @return {boolean}\n */\n\nfunction focusTriggersKeyboardModality(node) {\n var type = node.type,\n tagName = node.tagName;\n\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {\n return true;\n }\n\n if (tagName === 'TEXTAREA' && !node.readOnly) {\n return true;\n }\n\n if (node.isContentEditable) {\n return true;\n }\n\n return false;\n}\n/**\n * Keep track of our keyboard modality state with `hadKeyboardEvent`.\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * @param {KeyboardEvent} event\n */\n\n\nfunction handleKeyDown(event) {\n if (event.metaKey || event.altKey || event.ctrlKey) {\n return;\n }\n\n hadKeyboardEvent = true;\n}\n/**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n */\n\n\nfunction handlePointerDown() {\n hadKeyboardEvent = false;\n}\n\nfunction handleVisibilityChange() {\n if (this.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n }\n}\n\nfunction prepare(doc) {\n doc.addEventListener('keydown', handleKeyDown, true);\n doc.addEventListener('mousedown', handlePointerDown, true);\n doc.addEventListener('pointerdown', handlePointerDown, true);\n doc.addEventListener('touchstart', handlePointerDown, true);\n doc.addEventListener('visibilitychange', handleVisibilityChange, true);\n}\n\nexport function teardown(doc) {\n doc.removeEventListener('keydown', handleKeyDown, true);\n doc.removeEventListener('mousedown', handlePointerDown, true);\n doc.removeEventListener('pointerdown', handlePointerDown, true);\n doc.removeEventListener('touchstart', handlePointerDown, true);\n doc.removeEventListener('visibilitychange', handleVisibilityChange, true);\n}\n\nfunction isFocusVisible(event) {\n var target = event.target;\n\n try {\n return target.matches(':focus-visible');\n } catch (error) {} // browsers not implementing :focus-visible will throw a SyntaxError\n // we use our own heuristic for those browsers\n // rethrow might be better if it's not the expected error but do we really\n // want to crash if focus-visible malfunctioned?\n // no need for validFocusTarget check. the user does that by attaching it to\n // focusable events only\n\n\n return hadKeyboardEvent || focusTriggersKeyboardModality(target);\n}\n/**\n * Should be called if a blur event is fired on a focus-visible element\n */\n\n\nfunction handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}\n\nexport default function useIsFocusVisible() {\n var ref = React.useCallback(function (instance) {\n var node = ReactDOM.findDOMNode(instance);\n\n if (node != null) {\n prepare(node.ownerDocument);\n }\n }, []);\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(isFocusVisible);\n }\n\n return {\n isFocusVisible: isFocusVisible,\n onBlurVisible: handleBlurVisible,\n ref: ref\n };\n}","module.exports = require('./lib/axios');","var grey = {\n 50: '#fafafa',\n 100: '#f5f5f5',\n 200: '#eeeeee',\n 300: '#e0e0e0',\n 400: '#bdbdbd',\n 500: '#9e9e9e',\n 600: '#757575',\n 700: '#616161',\n 800: '#424242',\n 900: '#212121',\n A100: '#d5d5d5',\n A200: '#aaaaaa',\n A400: '#303030',\n A700: '#616161'\n};\nexport default grey;","var indigo = {\n 50: '#e8eaf6',\n 100: '#c5cae9',\n 200: '#9fa8da',\n 300: '#7986cb',\n 400: '#5c6bc0',\n 500: '#3f51b5',\n 600: '#3949ab',\n 700: '#303f9f',\n 800: '#283593',\n 900: '#1a237e',\n A100: '#8c9eff',\n A200: '#536dfe',\n A400: '#3d5afe',\n A700: '#304ffe'\n};\nexport default indigo;","var pink = {\n 50: '#fce4ec',\n 100: '#f8bbd0',\n 200: '#f48fb1',\n 300: '#f06292',\n 400: '#ec407a',\n 500: '#e91e63',\n 600: '#d81b60',\n 700: '#c2185b',\n 800: '#ad1457',\n 900: '#880e4f',\n A100: '#ff80ab',\n A200: '#ff4081',\n A400: '#f50057',\n A700: '#c51162'\n};\nexport default pink;","var blue = {\n 50: '#e3f2fd',\n 100: '#bbdefb',\n 200: '#90caf9',\n 300: '#64b5f6',\n 400: '#42a5f5',\n 500: '#2196f3',\n 600: '#1e88e5',\n 700: '#1976d2',\n 800: '#1565c0',\n 900: '#0d47a1',\n A100: '#82b1ff',\n A200: '#448aff',\n A400: '#2979ff',\n A700: '#2962ff'\n};\nexport default blue;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\"; // Sorted ASC by size. That's important.\n// It can't be configured as it's used statically for propTypes.\n\nexport var keys = ['xs', 'sm', 'md', 'lg', 'xl']; // Keep in mind that @media is inclusive by the CSS specification.\n\nexport default function createBreakpoints(breakpoints) {\n var _breakpoints$values = breakpoints.values,\n values = _breakpoints$values === void 0 ? {\n xs: 0,\n sm: 600,\n md: 960,\n lg: 1280,\n xl: 1920\n } : _breakpoints$values,\n _breakpoints$unit = breakpoints.unit,\n unit = _breakpoints$unit === void 0 ? 'px' : _breakpoints$unit,\n _breakpoints$step = breakpoints.step,\n step = _breakpoints$step === void 0 ? 5 : _breakpoints$step,\n other = _objectWithoutProperties(breakpoints, [\"values\", \"unit\", \"step\"]);\n\n function up(key) {\n var value = typeof values[key] === 'number' ? values[key] : key;\n return \"@media (min-width:\".concat(value).concat(unit, \")\");\n }\n\n function down(key) {\n var endIndex = keys.indexOf(key) + 1;\n var upperbound = values[keys[endIndex]];\n\n if (endIndex === keys.length) {\n // xl down applies to all sizes\n return up('xs');\n }\n\n var value = typeof upperbound === 'number' && endIndex > 0 ? upperbound : key;\n return \"@media (max-width:\".concat(value - step / 100).concat(unit, \")\");\n }\n\n function between(start, end) {\n var endIndex = keys.indexOf(end);\n\n if (endIndex === keys.length - 1) {\n return up(start);\n }\n\n return \"@media (min-width:\".concat(typeof values[start] === 'number' ? values[start] : start).concat(unit, \") and \") + \"(max-width:\".concat((endIndex !== -1 && typeof values[keys[endIndex + 1]] === 'number' ? values[keys[endIndex + 1]] : end) - step / 100).concat(unit, \")\");\n }\n\n function only(key) {\n return between(key, key);\n }\n\n function width(key) {\n return values[key];\n }\n\n return _extends({\n keys: keys,\n values: values,\n up: up,\n down: down,\n between: between,\n only: only,\n width: width\n }, other);\n}","import _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport { chainPropTypes } from '@material-ui/utils';\nimport withStyles from '../styles/withStyles';\nexport var styles = function styles(theme) {\n var elevations = {};\n theme.shadows.forEach(function (shadow, index) {\n elevations[\"elevation\".concat(index)] = {\n boxShadow: shadow\n };\n });\n return _extends({\n /* Styles applied to the root element. */\n root: {\n backgroundColor: theme.palette.background.paper,\n color: theme.palette.text.primary,\n transition: theme.transitions.create('box-shadow')\n },\n\n /* Styles applied to the root element if `square={false}`. */\n rounded: {\n borderRadius: theme.shape.borderRadius\n },\n\n /* Styles applied to the root element if `variant=\"outlined\"` */\n outlined: {\n border: \"1px solid \".concat(theme.palette.divider)\n }\n }, elevations);\n};\nvar Paper = /*#__PURE__*/React.forwardRef(function Paper(props, ref) {\n var classes = props.classes,\n className = props.className,\n _props$component = props.component,\n Component = _props$component === void 0 ? 'div' : _props$component,\n _props$square = props.square,\n square = _props$square === void 0 ? false : _props$square,\n _props$elevation = props.elevation,\n elevation = _props$elevation === void 0 ? 1 : _props$elevation,\n _props$variant = props.variant,\n variant = _props$variant === void 0 ? 'elevation' : _props$variant,\n other = _objectWithoutProperties(props, [\"classes\", \"className\", \"component\", \"square\", \"elevation\", \"variant\"]);\n\n return /*#__PURE__*/React.createElement(Component, _extends({\n className: clsx(classes.root, className, variant === 'outlined' ? classes.outlined : classes[\"elevation\".concat(elevation)], !square && classes.rounded),\n ref: ref\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? void 0 : void 0;\nexport default withStyles(styles, {\n name: 'MuiPaper'\n})(Paper);","/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nimport * as React from 'react';\nexport default function useControlled(_ref) {\n var controlled = _ref.controlled,\n defaultProp = _ref[\"default\"],\n name = _ref.name,\n _ref$state = _ref.state,\n state = _ref$state === void 0 ? 'value' : _ref$state;\n\n var _React$useRef = React.useRef(controlled !== undefined),\n isControlled = _React$useRef.current;\n\n var _React$useState = React.useState(defaultProp),\n valueState = _React$useState[0],\n setValue = _React$useState[1];\n\n var value = isControlled ? controlled : valueState;\n\n if (process.env.NODE_ENV !== 'production') {\n React.useEffect(function () {\n if (isControlled !== (controlled !== undefined)) {\n console.error([\"Material-UI: a component is changing the \".concat(isControlled ? '' : 'un', \"controlled \").concat(state, \" state of \").concat(name, \" to be \").concat(isControlled ? 'un' : '', \"controlled.\"), 'Elements should not switch from uncontrolled to controlled (or vice versa).', \"Decide between using a controlled or uncontrolled \".concat(name, \" \") + 'element for the lifetime of the component.', \"The nature of the state is determined during the first render, it's considered controlled if the value is not `undefined`.\", 'More info: https://fb.me/react-controlled-components'].join('\\n'));\n }\n }, [controlled]);\n\n var _React$useRef2 = React.useRef(defaultProp),\n defaultValue = _React$useRef2.current;\n\n React.useEffect(function () {\n if (defaultValue !== defaultProp) {\n console.error([\"Material-UI: a component is changing the default \".concat(state, \" state of an uncontrolled \").concat(name, \" after being initialized. \") + \"To suppress this warning opt to use a controlled \".concat(name, \".\")].join('\\n'));\n }\n }, [JSON.stringify(defaultProp)]);\n }\n\n var setValueIfUncontrolled = React.useCallback(function (newValue) {\n if (!isControlled) {\n setValue(newValue);\n }\n }, []);\n return [value, setValueIfUncontrolled];\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nexport default function createMixins(breakpoints, spacing, mixins) {\n var _toolbar;\n\n return _extends({\n gutters: function gutters() {\n var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; // To deprecate in v4.1\n // warning(\n // false,\n // [\n // 'Material-UI: theme.mixins.gutters() is deprecated.',\n // 'You can use the source of the mixin directly:',\n // `\n // paddingLeft: theme.spacing(2),\n // paddingRight: theme.spacing(2),\n // [theme.breakpoints.up('sm')]: {\n // paddingLeft: theme.spacing(3),\n // paddingRight: theme.spacing(3),\n // },\n // `,\n // ].join('\\n'),\n // );\n\n return _extends({\n paddingLeft: spacing(2),\n paddingRight: spacing(2)\n }, styles, _defineProperty({}, breakpoints.up('sm'), _extends({\n paddingLeft: spacing(3),\n paddingRight: spacing(3)\n }, styles[breakpoints.up('sm')])));\n },\n toolbar: (_toolbar = {\n minHeight: 56\n }, _defineProperty(_toolbar, \"\".concat(breakpoints.up('xs'), \" and (orientation: landscape)\"), {\n minHeight: 48\n }), _defineProperty(_toolbar, breakpoints.up('sm'), {\n minHeight: 64\n }), _toolbar)\n }, mixins);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport { deepmerge } from '@material-ui/utils';\nimport common from '../colors/common';\nimport grey from '../colors/grey';\nimport indigo from '../colors/indigo';\nimport pink from '../colors/pink';\nimport red from '../colors/red';\nimport orange from '../colors/orange';\nimport blue from '../colors/blue';\nimport green from '../colors/green';\nimport { darken, getContrastRatio, lighten } from './colorManipulator';\nexport var light = {\n // The colors used to style the text.\n text: {\n // The most important text.\n primary: 'rgba(0, 0, 0, 0.87)',\n // Secondary text.\n secondary: 'rgba(0, 0, 0, 0.54)',\n // Disabled text have even lower visual prominence.\n disabled: 'rgba(0, 0, 0, 0.38)',\n // Text hints.\n hint: 'rgba(0, 0, 0, 0.38)'\n },\n // The color used to divide different elements.\n divider: 'rgba(0, 0, 0, 0.12)',\n // The background colors used to style the surfaces.\n // Consistency between these values is important.\n background: {\n paper: common.white,\n \"default\": grey[50]\n },\n // The colors used to style the action elements.\n action: {\n // The color of an active action like an icon button.\n active: 'rgba(0, 0, 0, 0.54)',\n // The color of an hovered action.\n hover: 'rgba(0, 0, 0, 0.04)',\n hoverOpacity: 0.04,\n // The color of a selected action.\n selected: 'rgba(0, 0, 0, 0.08)',\n selectedOpacity: 0.08,\n // The color of a disabled action.\n disabled: 'rgba(0, 0, 0, 0.26)',\n // The background color of a disabled action.\n disabledBackground: 'rgba(0, 0, 0, 0.12)',\n disabledOpacity: 0.38,\n focus: 'rgba(0, 0, 0, 0.12)',\n focusOpacity: 0.12,\n activatedOpacity: 0.12\n }\n};\nexport var dark = {\n text: {\n primary: common.white,\n secondary: 'rgba(255, 255, 255, 0.7)',\n disabled: 'rgba(255, 255, 255, 0.5)',\n hint: 'rgba(255, 255, 255, 0.5)',\n icon: 'rgba(255, 255, 255, 0.5)'\n },\n divider: 'rgba(255, 255, 255, 0.12)',\n background: {\n paper: grey[800],\n \"default\": '#303030'\n },\n action: {\n active: common.white,\n hover: 'rgba(255, 255, 255, 0.08)',\n hoverOpacity: 0.08,\n selected: 'rgba(255, 255, 255, 0.16)',\n selectedOpacity: 0.16,\n disabled: 'rgba(255, 255, 255, 0.3)',\n disabledBackground: 'rgba(255, 255, 255, 0.12)',\n disabledOpacity: 0.38,\n focus: 'rgba(255, 255, 255, 0.12)',\n focusOpacity: 0.12,\n activatedOpacity: 0.24\n }\n};\n\nfunction addLightOrDark(intent, direction, shade, tonalOffset) {\n var tonalOffsetLight = tonalOffset.light || tonalOffset;\n var tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;\n\n if (!intent[direction]) {\n if (intent.hasOwnProperty(shade)) {\n intent[direction] = intent[shade];\n } else if (direction === 'light') {\n intent.light = lighten(intent.main, tonalOffsetLight);\n } else if (direction === 'dark') {\n intent.dark = darken(intent.main, tonalOffsetDark);\n }\n }\n}\n\nexport default function createPalette(palette) {\n var _palette$primary = palette.primary,\n primary = _palette$primary === void 0 ? {\n light: indigo[300],\n main: indigo[500],\n dark: indigo[700]\n } : _palette$primary,\n _palette$secondary = palette.secondary,\n secondary = _palette$secondary === void 0 ? {\n light: pink.A200,\n main: pink.A400,\n dark: pink.A700\n } : _palette$secondary,\n _palette$error = palette.error,\n error = _palette$error === void 0 ? {\n light: red[300],\n main: red[500],\n dark: red[700]\n } : _palette$error,\n _palette$warning = palette.warning,\n warning = _palette$warning === void 0 ? {\n light: orange[300],\n main: orange[500],\n dark: orange[700]\n } : _palette$warning,\n _palette$info = palette.info,\n info = _palette$info === void 0 ? {\n light: blue[300],\n main: blue[500],\n dark: blue[700]\n } : _palette$info,\n _palette$success = palette.success,\n success = _palette$success === void 0 ? {\n light: green[300],\n main: green[500],\n dark: green[700]\n } : _palette$success,\n _palette$type = palette.type,\n type = _palette$type === void 0 ? 'light' : _palette$type,\n _palette$contrastThre = palette.contrastThreshold,\n contrastThreshold = _palette$contrastThre === void 0 ? 3 : _palette$contrastThre,\n _palette$tonalOffset = palette.tonalOffset,\n tonalOffset = _palette$tonalOffset === void 0 ? 0.2 : _palette$tonalOffset,\n other = _objectWithoutProperties(palette, [\"primary\", \"secondary\", \"error\", \"warning\", \"info\", \"success\", \"type\", \"contrastThreshold\", \"tonalOffset\"]); // Use the same logic as\n // Bootstrap: https://github.com/twbs/bootstrap/blob/1d6e3710dd447de1a200f29e8fa521f8a0908f70/scss/_functions.scss#L59\n // and material-components-web https://github.com/material-components/material-components-web/blob/ac46b8863c4dab9fc22c4c662dc6bd1b65dd652f/packages/mdc-theme/_functions.scss#L54\n\n\n function getContrastText(background) {\n var contrastText = getContrastRatio(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;\n\n if (process.env.NODE_ENV !== 'production') {\n var contrast = getContrastRatio(background, contrastText);\n\n if (contrast < 3) {\n console.error([\"Material-UI: the contrast ratio of \".concat(contrast, \":1 for \").concat(contrastText, \" on \").concat(background), 'falls below the WCAG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\\n'));\n }\n }\n\n return contrastText;\n }\n\n var augmentColor = function augmentColor(color) {\n var mainShade = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;\n var lightShade = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 300;\n var darkShade = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 700;\n color = _extends({}, color);\n\n if (!color.main && color[mainShade]) {\n color.main = color[mainShade];\n }\n\n if (!color.main) {\n throw new Error(['Material-UI: the color provided to augmentColor(color) is invalid.', \"The color object needs to have a `main` property or a `\".concat(mainShade, \"` property.\")].join('\\n'));\n }\n\n if (typeof color.main !== 'string') {\n throw new Error(['Material-UI: the color provided to augmentColor(color) is invalid.', \"`color.main` should be a string, but `\".concat(JSON.stringify(color.main), \"` was provided instead.\"), '', 'Did you intend to use one of the following approaches?', '', 'import { green } from \"@material-ui/core/colors\";', '', 'const theme1 = createMuiTheme({ palette: {', ' primary: green,', '} });', '', 'const theme2 = createMuiTheme({ palette: {', ' primary: { main: green[500] },', '} });'].join('\\n'));\n }\n\n addLightOrDark(color, 'light', lightShade, tonalOffset);\n addLightOrDark(color, 'dark', darkShade, tonalOffset);\n\n if (!color.contrastText) {\n color.contrastText = getContrastText(color.main);\n }\n\n return color;\n };\n\n var types = {\n dark: dark,\n light: light\n };\n\n if (process.env.NODE_ENV !== 'production') {\n if (!types[type]) {\n console.error(\"Material-UI: the palette type `\".concat(type, \"` is not supported.\"));\n }\n }\n\n var paletteOutput = deepmerge(_extends({\n // A collection of common colors.\n common: common,\n // The palette type, can be light or dark.\n type: type,\n // The colors used to represent primary interface elements for a user.\n primary: augmentColor(primary),\n // The colors used to represent secondary interface elements for a user.\n secondary: augmentColor(secondary, 'A400', 'A200', 'A700'),\n // The colors used to represent interface elements that the user should be made aware of.\n error: augmentColor(error),\n // The colors used to represent potentially dangerous actions or important messages.\n warning: augmentColor(warning),\n // The colors used to present information to the user that is neutral and not necessarily important.\n info: augmentColor(info),\n // The colors used to indicate the successful completion of an action that user triggered.\n success: augmentColor(success),\n // The grey colors.\n grey: grey,\n // Used by `getContrastText()` to maximize the contrast between\n // the background and the text.\n contrastThreshold: contrastThreshold,\n // Takes a background color and returns the text color that maximizes the contrast.\n getContrastText: getContrastText,\n // Generate a rich color object.\n augmentColor: augmentColor,\n // Used by the functions below to shift a color's luminance by approximately\n // two indexes within its tonal palette.\n // E.g., shift from Red 500 to Red 300 or Red 700.\n tonalOffset: tonalOffset\n }, types[type]), other);\n return paletteOutput;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport { deepmerge } from '@material-ui/utils';\n\nfunction round(value) {\n return Math.round(value * 1e5) / 1e5;\n}\n\nvar caseAllCaps = {\n textTransform: 'uppercase'\n};\nvar defaultFontFamily = '\"Roboto\", \"Helvetica\", \"Arial\", sans-serif';\n/**\n * @see @link{https://material.io/design/typography/the-type-system.html}\n * @see @link{https://material.io/design/typography/understanding-typography.html}\n */\n\nexport default function createTypography(palette, typography) {\n var _ref = typeof typography === 'function' ? typography(palette) : typography,\n _ref$fontFamily = _ref.fontFamily,\n fontFamily = _ref$fontFamily === void 0 ? defaultFontFamily : _ref$fontFamily,\n _ref$fontSize = _ref.fontSize,\n fontSize = _ref$fontSize === void 0 ? 14 : _ref$fontSize,\n _ref$fontWeightLight = _ref.fontWeightLight,\n fontWeightLight = _ref$fontWeightLight === void 0 ? 300 : _ref$fontWeightLight,\n _ref$fontWeightRegula = _ref.fontWeightRegular,\n fontWeightRegular = _ref$fontWeightRegula === void 0 ? 400 : _ref$fontWeightRegula,\n _ref$fontWeightMedium = _ref.fontWeightMedium,\n fontWeightMedium = _ref$fontWeightMedium === void 0 ? 500 : _ref$fontWeightMedium,\n _ref$fontWeightBold = _ref.fontWeightBold,\n fontWeightBold = _ref$fontWeightBold === void 0 ? 700 : _ref$fontWeightBold,\n _ref$htmlFontSize = _ref.htmlFontSize,\n htmlFontSize = _ref$htmlFontSize === void 0 ? 16 : _ref$htmlFontSize,\n allVariants = _ref.allVariants,\n pxToRem2 = _ref.pxToRem,\n other = _objectWithoutProperties(_ref, [\"fontFamily\", \"fontSize\", \"fontWeightLight\", \"fontWeightRegular\", \"fontWeightMedium\", \"fontWeightBold\", \"htmlFontSize\", \"allVariants\", \"pxToRem\"]);\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof fontSize !== 'number') {\n console.error('Material-UI: `fontSize` is required to be a number.');\n }\n\n if (typeof htmlFontSize !== 'number') {\n console.error('Material-UI: `htmlFontSize` is required to be a number.');\n }\n }\n\n var coef = fontSize / 14;\n\n var pxToRem = pxToRem2 || function (size) {\n return \"\".concat(size / htmlFontSize * coef, \"rem\");\n };\n\n var buildVariant = function buildVariant(fontWeight, size, lineHeight, letterSpacing, casing) {\n return _extends({\n fontFamily: fontFamily,\n fontWeight: fontWeight,\n fontSize: pxToRem(size),\n // Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/\n lineHeight: lineHeight\n }, fontFamily === defaultFontFamily ? {\n letterSpacing: \"\".concat(round(letterSpacing / size), \"em\")\n } : {}, {}, casing, {}, allVariants);\n };\n\n var variants = {\n h1: buildVariant(fontWeightLight, 96, 1.167, -1.5),\n h2: buildVariant(fontWeightLight, 60, 1.2, -0.5),\n h3: buildVariant(fontWeightRegular, 48, 1.167, 0),\n h4: buildVariant(fontWeightRegular, 34, 1.235, 0.25),\n h5: buildVariant(fontWeightRegular, 24, 1.334, 0),\n h6: buildVariant(fontWeightMedium, 20, 1.6, 0.15),\n subtitle1: buildVariant(fontWeightRegular, 16, 1.75, 0.15),\n subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1),\n body1: buildVariant(fontWeightRegular, 16, 1.5, 0.15),\n body2: buildVariant(fontWeightRegular, 14, 1.43, 0.15),\n button: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps),\n caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4),\n overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps)\n };\n return deepmerge(_extends({\n htmlFontSize: htmlFontSize,\n pxToRem: pxToRem,\n round: round,\n // TODO v5: remove\n fontFamily: fontFamily,\n fontSize: fontSize,\n fontWeightLight: fontWeightLight,\n fontWeightRegular: fontWeightRegular,\n fontWeightMedium: fontWeightMedium,\n fontWeightBold: fontWeightBold\n }, variants), other, {\n clone: false // No need to clone deep\n\n });\n}","var shadowKeyUmbraOpacity = 0.2;\nvar shadowKeyPenumbraOpacity = 0.14;\nvar shadowAmbientShadowOpacity = 0.12;\n\nfunction createShadow() {\n return [\"\".concat(arguments.length <= 0 ? undefined : arguments[0], \"px \").concat(arguments.length <= 1 ? undefined : arguments[1], \"px \").concat(arguments.length <= 2 ? undefined : arguments[2], \"px \").concat(arguments.length <= 3 ? undefined : arguments[3], \"px rgba(0,0,0,\").concat(shadowKeyUmbraOpacity, \")\"), \"\".concat(arguments.length <= 4 ? undefined : arguments[4], \"px \").concat(arguments.length <= 5 ? undefined : arguments[5], \"px \").concat(arguments.length <= 6 ? undefined : arguments[6], \"px \").concat(arguments.length <= 7 ? undefined : arguments[7], \"px rgba(0,0,0,\").concat(shadowKeyPenumbraOpacity, \")\"), \"\".concat(arguments.length <= 8 ? undefined : arguments[8], \"px \").concat(arguments.length <= 9 ? undefined : arguments[9], \"px \").concat(arguments.length <= 10 ? undefined : arguments[10], \"px \").concat(arguments.length <= 11 ? undefined : arguments[11], \"px rgba(0,0,0,\").concat(shadowAmbientShadowOpacity, \")\")].join(',');\n} // Values from https://github.com/material-components/material-components-web/blob/be8747f94574669cb5e7add1a7c54fa41a89cec7/packages/mdc-elevation/_variables.scss\n\n\nvar shadows = ['none', createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];\nexport default shadows;","var shape = {\n borderRadius: 4\n};\nexport default shape;","import { createUnarySpacing } from '@material-ui/system';\nvar warnOnce;\nexport default function createSpacing() {\n var spacingInput = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 8; // Already transformed.\n\n if (spacingInput.mui) {\n return spacingInput;\n } // Material Design layouts are visually balanced. Most measurements align to an 8dp grid applied, which aligns both spacing and the overall layout.\n // Smaller components, such as icons and type, can align to a 4dp grid.\n // https://material.io/design/layout/understanding-layout.html#usage\n\n\n var transform = createUnarySpacing({\n spacing: spacingInput\n });\n\n var spacing = function spacing() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!(args.length <= 4)) {\n console.error(\"Material-UI: Too many arguments provided, expected between 0 and 4, got \".concat(args.length));\n }\n }\n\n if (args.length === 0) {\n return transform(1);\n }\n\n if (args.length === 1) {\n return transform(args[0]);\n }\n\n return args.map(function (argument) {\n if (typeof argument === 'string') {\n return argument;\n }\n\n var output = transform(argument);\n return typeof output === 'number' ? \"\".concat(output, \"px\") : output;\n }).join(' ');\n }; // Backward compatibility, to remove in v5.\n\n\n Object.defineProperty(spacing, 'unit', {\n get: function get() {\n if (process.env.NODE_ENV !== 'production') {\n if (!warnOnce || process.env.NODE_ENV === 'test') {\n console.error(['Material-UI: theme.spacing.unit usage has been deprecated.', 'It will be removed in v5.', 'You can replace `theme.spacing.unit * y` with `theme.spacing(y)`.', '', 'You can use the `https://github.com/mui-org/material-ui/tree/master/packages/material-ui-codemod/README.md#theme-spacing-api` migration helper to make the process smoother.'].join('\\n'));\n }\n\n warnOnce = true;\n }\n\n return spacingInput;\n }\n });\n spacing.mui = true;\n return spacing;\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport { deepmerge } from '@material-ui/utils';\nimport createBreakpoints from './createBreakpoints';\nimport createMixins from './createMixins';\nimport createPalette from './createPalette';\nimport createTypography from './createTypography';\nimport shadows from './shadows';\nimport shape from './shape';\nimport createSpacing from './createSpacing';\nimport transitions from './transitions';\nimport zIndex from './zIndex';\n\nfunction createMuiTheme() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var _options$breakpoints = options.breakpoints,\n breakpointsInput = _options$breakpoints === void 0 ? {} : _options$breakpoints,\n _options$mixins = options.mixins,\n mixinsInput = _options$mixins === void 0 ? {} : _options$mixins,\n _options$palette = options.palette,\n paletteInput = _options$palette === void 0 ? {} : _options$palette,\n spacingInput = options.spacing,\n _options$typography = options.typography,\n typographyInput = _options$typography === void 0 ? {} : _options$typography,\n other = _objectWithoutProperties(options, [\"breakpoints\", \"mixins\", \"palette\", \"spacing\", \"typography\"]);\n\n var palette = createPalette(paletteInput);\n var breakpoints = createBreakpoints(breakpointsInput);\n var spacing = createSpacing(spacingInput);\n var muiTheme = deepmerge({\n breakpoints: breakpoints,\n direction: 'ltr',\n mixins: createMixins(breakpoints, spacing, mixinsInput),\n overrides: {},\n // Inject custom styles\n palette: palette,\n props: {},\n // Provide default props\n shadows: shadows,\n typography: createTypography(palette, typographyInput),\n spacing: spacing,\n shape: shape,\n transitions: transitions,\n zIndex: zIndex\n }, other);\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n muiTheme = args.reduce(function (acc, argument) {\n return deepmerge(acc, argument);\n }, muiTheme);\n\n if (process.env.NODE_ENV !== 'production') {\n var pseudoClasses = ['checked', 'disabled', 'error', 'focused', 'focusVisible', 'required', 'expanded', 'selected'];\n\n var traverse = function traverse(node, parentKey) {\n var depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var key; // eslint-disable-next-line guard-for-in, no-restricted-syntax\n\n for (key in node) {\n var child = node[key];\n\n if (depth === 1) {\n if (key.indexOf('Mui') === 0 && child) {\n traverse(child, key, depth + 1);\n }\n } else if (pseudoClasses.indexOf(key) !== -1 && Object.keys(child).length > 0) {\n if (process.env.NODE_ENV !== 'production') {\n console.error([\"Material-UI: the `\".concat(parentKey, \"` component increases \") + \"the CSS specificity of the `\".concat(key, \"` internal state.\"), 'You can not override it like this: ', JSON.stringify(node, null, 2), '', 'Instead, you need to use the $ruleName syntax:', JSON.stringify({\n root: _defineProperty({}, \"&$\".concat(key), child)\n }, null, 2), '', 'https://material-ui.com/r/pseudo-classes-guide'].join('\\n'));\n } // Remove the style to prevent global conflicts.\n\n\n node[key] = {};\n }\n }\n };\n\n traverse(muiTheme.overrides);\n }\n\n return muiTheme;\n}\n\nexport default createMuiTheme;","export { default } from './SvgIcon';","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}","/* eslint-disable */\n// WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.\n\nconst awsmobile = {\n \"aws_project_region\": \"ap-northeast-1\",\n \"aws_cognito_identity_pool_id\": \"ap-northeast-1:5fc173df-fe1b-4eae-8751-f0978c47c795\",\n \"aws_cognito_region\": \"ap-northeast-1\",\n \"aws_user_pools_id\": \"ap-northeast-1_5IdqOOgre\",\n \"aws_user_pools_web_client_id\": \"7eurc5uc4gmm5gi0nmhcoool0q\",\n \"oauth\": {},\n \"aws_appsync_graphqlEndpoint\": \"https://r4hn7dxl7zdhlglzo3vcpbij4i.appsync-api.ap-northeast-1.amazonaws.com/graphql\",\n \"aws_appsync_region\": \"ap-northeast-1\",\n \"aws_appsync_authenticationType\": \"AMAZON_COGNITO_USER_POOLS\",\n \"aws_cloud_logic_custom\": [\n {\n \"name\": \"sharekanGateway\",\n \"endpoint\": \"https://nvtykd6ht0.execute-api.ap-northeast-1.amazonaws.com/prod\",\n \"region\": \"ap-northeast-1\"\n }\n ],\n \"aws_user_files_s3_bucket\": \"sharekan958fb700f36f4321b73b6cd166009f14-prod\",\n \"aws_user_files_s3_bucket_region\": \"ap-northeast-1\"\n};\n\n\nexport default awsmobile;\n","import * as React from 'react';\nimport clsx from 'clsx';\nimport useEventCallback from '../utils/useEventCallback';\nvar useEnhancedEffect = typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect;\n/**\n * @ignore - internal component.\n */\n\nfunction Ripple(props) {\n var classes = props.classes,\n _props$pulsate = props.pulsate,\n pulsate = _props$pulsate === void 0 ? false : _props$pulsate,\n rippleX = props.rippleX,\n rippleY = props.rippleY,\n rippleSize = props.rippleSize,\n inProp = props[\"in\"],\n _props$onExited = props.onExited,\n onExited = _props$onExited === void 0 ? function () {} : _props$onExited,\n timeout = props.timeout;\n\n var _React$useState = React.useState(false),\n leaving = _React$useState[0],\n setLeaving = _React$useState[1];\n\n var rippleClassName = clsx(classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate);\n var rippleStyles = {\n width: rippleSize,\n height: rippleSize,\n top: -(rippleSize / 2) + rippleY,\n left: -(rippleSize / 2) + rippleX\n };\n var childClassName = clsx(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate);\n var handleExited = useEventCallback(onExited); // Ripple is used for user feedback (e.g. click or press) so we want to apply styles with the highest priority\n\n useEnhancedEffect(function () {\n if (!inProp) {\n // react-transition-group#onExit\n setLeaving(true); // react-transition-group#onExited\n\n var timeoutId = setTimeout(handleExited, timeout);\n return function () {\n clearTimeout(timeoutId);\n };\n }\n\n return undefined;\n }, [handleExited, inProp, timeout]);\n return /*#__PURE__*/React.createElement(\"span\", {\n className: rippleClassName,\n style: rippleStyles\n }, /*#__PURE__*/React.createElement(\"span\", {\n className: childClassName\n }));\n}\n\nprocess.env.NODE_ENV !== \"production\" ? void 0 : void 0;\nexport default Ripple;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport { TransitionGroup } from 'react-transition-group';\nimport clsx from 'clsx';\nimport withStyles from '../styles/withStyles';\nimport Ripple from './Ripple';\nvar DURATION = 550;\nexport var DELAY_RIPPLE = 80;\nexport var styles = function styles(theme) {\n return {\n /* Styles applied to the root element. */\n root: {\n overflow: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n zIndex: 0,\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n borderRadius: 'inherit'\n },\n\n /* Styles applied to the internal `Ripple` components `ripple` class. */\n ripple: {\n opacity: 0,\n position: 'absolute'\n },\n\n /* Styles applied to the internal `Ripple` components `rippleVisible` class. */\n rippleVisible: {\n opacity: 0.3,\n transform: 'scale(1)',\n animation: \"$enter \".concat(DURATION, \"ms \").concat(theme.transitions.easing.easeInOut)\n },\n\n /* Styles applied to the internal `Ripple` components `ripplePulsate` class. */\n ripplePulsate: {\n animationDuration: \"\".concat(theme.transitions.duration.shorter, \"ms\")\n },\n\n /* Styles applied to the internal `Ripple` components `child` class. */\n child: {\n opacity: 1,\n display: 'block',\n width: '100%',\n height: '100%',\n borderRadius: '50%',\n backgroundColor: 'currentColor'\n },\n\n /* Styles applied to the internal `Ripple` components `childLeaving` class. */\n childLeaving: {\n opacity: 0,\n animation: \"$exit \".concat(DURATION, \"ms \").concat(theme.transitions.easing.easeInOut)\n },\n\n /* Styles applied to the internal `Ripple` components `childPulsate` class. */\n childPulsate: {\n position: 'absolute',\n left: 0,\n top: 0,\n animation: \"$pulsate 2500ms \".concat(theme.transitions.easing.easeInOut, \" 200ms infinite\")\n },\n '@keyframes enter': {\n '0%': {\n transform: 'scale(0)',\n opacity: 0.1\n },\n '100%': {\n transform: 'scale(1)',\n opacity: 0.3\n }\n },\n '@keyframes exit': {\n '0%': {\n opacity: 1\n },\n '100%': {\n opacity: 0\n }\n },\n '@keyframes pulsate': {\n '0%': {\n transform: 'scale(1)'\n },\n '50%': {\n transform: 'scale(0.92)'\n },\n '100%': {\n transform: 'scale(1)'\n }\n }\n };\n};\n/**\n * @ignore - internal component.\n *\n * TODO v5: Make private\n */\n\nvar TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(props, ref) {\n var _props$center = props.center,\n centerProp = _props$center === void 0 ? false : _props$center,\n classes = props.classes,\n className = props.className,\n other = _objectWithoutProperties(props, [\"center\", \"classes\", \"className\"]);\n\n var _React$useState = React.useState([]),\n ripples = _React$useState[0],\n setRipples = _React$useState[1];\n\n var nextKey = React.useRef(0);\n var rippleCallback = React.useRef(null);\n React.useEffect(function () {\n if (rippleCallback.current) {\n rippleCallback.current();\n rippleCallback.current = null;\n }\n }, [ripples]); // Used to filter out mouse emulated events on mobile.\n\n var ignoringMouseDown = React.useRef(false); // We use a timer in order to only show the ripples for touch \"click\" like events.\n // We don't want to display the ripple for touch scroll events.\n\n var startTimer = React.useRef(null); // This is the hook called once the previous timeout is ready.\n\n var startTimerCommit = React.useRef(null);\n var container = React.useRef(null);\n React.useEffect(function () {\n return function () {\n clearTimeout(startTimer.current);\n };\n }, []);\n var startCommit = React.useCallback(function (params) {\n var pulsate = params.pulsate,\n rippleX = params.rippleX,\n rippleY = params.rippleY,\n rippleSize = params.rippleSize,\n cb = params.cb;\n setRipples(function (oldRipples) {\n return [].concat(_toConsumableArray(oldRipples), [/*#__PURE__*/React.createElement(Ripple, {\n key: nextKey.current,\n classes: classes,\n timeout: DURATION,\n pulsate: pulsate,\n rippleX: rippleX,\n rippleY: rippleY,\n rippleSize: rippleSize\n })]);\n });\n nextKey.current += 1;\n rippleCallback.current = cb;\n }, [classes]);\n var start = React.useCallback(function () {\n var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var cb = arguments.length > 2 ? arguments[2] : undefined;\n var _options$pulsate = options.pulsate,\n pulsate = _options$pulsate === void 0 ? false : _options$pulsate,\n _options$center = options.center,\n center = _options$center === void 0 ? centerProp || options.pulsate : _options$center,\n _options$fakeElement = options.fakeElement,\n fakeElement = _options$fakeElement === void 0 ? false : _options$fakeElement;\n\n if (event.type === 'mousedown' && ignoringMouseDown.current) {\n ignoringMouseDown.current = false;\n return;\n }\n\n if (event.type === 'touchstart') {\n ignoringMouseDown.current = true;\n }\n\n var element = fakeElement ? null : container.current;\n var rect = element ? element.getBoundingClientRect() : {\n width: 0,\n height: 0,\n left: 0,\n top: 0\n }; // Get the size of the ripple\n\n var rippleX;\n var rippleY;\n var rippleSize;\n\n if (center || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {\n rippleX = Math.round(rect.width / 2);\n rippleY = Math.round(rect.height / 2);\n } else {\n var clientX = event.clientX ? event.clientX : event.touches[0].clientX;\n var clientY = event.clientY ? event.clientY : event.touches[0].clientY;\n rippleX = Math.round(clientX - rect.left);\n rippleY = Math.round(clientY - rect.top);\n }\n\n if (center) {\n rippleSize = Math.sqrt((2 * Math.pow(rect.width, 2) + Math.pow(rect.height, 2)) / 3); // For some reason the animation is broken on Mobile Chrome if the size if even.\n\n if (rippleSize % 2 === 0) {\n rippleSize += 1;\n }\n } else {\n var sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2;\n var sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2;\n rippleSize = Math.sqrt(Math.pow(sizeX, 2) + Math.pow(sizeY, 2));\n } // Touche devices\n\n\n if (event.touches) {\n // check that this isn't another touchstart due to multitouch\n // otherwise we will only clear a single timer when unmounting while two\n // are running\n if (startTimerCommit.current === null) {\n // Prepare the ripple effect.\n startTimerCommit.current = function () {\n startCommit({\n pulsate: pulsate,\n rippleX: rippleX,\n rippleY: rippleY,\n rippleSize: rippleSize,\n cb: cb\n });\n }; // Delay the execution of the ripple effect.\n\n\n startTimer.current = setTimeout(function () {\n if (startTimerCommit.current) {\n startTimerCommit.current();\n startTimerCommit.current = null;\n }\n }, DELAY_RIPPLE); // We have to make a tradeoff with this value.\n }\n } else {\n startCommit({\n pulsate: pulsate,\n rippleX: rippleX,\n rippleY: rippleY,\n rippleSize: rippleSize,\n cb: cb\n });\n }\n }, [centerProp, startCommit]);\n var pulsate = React.useCallback(function () {\n start({}, {\n pulsate: true\n });\n }, [start]);\n var stop = React.useCallback(function (event, cb) {\n clearTimeout(startTimer.current); // The touch interaction occurs too quickly.\n // We still want to show ripple effect.\n\n if (event.type === 'touchend' && startTimerCommit.current) {\n event.persist();\n startTimerCommit.current();\n startTimerCommit.current = null;\n startTimer.current = setTimeout(function () {\n stop(event, cb);\n });\n return;\n }\n\n startTimerCommit.current = null;\n setRipples(function (oldRipples) {\n if (oldRipples.length > 0) {\n return oldRipples.slice(1);\n }\n\n return oldRipples;\n });\n rippleCallback.current = cb;\n }, []);\n React.useImperativeHandle(ref, function () {\n return {\n pulsate: pulsate,\n start: start,\n stop: stop\n };\n }, [pulsate, start, stop]);\n return /*#__PURE__*/React.createElement(\"span\", _extends({\n className: clsx(classes.root, className),\n ref: container\n }, other), /*#__PURE__*/React.createElement(TransitionGroup, {\n component: null,\n exit: true\n }, ripples));\n});\nprocess.env.NODE_ENV !== \"production\" ? void 0 : void 0;\nexport default withStyles(styles, {\n flip: false,\n name: 'MuiTouchRipple'\n})( /*#__PURE__*/React.memo(TouchRipple));","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport clsx from 'clsx';\nimport { elementTypeAcceptingRef, refType } from '@material-ui/utils';\nimport useForkRef from '../utils/useForkRef';\nimport useEventCallback from '../utils/useEventCallback';\nimport withStyles from '../styles/withStyles';\nimport useIsFocusVisible from '../utils/useIsFocusVisible';\nimport TouchRipple from './TouchRipple';\nexport var styles = {\n /* Styles applied to the root element. */\n root: {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'relative',\n WebkitTapHighlightColor: 'transparent',\n backgroundColor: 'transparent',\n // Reset default value\n // We disable the focus ring for mouse, touch and keyboard users.\n outline: 0,\n border: 0,\n margin: 0,\n // Remove the margin in Safari\n borderRadius: 0,\n padding: 0,\n // Remove the padding in Firefox\n cursor: 'pointer',\n userSelect: 'none',\n verticalAlign: 'middle',\n '-moz-appearance': 'none',\n // Reset\n '-webkit-appearance': 'none',\n // Reset\n textDecoration: 'none',\n // So we take precedent over the style of a native element.\n color: 'inherit',\n '&::-moz-focus-inner': {\n borderStyle: 'none' // Remove Firefox dotted outline.\n\n },\n '&$disabled': {\n pointerEvents: 'none',\n // Disable link interactions\n cursor: 'default'\n }\n },\n\n /* Pseudo-class applied to the root element if `disabled={true}`. */\n disabled: {},\n\n /* Pseudo-class applied to the root element if keyboard focused. */\n focusVisible: {}\n};\n/**\n * `ButtonBase` contains as few styles as possible.\n * It aims to be a simple building block for creating a button.\n * It contains a load of style reset and some focus/ripple logic.\n */\n\nvar ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {\n var action = props.action,\n buttonRefProp = props.buttonRef,\n _props$centerRipple = props.centerRipple,\n centerRipple = _props$centerRipple === void 0 ? false : _props$centerRipple,\n children = props.children,\n classes = props.classes,\n className = props.className,\n _props$component = props.component,\n component = _props$component === void 0 ? 'button' : _props$component,\n _props$disabled = props.disabled,\n disabled = _props$disabled === void 0 ? false : _props$disabled,\n _props$disableRipple = props.disableRipple,\n disableRipple = _props$disableRipple === void 0 ? false : _props$disableRipple,\n _props$disableTouchRi = props.disableTouchRipple,\n disableTouchRipple = _props$disableTouchRi === void 0 ? false : _props$disableTouchRi,\n _props$focusRipple = props.focusRipple,\n focusRipple = _props$focusRipple === void 0 ? false : _props$focusRipple,\n focusVisibleClassName = props.focusVisibleClassName,\n onBlur = props.onBlur,\n onClick = props.onClick,\n onFocus = props.onFocus,\n onFocusVisible = props.onFocusVisible,\n onKeyDown = props.onKeyDown,\n onKeyUp = props.onKeyUp,\n onMouseDown = props.onMouseDown,\n onMouseLeave = props.onMouseLeave,\n onMouseUp = props.onMouseUp,\n onTouchEnd = props.onTouchEnd,\n onTouchMove = props.onTouchMove,\n onTouchStart = props.onTouchStart,\n onDragLeave = props.onDragLeave,\n _props$tabIndex = props.tabIndex,\n tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,\n TouchRippleProps = props.TouchRippleProps,\n _props$type = props.type,\n type = _props$type === void 0 ? 'button' : _props$type,\n other = _objectWithoutProperties(props, [\"action\", \"buttonRef\", \"centerRipple\", \"children\", \"classes\", \"className\", \"component\", \"disabled\", \"disableRipple\", \"disableTouchRipple\", \"focusRipple\", \"focusVisibleClassName\", \"onBlur\", \"onClick\", \"onFocus\", \"onFocusVisible\", \"onKeyDown\", \"onKeyUp\", \"onMouseDown\", \"onMouseLeave\", \"onMouseUp\", \"onTouchEnd\", \"onTouchMove\", \"onTouchStart\", \"onDragLeave\", \"tabIndex\", \"TouchRippleProps\", \"type\"]);\n\n var buttonRef = React.useRef(null);\n\n function getButtonNode() {\n // #StrictMode ready\n return ReactDOM.findDOMNode(buttonRef.current);\n }\n\n var rippleRef = React.useRef(null);\n\n var _React$useState = React.useState(false),\n focusVisible = _React$useState[0],\n setFocusVisible = _React$useState[1];\n\n if (disabled && focusVisible) {\n setFocusVisible(false);\n }\n\n var _useIsFocusVisible = useIsFocusVisible(),\n isFocusVisible = _useIsFocusVisible.isFocusVisible,\n onBlurVisible = _useIsFocusVisible.onBlurVisible,\n focusVisibleRef = _useIsFocusVisible.ref;\n\n React.useImperativeHandle(action, function () {\n return {\n focusVisible: function focusVisible() {\n setFocusVisible(true);\n buttonRef.current.focus();\n }\n };\n }, []);\n React.useEffect(function () {\n if (focusVisible && focusRipple && !disableRipple) {\n rippleRef.current.pulsate();\n }\n }, [disableRipple, focusRipple, focusVisible]);\n\n function useRippleHandler(rippleAction, eventCallback) {\n var skipRippleAction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : disableTouchRipple;\n return useEventCallback(function (event) {\n if (eventCallback) {\n eventCallback(event);\n }\n\n var ignore = skipRippleAction;\n\n if (!ignore && rippleRef.current) {\n rippleRef.current[rippleAction](event);\n }\n\n return true;\n });\n }\n\n var handleMouseDown = useRippleHandler('start', onMouseDown);\n var handleDragLeave = useRippleHandler('stop', onDragLeave);\n var handleMouseUp = useRippleHandler('stop', onMouseUp);\n var handleMouseLeave = useRippleHandler('stop', function (event) {\n if (focusVisible) {\n event.preventDefault();\n }\n\n if (onMouseLeave) {\n onMouseLeave(event);\n }\n });\n var handleTouchStart = useRippleHandler('start', onTouchStart);\n var handleTouchEnd = useRippleHandler('stop', onTouchEnd);\n var handleTouchMove = useRippleHandler('stop', onTouchMove);\n var handleBlur = useRippleHandler('stop', function (event) {\n if (focusVisible) {\n onBlurVisible(event);\n setFocusVisible(false);\n }\n\n if (onBlur) {\n onBlur(event);\n }\n }, false);\n var handleFocus = useEventCallback(function (event) {\n // Fix for https://github.com/facebook/react/issues/7769\n if (!buttonRef.current) {\n buttonRef.current = event.currentTarget;\n }\n\n if (isFocusVisible(event)) {\n setFocusVisible(true);\n\n if (onFocusVisible) {\n onFocusVisible(event);\n }\n }\n\n if (onFocus) {\n onFocus(event);\n }\n });\n\n var isNonNativeButton = function isNonNativeButton() {\n var button = getButtonNode();\n return component && component !== 'button' && !(button.tagName === 'A' && button.href);\n };\n /**\n * IE 11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat\n */\n\n\n var keydownRef = React.useRef(false);\n var handleKeyDown = useEventCallback(function (event) {\n // Check if key is already down to avoid repeats being counted as multiple activations\n if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') {\n keydownRef.current = true;\n event.persist();\n rippleRef.current.stop(event, function () {\n rippleRef.current.start(event);\n });\n }\n\n if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') {\n event.preventDefault();\n }\n\n if (onKeyDown) {\n onKeyDown(event);\n } // Keyboard accessibility for non interactive elements\n\n\n if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) {\n event.preventDefault();\n\n if (onClick) {\n onClick(event);\n }\n }\n });\n var handleKeyUp = useEventCallback(function (event) {\n // calling preventDefault in keyUp on a