{"version":3,"file":"js/application-cedb19972a640cfe3dc8.js","sources":["webpack:///webpack/bootstrap","webpack:///./app/javascript/components sync ^\\.\\/.*$","webpack:///./app/javascript/components/AddSample.js","webpack:///./app/javascript/components/Autofill.js","webpack:///./app/javascript/components/Chart.js","webpack:///./app/javascript/components/InviteExpander.js","webpack:///./app/javascript/components/Inviter.js","webpack:///./app/javascript/components/NameMappings.js","webpack:///./app/javascript/components/NewOrder.js","webpack:///./app/javascript/components/SampleSummary.js","webpack:///./app/javascript/components/SimpleAddSample.js","webpack:///./app/javascript/components/autofill/beerTypes.js","webpack:///./app/javascript/components/inputs/master.js","webpack:///./app/javascript/components/inputs/master/settings.js","webpack:///./app/javascript/components/inputs/phone.js","webpack:///./app/javascript/components/inputs/text.js","webpack:///./app/javascript/components/inviter/actions.js","webpack:///./app/javascript/components/inviter/form.js","webpack:///./app/javascript/components/inviter/map_dispatch_to_props.js","webpack:///./app/javascript/components/inviter/reducer.js","webpack:///./app/javascript/components/new_order/QuantityErrorMessage.js","webpack:///./app/javascript/components/new_order/actions/actions.js","webpack:///./app/javascript/components/new_order/fields.js","webpack:///./app/javascript/components/new_order/helpers/checkFieldsForValidity.js","webpack:///./app/javascript/components/new_order/helpers/otherOptionsProcessor.js","webpack:///./app/javascript/components/new_order/helpers/sampleProcessor.js","webpack:///./app/javascript/components/new_order/map_dispatch_to_props.js","webpack:///./app/javascript/components/new_order/new_order_form.js","webpack:///./app/javascript/components/new_order/order_submit_button.js","webpack:///./app/javascript/components/new_order/reducers.js","webpack:///./app/javascript/components/new_order/water_chemistry_option.js","webpack:///./app/javascript/components/subcomponents/SampleInput.js","webpack:///./app/javascript/components/subcomponents/SimpleSampleInput.js","webpack:///./app/javascript/components/subcomponents/sample_input/beer_name_textbox.js","webpack:///./app/javascript/components/subcomponents/sample_input/chemistry_accordion.js","webpack:///./app/javascript/components/subcomponents/sample_input/micro_services_accordion.js","webpack:///./app/javascript/components/subcomponents/sample_input/simple_nutrition_accordion.js","webpack:///./app/javascript/helpers/ChartData.js","webpack:///./app/javascript/helpers/ChartOptions.js","webpack:///./app/javascript/packs/application.js","webpack:///./node_modules/chart.js/Chart.js","webpack:///./node_modules/create-react-class/factory.js","webpack:///./node_modules/create-react-class/index.js","webpack:///./node_modules/dom-scroll-into-view/index.js","webpack:///./node_modules/dom-scroll-into-view/lib/dom-scroll-into-view.js","webpack:///./node_modules/dom-scroll-into-view/lib/util.js","webpack:///./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","webpack:///./node_modules/invariant/browser.js","webpack:///./node_modules/object-assign/index.js","webpack:///./node_modules/process/browser.js","webpack:///./node_modules/react-autocomplete/build/lib/Autocomplete.js","webpack:///./node_modules/react-autocomplete/node_modules/prop-types/checkPropTypes.js","webpack:///./node_modules/react-autocomplete/node_modules/prop-types/factoryWithTypeCheckers.js","webpack:///./node_modules/react-autocomplete/node_modules/prop-types/index.js","webpack:///./node_modules/react-autocomplete/node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack:///./node_modules/react-autocomplete/node_modules/prop-types/lib/has.js","webpack:///./node_modules/react-chartjs/index.js","webpack:///./node_modules/react-chartjs/lib/bar.js","webpack:///./node_modules/react-chartjs/lib/core.js","webpack:///./node_modules/react-chartjs/lib/doughnut.js","webpack:///./node_modules/react-chartjs/lib/line.js","webpack:///./node_modules/react-chartjs/lib/pie.js","webpack:///./node_modules/react-chartjs/lib/polar-area.js","webpack:///./node_modules/react-chartjs/lib/radar.js","webpack:///./node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js","webpack:///./node_modules/react-dom/cjs/react-dom-server.browser.development.js","webpack:///./node_modules/react-dom/cjs/react-dom.development.js","webpack:///./node_modules/react-dom/index.js","webpack:///./node_modules/react-dom/server.browser.js","webpack:///./node_modules/react-is/cjs/react-is.development.js","webpack:///./node_modules/react-is/index.js","webpack:///./node_modules/react-redux/es/components/Provider.js","webpack:///./node_modules/react-redux/es/components/connectAdvanced.js","webpack:///./node_modules/react-redux/es/connect/connect.js","webpack:///./node_modules/react-redux/es/connect/mapDispatchToProps.js","webpack:///./node_modules/react-redux/es/connect/mapStateToProps.js","webpack:///./node_modules/react-redux/es/connect/mergeProps.js","webpack:///./node_modules/react-redux/es/connect/selectorFactory.js","webpack:///./node_modules/react-redux/es/connect/verifySubselectors.js","webpack:///./node_modules/react-redux/es/connect/wrapMapToProps.js","webpack:///./node_modules/react-redux/es/index.js","webpack:///./node_modules/react-redux/es/utils/PropTypes.js","webpack:///./node_modules/react-redux/es/utils/Subscription.js","webpack:///./node_modules/react-redux/es/utils/isPlainObject.js","webpack:///./node_modules/react-redux/es/utils/shallowEqual.js","webpack:///./node_modules/react-redux/es/utils/verifyPlainObject.js","webpack:///./node_modules/react-redux/es/utils/warning.js","webpack:///./node_modules/react-redux/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack:///./node_modules/react-redux/node_modules/@babel/runtime/helpers/esm/extends.js","webpack:///./node_modules/react-redux/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack:///./node_modules/react-redux/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack:///./node_modules/react-redux/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack:///./node_modules/react-redux/node_modules/prop-types/checkPropTypes.js","webpack:///./node_modules/react-redux/node_modules/prop-types/factoryWithTypeCheckers.js","webpack:///./node_modules/react-redux/node_modules/prop-types/index.js","webpack:///./node_modules/react-redux/node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack:///./node_modules/react-redux/node_modules/prop-types/lib/has.js","webpack:///./node_modules/react/cjs/react.development.js","webpack:///./node_modules/react/index.js","webpack:///./node_modules/react_ujs/react_ujs/index.js","webpack:///./node_modules/react_ujs/react_ujs/src/events/detect.js","webpack:///./node_modules/react_ujs/react_ujs/src/events/native.js","webpack:///./node_modules/react_ujs/react_ujs/src/events/pjax.js","webpack:///./node_modules/react_ujs/react_ujs/src/events/turbolinks.js","webpack:///./node_modules/react_ujs/react_ujs/src/events/turbolinksClassic.js","webpack:///./node_modules/react_ujs/react_ujs/src/events/turbolinksClassicDeprecated.js","webpack:///./node_modules/react_ujs/react_ujs/src/getConstructor/fromGlobal.js","webpack:///./node_modules/react_ujs/react_ujs/src/getConstructor/fromRequireContext.js","webpack:///./node_modules/react_ujs/react_ujs/src/getConstructor/fromRequireContextWithGlobalFallback.js","webpack:///./node_modules/react_ujs/react_ujs/src/renderHelpers.js","webpack:///./node_modules/redux/es/redux.js","webpack:///./node_modules/redux/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack:///./node_modules/redux/node_modules/@babel/runtime/helpers/esm/objectSpread2.js","webpack:///./node_modules/scheduler/cjs/scheduler.development.js","webpack:///./node_modules/scheduler/index.js","webpack:///./node_modules/setimmediate/setImmediate.js","webpack:///./node_modules/timers-browserify/main.js","webpack:///(webpack)/buildin/amd-options.js","webpack:///(webpack)/buildin/global.js","webpack:///(webpack)/buildin/module.js"],"sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/packs/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./app/javascript/packs/application.js\");\n","var map = {\n\t\"./AddSample\": \"./app/javascript/components/AddSample.js\",\n\t\"./AddSample.js\": \"./app/javascript/components/AddSample.js\",\n\t\"./Autofill\": \"./app/javascript/components/Autofill.js\",\n\t\"./Autofill.js\": \"./app/javascript/components/Autofill.js\",\n\t\"./Chart\": \"./app/javascript/components/Chart.js\",\n\t\"./Chart.js\": \"./app/javascript/components/Chart.js\",\n\t\"./InviteExpander\": \"./app/javascript/components/InviteExpander.js\",\n\t\"./InviteExpander.js\": \"./app/javascript/components/InviteExpander.js\",\n\t\"./Inviter\": \"./app/javascript/components/Inviter.js\",\n\t\"./Inviter.js\": \"./app/javascript/components/Inviter.js\",\n\t\"./NameMappings\": \"./app/javascript/components/NameMappings.js\",\n\t\"./NameMappings.js\": \"./app/javascript/components/NameMappings.js\",\n\t\"./NewOrder\": \"./app/javascript/components/NewOrder.js\",\n\t\"./NewOrder.js\": \"./app/javascript/components/NewOrder.js\",\n\t\"./SampleSummary\": \"./app/javascript/components/SampleSummary.js\",\n\t\"./SampleSummary.js\": \"./app/javascript/components/SampleSummary.js\",\n\t\"./SimpleAddSample\": \"./app/javascript/components/SimpleAddSample.js\",\n\t\"./SimpleAddSample.js\": \"./app/javascript/components/SimpleAddSample.js\",\n\t\"./autofill/beerTypes\": \"./app/javascript/components/autofill/beerTypes.js\",\n\t\"./autofill/beerTypes.js\": \"./app/javascript/components/autofill/beerTypes.js\",\n\t\"./inputs/master\": \"./app/javascript/components/inputs/master.js\",\n\t\"./inputs/master.js\": \"./app/javascript/components/inputs/master.js\",\n\t\"./inputs/master/settings\": \"./app/javascript/components/inputs/master/settings.js\",\n\t\"./inputs/master/settings.js\": \"./app/javascript/components/inputs/master/settings.js\",\n\t\"./inputs/phone\": \"./app/javascript/components/inputs/phone.js\",\n\t\"./inputs/phone.js\": \"./app/javascript/components/inputs/phone.js\",\n\t\"./inputs/text\": \"./app/javascript/components/inputs/text.js\",\n\t\"./inputs/text.js\": \"./app/javascript/components/inputs/text.js\",\n\t\"./inviter/actions\": \"./app/javascript/components/inviter/actions.js\",\n\t\"./inviter/actions.js\": \"./app/javascript/components/inviter/actions.js\",\n\t\"./inviter/form\": \"./app/javascript/components/inviter/form.js\",\n\t\"./inviter/form.js\": \"./app/javascript/components/inviter/form.js\",\n\t\"./inviter/map_dispatch_to_props\": \"./app/javascript/components/inviter/map_dispatch_to_props.js\",\n\t\"./inviter/map_dispatch_to_props.js\": \"./app/javascript/components/inviter/map_dispatch_to_props.js\",\n\t\"./inviter/reducer\": \"./app/javascript/components/inviter/reducer.js\",\n\t\"./inviter/reducer.js\": \"./app/javascript/components/inviter/reducer.js\",\n\t\"./new_order/QuantityErrorMessage\": \"./app/javascript/components/new_order/QuantityErrorMessage.js\",\n\t\"./new_order/QuantityErrorMessage.js\": \"./app/javascript/components/new_order/QuantityErrorMessage.js\",\n\t\"./new_order/actions/actions\": \"./app/javascript/components/new_order/actions/actions.js\",\n\t\"./new_order/actions/actions.js\": \"./app/javascript/components/new_order/actions/actions.js\",\n\t\"./new_order/fields\": \"./app/javascript/components/new_order/fields.js\",\n\t\"./new_order/fields.js\": \"./app/javascript/components/new_order/fields.js\",\n\t\"./new_order/helpers/checkFieldsForValidity\": \"./app/javascript/components/new_order/helpers/checkFieldsForValidity.js\",\n\t\"./new_order/helpers/checkFieldsForValidity.js\": \"./app/javascript/components/new_order/helpers/checkFieldsForValidity.js\",\n\t\"./new_order/helpers/otherOptionsProcessor\": \"./app/javascript/components/new_order/helpers/otherOptionsProcessor.js\",\n\t\"./new_order/helpers/otherOptionsProcessor.js\": \"./app/javascript/components/new_order/helpers/otherOptionsProcessor.js\",\n\t\"./new_order/helpers/sampleProcessor\": \"./app/javascript/components/new_order/helpers/sampleProcessor.js\",\n\t\"./new_order/helpers/sampleProcessor.js\": \"./app/javascript/components/new_order/helpers/sampleProcessor.js\",\n\t\"./new_order/map_dispatch_to_props\": \"./app/javascript/components/new_order/map_dispatch_to_props.js\",\n\t\"./new_order/map_dispatch_to_props.js\": \"./app/javascript/components/new_order/map_dispatch_to_props.js\",\n\t\"./new_order/new_order_form\": \"./app/javascript/components/new_order/new_order_form.js\",\n\t\"./new_order/new_order_form.js\": \"./app/javascript/components/new_order/new_order_form.js\",\n\t\"./new_order/order_submit_button\": \"./app/javascript/components/new_order/order_submit_button.js\",\n\t\"./new_order/order_submit_button.js\": \"./app/javascript/components/new_order/order_submit_button.js\",\n\t\"./new_order/reducers\": \"./app/javascript/components/new_order/reducers.js\",\n\t\"./new_order/reducers.js\": \"./app/javascript/components/new_order/reducers.js\",\n\t\"./new_order/water_chemistry_option\": \"./app/javascript/components/new_order/water_chemistry_option.js\",\n\t\"./new_order/water_chemistry_option.js\": \"./app/javascript/components/new_order/water_chemistry_option.js\",\n\t\"./subcomponents/SampleInput\": \"./app/javascript/components/subcomponents/SampleInput.js\",\n\t\"./subcomponents/SampleInput.js\": \"./app/javascript/components/subcomponents/SampleInput.js\",\n\t\"./subcomponents/SimpleSampleInput\": \"./app/javascript/components/subcomponents/SimpleSampleInput.js\",\n\t\"./subcomponents/SimpleSampleInput.js\": \"./app/javascript/components/subcomponents/SimpleSampleInput.js\",\n\t\"./subcomponents/sample_input/beer_name_textbox\": \"./app/javascript/components/subcomponents/sample_input/beer_name_textbox.js\",\n\t\"./subcomponents/sample_input/beer_name_textbox.js\": \"./app/javascript/components/subcomponents/sample_input/beer_name_textbox.js\",\n\t\"./subcomponents/sample_input/chemistry_accordion\": \"./app/javascript/components/subcomponents/sample_input/chemistry_accordion.js\",\n\t\"./subcomponents/sample_input/chemistry_accordion.js\": \"./app/javascript/components/subcomponents/sample_input/chemistry_accordion.js\",\n\t\"./subcomponents/sample_input/micro_services_accordion\": \"./app/javascript/components/subcomponents/sample_input/micro_services_accordion.js\",\n\t\"./subcomponents/sample_input/micro_services_accordion.js\": \"./app/javascript/components/subcomponents/sample_input/micro_services_accordion.js\",\n\t\"./subcomponents/sample_input/simple_nutrition_accordion\": \"./app/javascript/components/subcomponents/sample_input/simple_nutrition_accordion.js\",\n\t\"./subcomponents/sample_input/simple_nutrition_accordion.js\": \"./app/javascript/components/subcomponents/sample_input/simple_nutrition_accordion.js\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"./app/javascript/components sync recursive ^\\\\.\\\\/.*$\";","var React = require('react');\nimport SampleInput from './subcomponents/SampleInput';\n\nclass AddSample extends React.Component {\n\n constructor() {\n super();\n this.state = {\n samples: [],\n options: JSON.parse(document.getElementById('json_beers').value),\n checked: {}\n };\n this.clickOnAddSample = this.clickOnAddSample.bind(this);\n this.removeSample = this.removeSample.bind(this);\n this.chooseSample = this.chooseSample.bind(this);\n this.samples = this.samples.bind(this);\n this.storeSamples = this.storeSamples.bind(this);\n }\n\n namedSample() {\n const option = this.state.options[0];\n return {\n name: option ? option.name : '',\n selection: option ? option.id : 'new_beer',\n checked: {},\n cost: {}\n }\n }\n\n clickOnAddSample() {\n const samples = this.storeSamples().concat([this.namedSample()]);\n this.props.actions.changeSamples(samples);\n }\n\n removeSample(index) {\n let samples = this.storeSamples();\n samples.splice(index, 1);\n this.props.actions.changeSamples(samples);\n }\n\n chooseSample(index, selection, name) {\n let samples = this.storeSamples();\n samples[index] = {\n ...samples[index],\n name: name,\n selection: selection\n };\n this.props.actions.changeSamples(samples);\n }\n\n storeSamples() {\n return this.props.store.samples\n }\n\n samples() {\n return this.storeSamples().map((sample, index)=> {\n return (\n \n );\n })\n }\n\n render() {\n return (\n
\n
\n
\n {this.samples()}\n
\n
\n +\n
To add products, click the (+) icon, you can add more than one!
\n\n
\n );\n }\n}\n\nexport default AddSample","var React = require('react');\nimport Autocomplete from 'react-autocomplete';\nimport beerTypes from './autofill/beerTypes.js'\n\nclass AddSample extends React.Component {\n\n constructor() {\n super();\n this.state = {value: ''}\n this.items = this.items.bind(this);\n }\n\n items() {\n const val = this.state.value.toLowerCase();\n\n if (val.length > 0) {\n return beerTypes.filter((item) => {\n const label = item.label.toLowerCase();\n return label.includes(val)\n })\n } else {\n return beerTypes;\n }\n }\n\n render() {\n return (\n
\n item.label}\n items={this.items()}\n renderItem={(item, isHighlighted) =>\n
\n {item.label}\n
\n }\n value={this.state.value}\n onChange={(e) => this.setState({value: e.target.value})}\n onSelect={(val) => this.setState({value: val})}\n />\n
\n );\n }\n}\n\nexport default AddSample","var React = require(\"react\");\nvar LineChart = require(\"react-chartjs\").Line;\nimport chartOptions from \"../helpers/ChartOptions\";\nimport chartData from \"../helpers/ChartData\";\nclass Chart extends React.Component {\n constructor(props) {\n super(props);\n this.getChartTitle = this.getChartTitle.bind(this);\n this.minData = this.minData.bind(this);\n this.state = {\n viewAll: false,\n minData: this.minData(chartData(this.props.type, this.props.is_water)),\n };\n }\n\n getChartTitle() {\n switch (this.props.type) {\n case \"abv\":\n return \"Alcohol (ABV)\";\n case \"calories\":\n return \"Calories (kcal/12oz)\";\n case \"real_degree_ferm\":\n return \"Real Deg. of Fermentation\";\n case \"app_degree_of_frem_ww\":\n return \"Apparent Deg. of Fermentation\";\n case \"p_original_extract_ww\":\n return \"Original Gravity (Plato)\";\n case \"spec_gravity_alcohol\":\n return \"Final Gravity (SG)\";\n case \"real_extract_ww\":\n return \"Real Extract (Plato)\";\n case \"app_extract_ww\":\n return \"Final Gravity (Plato)\";\n case \"color\":\n return \"Color Value (SRM)\";\n case \"ibu\":\n return \"IBU\";\n case \"sodium\":\n return \"Sodium\";\n case \"ph\":\n return \"pH\";\n case \"ph_water\":\n return \"pH\";\n case \"calcium\":\n return \"Calcium (ppm)\";\n case \"magnesium\":\n return \"Magnesium (ppm)\t\";\n case \"bicarbonate\":\n return \"Bicarbonate (ppm)\";\n case \"chloride\":\n return \"Chloride (ppm)\";\n case \"potassium\":\n return \"Potassium (ppm)\";\n case \"sulfate\":\n return \"Sulfate (ppm)\";\n case \"zinc\":\n return \"Zinc (ppm)\";\n case \"acetic_acid\":\n return \"Acetic Acid (mg/L)\";\n case \"lactic_acid\":\n return \"Lactic Acid (ppm)\";\n case \"sulfur_dioxide\":\n return \"Sulfur Dioxide (ppm)\";\n case \"fan\":\n return \"FAN (ppm)\";\n case \"vdk\":\n return \"VDK (ppm)\";\n case \"acetaldehyde\":\n return \"Acetaldehyde (ppm)\";\n }\n }\n\n minData(data) {\n const copy = JSON.parse(JSON.stringify(data));\n\n /*\n const newdata = [\n copy.datasets[0].data[0],\n copy.datasets[0].data.slice(-1)[0],\n ];\n\n const newlabels = [copy.labels[0], copy.labels.slice(-1)[0]];\n */\n\n const newdata = [];\n for (let i = 1; i <= 10 && i <= copy.datasets[0].data.length; i++) {\n newdata.unshift(copy.datasets[0].data.slice(-i)[0]);\n }\n\n const newlabels = [];\n for (let i = 1; i <= 10 && i <= copy.datasets[0].data.length; i++) {\n newlabels.unshift(copy.labels.slice(-i)[0]);\n }\n\n copy.datasets[0].data = newdata;\n copy.labels = newlabels;\n\n return copy;\n }\n\n get showButtonToViewData() {\n return !(\n this.copyData.labels.length === this.minData(this.copyData).labels.length\n );\n }\n\n get copyData() {\n let clone = JSON.parse(\n JSON.stringify(chartData(this.props.type, this.props.is_water))\n );\n\n return clone;\n }\n\n render() {\n return (\n
\n
\n
\n
{this.getChartTitle()}
\n
\n\n {this.state.viewAll ? (\n \n ) : (\n \n )}\n\n {this.showButtonToViewData && (\n this.setState({ viewAll: !this.state.viewAll })}\n >\n View All Historical Data\n \n )}\n
\n
\n );\n }\n}\n\nexport default Chart;\n","var React = require('react');\nimport Inviter from './Inviter';\n\nclass InviteExpander extends React.Component {\n\n constructor() {\n super();\n this.state = {\n expanded: false\n };\n this.onClick = this.onClick.bind(this)\n this.inviteeForm = this.inviteeForm.bind(this)\n this.getAddButtonText = this.getAddButtonText.bind(this)\n }\n\n onClick() {\n this.setState({\n expanded: !this.state.expanded\n })\n }\n\n inviteeForm() {\n if (this.state.expanded) {\n const brewery = JSON.parse(this.props.brewery).brewery;\n return (\n \n )\n }\n }\n\n getAddButtonText(){\n return this.props.fromBreweryPage ? 'Invite Users to Brewery' : 'Invite Admin Users'\n }\n\n render() {\n const className = this.state.expanded ? 'open' : '';\n return (\n
\n
\n
\n
\n \n
\n\n
\n
\n {\n this.inviteeForm()\n }\n
\n );\n }\n}\n\nexport default InviteExpander","import React from 'react';\nimport {render} from 'react-dom';\nimport {Provider, connect} from 'react-redux';\nimport {createStore} from 'redux';\nimport Form from './inviter/form';\nimport inviteeReducer from './inviter/reducer';\nimport mapDispatchToProps from './inviter/map_dispatch_to_props';\nconst csfrToken = document.getElementsByName('csrf-token')[0];\nconst authenticationToken = csfrToken != null ? csfrToken.getAttribute('content') : '';\n\nconst initial_state = {invitees: [{ invitee: '', v: 1 }, {invitee: '', v:2 }, {invitee: '', v:3 }, {invitee: '', v:4 }]};\nconst store = createStore(inviteeReducer, initial_state);\n\nfunction mapStateToProps(state) {\n return {\n store: state,\n authenticationToken: authenticationToken\n }\n}\n\nconst ConnectedForm = connect(mapStateToProps, mapDispatchToProps)(Form);\n\nclass Inviter extends React.Component {\n\n render() {\n return (\n \n \n \n );\n }\n}\n\nexport default Inviter","export default {\n production_suite: \"Production Suite\",\n production_suite_plus: \"Production Suite+\",\n alcolyzer_selzer: \"Basic Suite\",\n gas_analysis: \"Packaging Suite\",\n chemistry__acetic_acid: \"Acetic Acid\",\n chemistry__lactic_acid: \"Lactic Acid\",\n chemistry__fermentable_sugars: \"Fermentable Sugars\",\n chemistry__sulfur_dioxide: \"Sulfur Dioxide\",\n chemistry__free_amino_nitrogen: \"Free Amino Nitrogen\",\n chemistry__vicinal_diketones: \"VDK\",\n chemistry__acetaldehyde: \"Acetaldehyde\",\n simple_nutrition: \"Nutrition Panel\",\n simple_nutrition__polyphenols: \"Polyphenol\",\n simple_nutrition__starch: \"Starch\",\n microservices__pcr_yeast_analysis: \"qPCR Yeast Analysis\",\n microservices__pcr_bacteria_analysis: \"qPCR Bacteria Analysis\",\n microservices__shelf_life_analysis: \"Shelf Analysis\",\n microservices__plate_analysis: \"Plating (Single Media)\",\n microservices__pcr_and_plate_analysis: \"Plating (Comprehensive Media)\",\n microservices__pasteurization_analysis: \"Pathogen Organisms\"\n};\n","import React from 'react';\nimport {render} from 'react-dom';\nimport {Provider, connect} from 'react-redux';\nimport {createStore} from 'redux';\nimport rootReducer from './new_order/reducers';\nimport fields from './new_order/fields';\nimport Form from './new_order/new_order_form';\nimport mapDispatchToProps from './new_order/map_dispatch_to_props';\n\nconst costMappings = JSON.parse(document.getElementById('cost-mappings').getAttribute('data_value'));;\nlet brewery_data = JSON.parse(document.getElementById('brewery-data').getAttribute('data_value'));\nlet batchOptions = JSON.parse(document.getElementById('batch-options').getAttribute('data_value'));\n\nconst csfrToken = document.getElementsByName('csrf-token')[0];\nconst authenticationToken = csfrToken != null ? csfrToken.getAttribute('content') : '';\n\n\nconst initial_state = {\n brewery: brewery_data,\n batchOptions: batchOptions,\n samples: [],\n beers: [],\n fields: fields,\n other_options: {\n water_chemistry: {\n checked: false,\n cost: costMappings.water_chemistry,\n },\n water_chemistry_plus: {\n checked: false,\n cost: costMappings.water_chemistry_plus,\n },\n },\n};\n\nconst store = createStore(rootReducer, initial_state);\n\nfunction mapStateToProps(state) {\n return {\n store: state,\n authenticationToken: authenticationToken\n }\n}\n\nconst ConnectedForm = connect(mapStateToProps, mapDispatchToProps)(Form);\n\nclass NewOrder extends React.Component {\n\n render() {\n return (\n \n \n \n );\n }\n}\n\nexport default NewOrder\n","var React = require('react');\nconst beerOptions = JSON.parse(document.getElementById('json_beers').value);\nimport optionNames from './NameMappings'\n\nconst costMappings = JSON.parse(document.getElementById('cost-mappings').getAttribute('data_value'));\nclass SampleSummary extends React.Component {\n\n constructor() {\n super();\n this.lineItems = this.lineItems.bind(this);\n this.items = this.items.bind(this);\n this.waterChemistrySummary = this.waterChemistrySummary.bind(this);\n }\n\n items(sample, index) {\n if (sample.totalCost > 0) {\n return (\n
\n {this.costs(sample.cost, index)}\n
\n )\n } else {\n return (\n
\n No cost\n
\n )\n }\n }\n\n costs(cost, index) {\n let items = [];\n for (let property in cost) {\n const value = cost[property];\n if (value != null && value > 0) {\n items.push((\n
\n
{optionNames[property]}
\n
${value}
\n
\n ))\n }\n }\n return items;\n }\n\n lineItems() {\n const self = this;\n return this.props.store.samples.map((sample, index)=> {\n return (\n
\n
\n Beer {index + 1}: {sample.name}\n
\n { this.items(sample, index) }\n
\n );\n })\n }\n\n waterChemistrySummary() {\n if(this.props.store.other_options.water_chemistry.checked) {\n return (\n
\n
\n Water Chemistry\n
\n\n
\n
\n
Water Chemistry
\n
${costMappings['water_chemistry']}
\n
\n {\n this.props.store.other_options.water_chemistry_plus.checked &&\n
\n
Water Chemistry Plus
\n
${costMappings['water_chemistry_plus']}
\n
\n }\n
\n\n
\n )\n }\n }\n\n render() {\n return (\n
\n {this.lineItems()}\n {this.waterChemistrySummary()}\n
\n );\n }\n}\n\nexport default SampleSummary","var React = require('react');\nimport SimpleSampleInput from './subcomponents/SimpleSampleInput';\n\nclass SimpleAddSample extends React.Component {\n\n constructor(){\n super();\n this.state = {\n samples: [],\n options: JSON.parse(document.getElementById('json_beers').value)\n };\n this.clickOnSimpleAddSample = this.clickOnSimpleAddSample.bind(this);\n this.removeSample = this.removeSample.bind(this);\n this.chooseSample = this.chooseSample.bind(this);\n }\n\n clickOnSimpleAddSample(){\n this.setState({\n samples: this.state.samples.concat([''])\n })\n }\n\n removeSample(index){\n let samples = this.state.samples;\n samples.splice(index, 1);\n this.setState({\n samples: samples\n });\n }\n\n chooseSample(index, selection){\n let samples = this.state.samples;\n samples[index] = selection;\n this.setState({\n samples: samples\n });\n }\n\n samples(){\n return this.state.samples.map((sample, index)=>{\n return (\n \n );\n })\n }\n\n render() {\n return (\n
\n
\n +\n {this.samples()}\n
\n
\n );\n }\n}\n\nexport default SimpleAddSample","export default [\n {label: 'American Light Lager'},\n {label: 'American Lager'},\n {label: 'Cream Ale'},\n {label: 'American Wheat Beer'},\n {label: 'International Pale Lager'},\n {label: 'International Amber Lager'},\n {label: 'International Dark Lager'},\n {label: 'Czech Light Lager'},\n {label: 'Czech Pilsner'},\n {label: 'New England Style IPA'},\n {label: 'Czech Amber Lager'},\n {label: 'Czech Dark Lager'},\n {label: 'Munich Helles'},\n {label: 'Festbier'},\n {label: 'Helles Bock'},\n {label: 'German Leichtbier'},\n {label: 'Kolsch'},\n {label: 'German Exportbier'},\n {label: 'German Pils'},\n {label: 'Marzen'},\n {label: 'Rauchbier'},\n {label: 'Dunkels Bock'},\n {label: 'Vienna Lager'},\n {label: 'Altbier'},\n {label: 'Kellerbier'},\n {label: 'Kellerbier: Munich Kellerbier'},\n {label: 'Kellerbier: Franconian Kellerbier'},\n {label: 'Munich Dunkel'},\n {label: 'Schwarzbier'},\n {label: 'Doppelbock'},\n {label: 'Eisbock'},\n {label: 'Baltic Porter'},\n {label: 'Weissbier'},\n {label: 'Dunkels Weissbier'},\n {label: 'Weizenbock'},\n {label: 'Ordinary Bitter'},\n {label: 'Best Bitter'},\n {label: 'Strong Bitter'},\n {label: 'English Golden Ale'},\n {label: 'Australian Sparkling Ale'},\n {label: 'English IPA'},\n {label: 'Dark Mild'},\n {label: 'English Brown Ale'},\n {label: 'English Porter'},\n {label: 'Scottish Light'},\n {label: 'Scottish Heavy'},\n {label: 'Irish Red Ale'},\n {label: 'Irish Stout'},\n {label: 'Irish Extra Stout'},\n {label: 'Sweet Stout'},\n {label: 'Oatmeal Stout'},\n {label: 'Tropical Stout'},\n {label: 'Foreign Export Stout'},\n {label: 'English Strong Ale'},\n {label: 'Old Ale'},\n {label: 'Wee Heavy'},\n {label: 'English Barleywine'},\n {label: 'Blonde Ale'},\n {label: 'American Pale Ale'},\n {label: 'American Amber Ale'},\n {label: 'California Common'},\n {label: 'American Brown Ale'},\n {label: 'American Porter'},\n {label: 'American Stout'},\n {label: 'Russian Imperial Stout'},\n {label: 'American IPA'},\n {label: 'Specialty IPA'},\n {label: 'Specialty IPA: Black IPA'},\n {label: 'Specialty IPA: Brown IPA'},\n {label: 'Specialty IPA: White IPA'},\n {label: 'Specialty IPA: Rye IPA'},\n {label: 'Specialty IPA: Belgian IPA'},\n {label: 'Specialty IPA: Red IPA'},\n {label: 'Double IPA'},\n {label: 'American Strong Ale'},\n {label: 'American Barleywine'},\n {label: 'Wheatwine'},\n {label: 'Berliner Weisse'},\n {label: 'Flanders Red Ale'},\n {label: 'Oud Bruin'},\n {label: 'Lambic'},\n {label: 'Gueuze'},\n {label: 'Fruit Lambic'},\n {label: 'Witbier'},\n {label: 'Belgian Pale Ale'},\n {label: 'Biere de Garde'},\n {label: 'Belgian Blond Ale'},\n {label: 'Saison'},\n {label: 'Belgian Golden Strong Ale'},\n {label: 'Trappist Single'},\n {label: 'Belgian Dubbel'},\n {label: 'Belgian Tripel'},\n {label: 'Belgian Dark Strong Ale'},\n {label: 'Historical Beer: Gose'},\n {label: 'Historical Beer: Pivo Grodziskie'},\n {label: 'Historical Beer: Lichtenhainer'},\n {label: 'Historical Beer: Roggenbier'},\n {label: 'Historical Beer: Sahti'},\n {label: 'Historical Beer: Kentucky Common'},\n {label: 'Historical Beer: Pre-Prohibition Lager'},\n {label: 'Historical Beer: Pre-Prohibition Porter'},\n {label: 'Historical Beer: London Brown Ale'},\n {label: 'Brett Beer'},\n {label: 'Mixed Fermentation Sour Beer'},\n {label: 'Soured Fruit Beer'},\n {label: 'Fruit Beer'},\n {label: 'Fruit and Spice Beer'},\n {label: 'Speciality Fruit Beer'},\n {label: 'Spice, Herb, or Vegetable Beer'},\n {label: 'Autumn Seasonal Beer'},\n {label: 'Winter Seasonal Beer'},\n {label: 'Alternative Grain Beer'},\n {label: 'Alternative Sugar Beer'},\n {label: 'Classic Style Smoked Beer'},\n {label: 'Specialty Smoked Beer'},\n {label: 'Wood-Aged Beer'},\n {label: 'Specialty Wood-Aged Beer'},\n {label: 'Clone Beer'},\n {label: 'Mixed-Style Beer'},\n {label: 'Experimental Beer'}\n]","var React = require('react');\nimport { phoneSettings, defaultSettings } from './master/settings'\nclass MasterInput extends React.Component {\n\n constructor(){\n super()\n this.onChange = this.onChange.bind(this)\n this.value = this.value.bind(this)\n this.typeSettings = this.typeSettings.bind(this)\n }\n\n onChange(e){\n this.props.actions.updateField(this.props.name, { value: this.formatter(e.target.value), is_touched: true })\n }\n\n formatter(value){\n return this.typeSettings().formatter(value);\n }\n\n typeSettings(){\n switch(this.props.type){\n case 'phone':\n return phoneSettings;\n default:\n return defaultSettings;\n }\n }\n\n isValid(){\n return this.props.store.fields[this.props.name].validator(this.value())\n }\n\n value(){\n return this.props.store.fields[this.props.name].value\n }\n\n isTouched(){\n return this.props.store.fields[this.props.name].is_touched\n }\n\n errorMessage(){\n if(!this.isValid() && this.isTouched()) {\n return (\n
\n {this.props.store.fields[this.props.name].errorMessage}\n
\n )\n }\n }\n\n render() {\n return (\n
\n {this.errorMessage()}\n \n
\n );\n }\n}\n\nexport default MasterInput\n","export const phoneSettings = {\n formatter: (value) => {\n let tel = value.replace(/\\D/g,'');\n\n if(tel.length > 3 && tel.length <= 6){\n tel = tel.substr(0, 3) + \"-\" + tel.substr(3)\n } else if(tel.length >= 7){\n debugger;\n tel = tel.substr(0, 3) + \"-\" + tel.substr(3, 3) + \"-\" + tel.substr(6)\n }\n return tel;\n },\n maxlength: 12\n}\n\nexport const defaultSettings = {\n formatter: (value) => {\n return value;\n }\n}","var React = require('react');\nimport MasterInput from './master'\nclass PhoneInput extends React.Component {\n\n render() {\n return (\n \n );\n }\n}\n\nexport default PhoneInput\n","var React = require('react');\nimport MasterInput from './master'\nclass TextInput extends React.Component {\n\n render() {\n return (\n \n );\n }\n}\n\nexport default TextInput\n","export const addInvitee = () => ({ type: 'add-invitee' })\nexport const updateInvitee = (index, invitee) => ({ type: 'update-invitee', index: index, invitee: invitee })\nexport const removeInvitee = (index) => ({ type: 'remove-invitee', index: index })","var React = require('react');\n\nclass InviterForm extends React.Component {\n\n constructor() {\n super();\n this.onClick = this.onClick.bind(this);\n this.remove = this.remove.bind(this);\n this.update = this.update.bind(this);\n this.header = this.header.bind(this);\n this.getRoleOptions = this.getRoleOptions.bind(this);\n }\n\n header() {\n if (!this.props.hideHeader) {\n return (\n
\n
\n
\n
\n Invite Members to {this.props.brewery.name}\n
\n
\n
\n
\n )\n }\n }\n\n onClick() {\n this.props.actions.addInvitee()\n }\n\n remove(index) {\n this.props.actions.removeInvitee(index)\n }\n\n update(e, index) {\n const invitee = this.props.store.invitees[index];\n this.props.actions.updateInvitee(index, {\n ...invitee,\n email: e.target.value\n })\n }\n\n getRoleOptions(index) {\n if (this.props.adminOnly) {\n return (\n \n )\n } else {\n return (\n \n )\n }\n }\n\n invites() {\n return this.props.store.invitees.map((invite, index) => {\n return (\n
\n
\n {\n this.update(e, index)\n }}\n type=\"text\"\n />\n {this.getRoleOptions(index)}\n
{\n this.remove(index)\n }}>x\n
\n
\n
\n )\n }\n );\n }\n\n render() { \n return (\n
\n {this.header()}\n
\n
\n
\n
\n
\n \n {this.invites()}\n
\n (+) Add another\n \n \n \n
\n
\n
\n\n
\n
\n
\n
\n );\n }\n}\n\nexport default InviterForm;","import { addInvitee, removeInvitee, updateInvitee } from './actions'\n\nexport default function mapDispatchToProps(dispatch) {\n return {\n actions: {\n addInvitee: () => { dispatch(addInvitee()) },\n updateInvitee: (index, invitee) => { dispatch(updateInvitee(index, invitee)) },\n removeInvitee: (index) => { dispatch(removeInvitee(index)) }\n }\n }\n}","export default (state, action) => {\n let new_state;\n\n\n switch (action.type) {\n case 'update-invitee':\n state.invitees[action.index] = action.invitee;\n new_state = {\n ...state,\n invitees: state.invitees\n }\n break;\n case 'add-invitee':\n new_state = {\n ...state,\n invitees: state.invitees.concat([{ invitee: '', role: null }])\n }\n break;\n case 'remove-invitee':\n state.invitees.splice(action.index, 1)\n new_state = {\n ...state,\n invitees: state.invitees\n }\n break;\n default:\n new_state = {\n ...state\n }\n break;\n }\n\n\n return new_state;\n\n}","var React = require('react');\nconst costMappings = JSON.parse(document.getElementById('cost-mappings').getAttribute('data_value'));\nimport optionNames from '../NameMappings'\n\nclass QuantityErrorMessage extends React.Component {\n\n constructor() {\n super();\n }\n\n quantityLeft(type) {\n return (this.props.store.brewery.capacities[type] || {}).quantity_left || 0;\n }\n\n quantity(type) {\n return (this.props.store.brewery.capacities[type] || {}).quantity || 0;\n }\n\n get overUsedArray(){\n return ['production_suite', 'bacterial_analysis', 'yeast_analysis', 'alcolyzer_selzer'].filter((prop)=>{\n if(this.quantity(prop) === 0) { // return false, user does not have subsc. for prop\n return false\n } else {\n const remaining = this.quantityLeft(prop) - (this.props.store.checkCount || {})[prop]\n return remaining < 0 //exceeds usage\n }\n })\n }\n\n get overused(){\n return this.overUsedArray.map((o)=>{\n return optionNames[o]\n })\n .join(', ')\n }\n\n render() {\n return (\n
\n {\n this.overUsedArray.length > 0 &&\n
\n
\n
\n
\n You have exceeded your subscription for: {this.overused}\n \n
\n
\n
\n
\n }\n
\n );\n }\n}\n\nexport default QuantityErrorMessage","export const change = () => ({ type: 'change' })\nexport const changeSamples = (samples) => ({ type: 'change_samples', value: samples })\nexport const updateField = (name, value) => ({ type: 'update_field', name, value })\nexport const checkValid = () => ({ type: 'check_valid' })\nexport const touchAllFields = () => ({ type: 'touch_all_fields' })\nexport const checkInput = (index, inputName, checked) => ({ type: 'check_input', index: index, inputName: inputName, checked: checked})\nexport const checkOtherOptions = (inputName, checked) => ({ type: 'check_other_options', inputName: inputName, checked: checked})\nexport const changeSample = (index, sample) => ({ type: 'change_sample', index: index, sample: sample})\nexport const clickAccordion = (index, checked) => ({ type: 'click_accordion', index: index, checked: checked})","const required = (value)=>{\n if(value != null && value != ''){\n return true\n } else {\n return false\n }\n}\n\nexport default {\n 'contact_name': {\n value: '',\n validator: required,\n errorMessage: 'Field is required',\n is_touched: false\n },\n 'phone': {\n value: '',\n validator: (value)=> {\n return value != null && value.length === 12 && required(value);\n },\n errorMessage: 'Must enter a valid phone number',\n is_touched: false\n },\n 'email': {\n value: '',\n validator: required,\n errorMessage: 'Field is required',\n is_touched: false\n }\n}\n\n\n","export const checkFieldsForValidity = (fields) => {\n let valid = true;\n for(let property in fields){\n const f = fields[property];\n const v = f.validator(f.value)\n if(v === false){\n valid = false;\n }\n }\n\n return valid;\n};\n\nexport const touchAll = (fields) => {\n let newFields = {\n ...fields\n }\n for(let property in newFields){\n newFields = {\n ...newFields,\n [property]: {\n ...newFields[property],\n is_touched: true\n }\n }\n\n }\n\n return newFields;\n};","export const checkOtherOption = (state, action) => {\n const inputName = action.inputName;\n return {\n ...state.other_options,\n [inputName]: {\n ...state.other_options[inputName],\n checked: action.checked\n }\n }\n\n};","const costMappings = JSON.parse(document.getElementById('cost-mappings').getAttribute('data_value'));;\n\nexport const countFor = (state, type) => {\n return state.samples.filter((s)=>{return s.checked[type] == true}).length\n}\n\nconst getDepletionQuantityCost = (state, sample, type)=>{\n const capacity_quantity = (state.brewery.capacities[type] || {}).quantity || 0\n return capacity_quantity > 0 ? 0 : cost(sample, type)\n}\n\nconst cost = (sample, inputName) =>{\n return sample.checked[inputName] ? costMappings[inputName] : null;\n};\n\nconst getTotalCost = (state, sample, index) => {\n let total = 0;\n for(let property in costMappings){\n total += getDepletionQuantityCost(state, sample, property)\n }\n\n return total\n};\nconst getCosts = (state, sample)=>{\n let costs = {};\n for(let property in costMappings){\n costs[property] = getDepletionQuantityCost(state, sample, property)\n }\n return costs;\n}\nexport const process = (state, samples) => {\n const mapped_samples = samples.map((sample, index)=>{\n\n return {\n ...sample,\n index: index,\n cost: {\n ...sample.cost,\n ...getCosts(state, sample)\n }\n }\n })\n\n return mapped_samples.map((sample, index)=>{\n return {\n ...sample,\n totalCost: getTotalCost(state, sample, index)\n }\n })\n\n};\n\nexport const checkInput = (state, action) => {\n\n const new_samples = state.samples.map((sample, index)=>{\n\n if(index == action.index){\n return {\n ...sample,\n checked: {\n ...sample.checked,\n [action.inputName]: action.checked\n }\n }\n } else{\n return sample;\n }\n\n });\n\n return process({...state, samples: new_samples}, new_samples)\n}\n\nexport const changeSample = (samples, index, sample)=>{\n return samples.map((s, i)=>{\n return index == i ? sample : s;\n })\n}\nconst uncheckAllChemistry = (sample)=>{\n let newSample = { ...sample };\n for(let property in newSample.cost) {\n if (property.startsWith('chemistry__')) {\n newSample = {\n ...newSample,\n cost: {\n ...newSample.cost,\n [property]: 0\n },\n checked: {\n ...newSample.checked,\n [property]: 0\n }\n }\n }\n }\n return newSample;\n}\nexport const uncheckChemistryAccordion = (state, samples, index) => {\n return samples.map((s, i)=>{\n if(index == i) {\n let sample = uncheckAllChemistry(s)\n return {\n ...sample,\n totalCost: getTotalCost(state, sample, index)\n }\n } else {\n return s;\n }\n })\n}\n\n\n","import { change, changeSamples, checkInput, checkOtherOptions, changeSample, updateField, touchAllFields, clickAccordion } from './actions/actions'\n\nexport default function mapDispatchToProps(dispatch) {\n return {\n actions: {\n change: () => { dispatch(change()) },\n changeSamples: (samples) => { dispatch(changeSamples(samples))},\n checkInput: (index, inputName, checked) => { dispatch(checkInput(index, inputName, checked))},\n checkValid: () => { dispatch(checkValid())},\n touchAllFields: () => { dispatch(touchAllFields())},\n updateField: (name, value) => { dispatch(updateField(name,value))},\n checkOtherOptions: (inputName, checked) => { dispatch(checkOtherOptions(inputName, checked))},\n changeSample: (index, sample) => { dispatch(changeSample(index, sample))},\n clickAccordion: (index, checked) => { dispatch(clickAccordion(index, checked))}\n }\n }\n}","var React = require(\"react\");\nimport AddSample from \"../AddSample\";\nimport PhoneInput from \"../inputs/phone.js\";\nimport TextInput from \"../inputs/text.js\";\nimport SampleSummary from \"../SampleSummary\";\nimport OrderSubmitButton from \"./order_submit_button\";\nimport WaterChemistryOption from \"./water_chemistry_option\";\nimport QuantityErrorMessage from \"./QuantityErrorMessage\";\n\nclass NewOrderForm extends React.Component {\n render() {\n return (\n
\n
\n \n\n
\n
\n
\n

\n
1
\n Add your products\n \n

\n
\n
\n
\n \n \n\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n
\n

\n
\n 2\n
\n Add your water\n

\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n

\n
3
\n Order contact\n

\n
\n
\n
\n
\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n

\n
4
\n Review and submit your order\n

\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n Your total for this order is{\" \"}\n $\n \n {this.props.store.finalCost}\n \n \n
\n
\n
\n
\n
\n
\n
\n
\n \n Please indicate in product notes if TTB\n certification will be required.\n \n
\n {/*
*/}\n {/* {*/}\n {/*this.checkboxClick('ttb-certification', e);*/}\n {/*}}*/}\n {/*/>*/}\n {/**/}\n {/*TTB certification will be required*/}\n {/**/}\n {/*
*/}\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n \n
\n );\n }\n}\n\nexport default NewOrderForm;\n","var React = require('react');\nimport { checkFieldsForValidity } from './helpers/checkFieldsForValidity'\n\nclass OrderSubmitButton extends React.Component {\n\n constructor() {\n super();\n this.isOrderEmpty = this.isOrderEmpty.bind(this);\n this.displayIfEmpty = this.displayIfEmpty.bind(this);\n this.touchAllFields = this.touchAllFields.bind(this);\n this.anyFieldIsInvalid = this.anyFieldIsInvalid.bind(this);\n }\n\n isOrderEmpty() {\n let empty = true\n this.props.store.samples.forEach((s) => {\n if (s.checked) {\n empty = false\n }\n });\n if (this.props.store.other_options.water_chemistry.checked) {\n empty = false\n }\n return empty;\n }\n\n touchAllFields(){\n this.props.actions.touchAllFields();\n }\n\n displayIfEmpty() {\n if (this.isOrderEmpty()) {\n return (\n
\n Order is empty, select some options before submitting.\n
\n )\n }\n }\n\n anyFieldIsInvalid(){\n return !checkFieldsForValidity(this.props.store.fields);\n }\n\n onClick(e){\n if(this.anyFieldIsInvalid()) {\n e.preventDefault();\n this.props.actions.touchAllFields();\n }\n }\n\n render() {\n return (\n
\n {this.displayIfEmpty()}\n
\n \n
\n
\n );\n }\n}\n\nexport default OrderSubmitButton","import {process, checkInput, changeSample, uncheckChemistryAccordion, countFor } from './helpers/sampleProcessor'\nimport {checkOtherOption } from './helpers/otherOptionsProcessor'\nimport {touchAll } from './helpers/checkFieldsForValidity'\n\nexport default (state = {}, action)=>{\n let new_state = state;\n\n switch (action.type) {\n case 'change':\n new_state = {\n ...state,\n hi: state.hi + 1\n }\n break;\n case 'change_samples':\n new_state = {\n ...state,\n samples: process(state, action.value)\n };\n break;\n case 'update_field':\n new_state = {\n ...state,\n fields: {\n ...state.fields,\n [action.name]: {\n ...state.fields[action.name],\n ...action.value,\n is_touched: true\n }\n }\n };\n break;\n case 'click_accordion':\n if(!action.checked) {\n new_state = {\n ...state,\n samples: uncheckChemistryAccordion(state, state.samples, action.index)\n }\n }\n break;\n case 'touch_all_fields':\n new_state = {\n ...state,\n fields: {\n ...touchAll(state.fields)\n }\n };\n break;\n case 'check_input':\n new_state = {\n ...state,\n samples: checkInput(state, action)\n };\n break;\n case 'check_other_options':\n new_state = {\n ...state,\n other_options: checkOtherOption(state, action)\n };\n break;\n case 'change_sample':\n new_state = {\n ...state,\n samples: changeSample(state.samples, action.index, action.sample)\n }\n break;\n default:\n break;\n }\n\n const nstate = summarizeCost(new_state);\n return nstate;\n}\n\nconst summarizeCost = (state)=>{\n let finalCost = 0;\n\n state.samples.forEach((sample)=>{\n finalCost += sample.totalCost\n })\n\n const water_chem = state.other_options['water_chemistry']\n finalCost += water_chem.checked ? water_chem.cost : 0;\n const water_chem_plus = state.other_options['water_chemistry_plus']\n finalCost += water_chem_plus.checked ? water_chem_plus.cost : 0;\n\n const checkCount = {\n 'production_suite': countFor(state, 'production_suite'),\n 'alcolyzer_selzer': countFor(state, 'alcolyzer_selzer'),\n 'bacterial_analysis': countFor(state, 'bacterial_analysis'),\n 'yeast_analysis': countFor(state, 'yeast_analysis'),\n }\n\n return {\n ...state,\n finalCost: finalCost,\n checkCount,\n }\n};","var React = require('react');\nconst costMappings = JSON.parse(document.getElementById('cost-mappings').getAttribute('data_value'));\n\nclass WaterChemistryOption extends React.Component {\n\n constructor() {\n super();\n this.checkboxClick = this.checkboxClick.bind(this);\n this.checkboxPlusClick = this.checkboxPlusClick.bind(this);\n this.waterChemistryOption = this.waterChemistryOption.bind(this);\n }\n\n checkboxClick(e) {\n this.props.actions.checkOtherOptions('water_chemistry', e.target.checked)\n }\n\n checkboxPlusClick(e) {\n this.props.actions.checkOtherOptions('water_chemistry_plus', e.target.checked)\n }\n\n waterChemistryOption() {\n return this.props.store.other_options.water_chemistry\n }\n\n render() {\n const water_chemistry_option = this.waterChemistryOption();\n return (\n
\n
\n
\n \n \n\n Water Chemistry\n (${costMappings['water_chemistry']})\n \n {\n water_chemistry_option.checked &&\n
\n \n \n Water Chemistry Plus\n (${costMappings['water_chemistry_plus']})\n \n
\n }\n {\n water_chemistry_option.checked &&\n \n }\n
\n
\n
\n );\n }\n}\n\nexport default WaterChemistryOption","var React = require(\"react\");\nimport ChemistryAccordion from \"./sample_input/chemistry_accordion\";\nimport MicroServicesAccordion from \"./sample_input/micro_services_accordion\";\nimport BeerNameTextbox from \"./sample_input/beer_name_textbox\";\nconst costMappings = JSON.parse(document.getElementById(\"cost-mappings\").getAttribute(\"data_value\"));\n\nclass SampleInput extends React.Component {\n constructor() {\n super();\n this.remove = this.remove.bind(this);\n this.changeSelection = this.changeSelection.bind(this);\n this.options = this.options.bind(this);\n this.form_input = this.form_input.bind(this);\n this.sample = this.sample.bind(this);\n this.checkboxClick = this.checkboxClick.bind(this);\n }\n\n remove() {\n this.props.removeSample(this.props.index);\n }\n\n changeSelection(event) {\n const option = this.getOptionFromEvent(event);\n this.setState({ disabled: false });\n this.props.chooseSample(\n this.props.index,\n event.target.value,\n option.name || \"\"\n );\n }\n\n getOptionFromEvent(event) {\n return (\n this.props.options.filter((o) => {\n return o.id == event.target.value;\n })[0] || {}\n );\n }\n\n brewery() {\n return this.props.store.brewery;\n }\n\n sample() {\n return this.props.store.samples[this.props.index];\n }\n\n form_input() {\n if (this.sample().selection) {\n return (\n \n );\n }\n }\n\n options() {\n const options = this.props.options.concat([\n { id: \"new_beer\", name: \"Create New Beer ⇢\" },\n ]);\n if (options.length > 0) {\n return (\n \n {options.map((option, index) => {\n return (\n \n );\n })}\n \n );\n } else {\n return {this.props.missing_message};\n }\n }\n\n quantity(type) {\n return (this.props.store.brewery.capacities[type] || {}).quantity || 0;\n }\n\n priceMessage(type) {\n if (this.quantity(type) > 0) {\n return (\n \n (included in subscription)\n \n );\n } else {\n return (\n \n ($\n {costMappings[type]})\n \n );\n }\n }\n\n checkboxClick(inputName, e) {\n this.props.actions.checkInput(\n this.props.index,\n inputName,\n e.target.checked\n );\n }\n\n get batchList() {\n return this.props.store.batchOptions || [];\n }\n\n render() {\n console.log(this.sample());\n const batches = this.props.store.brewery.is_beer_30 ? (this.batchList.find((o)=>o.BrandName === this.sample().name) || { BatchNumbers:[]}).BatchNumbers : []\n return (\n
\n
\n x\n {this.form_input()}\n
\n
\n {this.options()}\n \n\n {\n batches.length > 0 &&\n \n \n {batches.map((batchId) => (\n \n ))}\n \n }\n {\n batches.length <= 0 &&\n \n }\n\n \n
\n
\n
\n
\n {\n this.checkboxClick(\"production_suite\", e);\n }}\n />\n \n Production Suite{\" \"}\n {this.priceMessage(\"production_suite\")}\n \n
\n
\n {\n this.checkboxClick(\"alcolyzer_selzer\", e);\n }}\n />\n \n Basic Suite{\" \"}\n {this.priceMessage(\"alcolyzer_selzer\")}\n \n
\n
\n {\n this.checkboxClick(\"simple_nutrition\", e);\n }}\n />\n \n Nutrition Panel{\" \"}\n {this.priceMessage(\"simple_nutrition\")}\n \n
\n \n \n
\n
\n
\n );\n }\n}\n\nexport default SampleInput;\n","var React = require('react');\n\nclass SimpleSampleInput extends React.Component {\n\n constructor() {\n super();\n this.remove = this.remove.bind(this);\n this.changeSelection = this.changeSelection.bind(this);\n this.options = this.options.bind(this);\n this.form_input = this.form_input.bind(this);\n }\n\n remove() {\n this.props.removeSample(this.props.index);\n }\n\n changeSelection(event) {\n this.setState({disabled: false})\n this.props.chooseSample(this.props.index, event.target.value);\n }\n\n form_input(){\n if(this.props.sample) {\n return ();\n }\n }\n\n\n options() {\n if (this.props.options.length > 0) {\n return (\n \n );\n } else {\n return ({this.props.missing_message})\n }\n }\n\n render() {\n return (\n
\n
\n \n x\n {this.form_input()}\n
\n\n {this.options()}\n
\n );\n }\n}\n\nexport default SimpleSampleInput","var React = require('react');\n\nclass BeerNameTextbox extends React.Component {\n\n constructor() {\n super();\n this.onChange = this.onChange.bind(this);\n this.input = this.input.bind(this);\n }\n\n onChange(e){\n this.props.actions.changeSample(this.props.index, {\n ...this.props.sample,\n name: e.target.value\n })\n }\n\n input(){\n if (this.props.sample.selection == 'new_beer') {\n return (\n \n )\n }\n }\n\n render() {\n return (\n
\n {this.input()}\n
\n )\n }\n}\n\nexport default BeerNameTextbox","var React = require('react');\nconst costMappings = JSON.parse(document.getElementById('cost-mappings').getAttribute('data_value'));\n\nclass ChemistryAccordion extends React.Component {\n\n constructor() {\n super();\n this.state = {\n open: false\n }\n this.onClick = this.onClick.bind(this);\n this.contents = this.contents.bind(this);\n this.checkboxClick = this.checkboxClick.bind(this);\n }\n\n onClick(e) {\n this.props.actions.clickAccordion(this.props.index, e.target.checked)\n this.setState({open: !this.state.open})\n }\n\n checkboxClick(inputName, e) {\n this.props.actions.checkInput(this.props.index, inputName, e.target.checked)\n }\n\n contents() {\n if (this.state.open) {\n return (\n
\n
\n {\n this.checkboxClick('chemistry__acetic_acid', e);\n }}\n />\n Acetic Acid (${costMappings['chemistry__acetic_acid']})\n
\n
\n {\n this.checkboxClick('chemistry__lactic_acid', e);\n }}\n />\n Lactic Acid (${costMappings['chemistry__lactic_acid']})\n
\n
\n {\n this.checkboxClick('chemistry__sulfur_dioxide', e);\n }}\n />\n Sulfur Dioxide (${costMappings['chemistry__sulfur_dioxide']})\n
\n
\n {\n this.checkboxClick('chemistry__free_amino_nitrogen', e);\n }}\n />\n Free Amino Nitrogen (${costMappings['chemistry__free_amino_nitrogen']})\n
\n
\n {\n this.checkboxClick('chemistry__vicinal_diketones', e);\n }}\n />\n VDK (${costMappings['chemistry__vicinal_diketones']})\n
\n
\n {\n this.checkboxClick('chemistry__acetaldehyde', e);\n }}\n />\n Acetaldehyde (${costMappings['chemistry__acetaldehyde']})\n
\n
\n {\n this.checkboxClick('simple_nutrition__polyphenols', e);\n }}\n />\n Polyphenol (${costMappings['simple_nutrition__polyphenols']})\n
\n
\n {\n this.checkboxClick('simple_nutrition__starch', e);\n }}\n />\n Starch (${costMappings['simple_nutrition__starch']})\n
\n
\n )\n }\n\n }\n\n render() {\n return (\n
\n
\n \n Chemistry (Check to see options)\n \n
\n {this.contents()}\n
\n );\n }\n}\n\nexport default ChemistryAccordion","var React = require(\"react\");\nconst costMappings = JSON.parse(\n document.getElementById(\"cost-mappings\").getAttribute(\"data_value\")\n);\n\nclass ChemistryAccordion extends React.Component {\n constructor() {\n super();\n this.state = {\n open: false,\n };\n this.onClick = this.onClick.bind(this);\n this.contents = this.contents.bind(this);\n this.checkboxClick = this.checkboxClick.bind(this);\n }\n\n onClick(e) {\n this.props.actions.clickAccordion(this.props.index, e.target.checked);\n this.setState({ open: !this.state.open });\n }\n\n checkboxClick(inputName, e) {\n this.props.actions.checkInput(\n this.props.index,\n inputName,\n e.target.checked\n );\n }\n\n contents() {\n if (this.state.open) {\n return (\n
\n
\n {\n this.checkboxClick(\"microservices__pcr_bacteria_analysis\", e);\n }}\n />\n \n Bacteria (qPCR) ($\n {costMappings[\"microservices__pcr_bacteria_analysis\"]})\n \n
\n
\n {\n this.checkboxClick(\"microservices__pcr_yeast_analysis\", e);\n }}\n />\n \n Yeast (qPCR) ($\n {costMappings[\"microservices__pcr_yeast_analysis\"]})\n \n
\n
\n {\n this.checkboxClick(\"microservices__plate_analysis\", e);\n }}\n />\n \n Plating (Single Media) ($\n {costMappings[\"microservices__plate_analysis\"]})\n \n
\n
\n {\n this.checkboxClick(\"microservices__pcr_and_plate_analysis\", e);\n }}\n />\n \n Plating (Comprehensive Media) ($\n {costMappings[\"microservices__pcr_and_plate_analysis\"]})\n \n
\n
\n {\n this.checkboxClick(\"microservices__pasteurization_analysis\", e);\n }}\n />\n \n Pathogen Organisms ($\n {costMappings[\"microservices__pasteurization_analysis\"]})\n \n
\n
\n {\n this.checkboxClick(\"microservices__shelf_life_analysis\", e);\n }}\n />\n \n Shelf Life Analysis ($\n {costMappings[\"microservices__shelf_life_analysis\"]})\n \n
\n
\n );\n }\n }\n\n render() {\n return (\n
\n
\n \n \n Micro Services{\" \"}\n \n (Check to see options)\n \n \n
\n {this.contents()}\n
\n );\n }\n}\n\nexport default ChemistryAccordion;\n","var React = require('react');\nconst costMappings = JSON.parse(document.getElementById('cost-mappings').getAttribute('data_value'));;\n\nclass SimpleNutritionAccordion extends React.Component {\n\n constructor() {\n super();\n this.state = {\n open: false\n }\n this.onClick = this.onClick.bind(this);\n this.contents = this.contents.bind(this);\n this.checkboxClick = this.checkboxClick.bind(this);\n }\n\n onClick(e) {\n this.props.actions.clickAccordion(this.props.index, e.target.checked)\n this.setState({open: !this.state.open})\n }\n\n checkboxClick(inputName, e) {\n this.props.actions.checkInput(this.props.index, inputName, e.target.checked)\n }\n\n contents() {\n if (this.state.open) {\n return (\n
\n
\n {\n this.checkboxClick('simple_nutrition__carbohydrates', e);\n }}\n />\n Carbohydrates (${costMappings['simple_nutrition__carbohydrates']})\n
\n
\n {\n this.checkboxClick('simple_nutrition__protein', e);\n }}\n />\n Protein (${costMappings['simple_nutrition__protein']})\n
\n
\n {\n this.checkboxClick('simple_nutrition__sugar', e);\n }}\n />\n Sugar (${costMappings['simple_nutrition__sugar']})\n
\n
\n {\n this.checkboxClick('simple_nutrition__polyphenols', e);\n }}\n />\n Polyphenols (${costMappings['simple_nutrition__polyphenols']})\n
\n
\n {\n this.checkboxClick('simple_nutrition__starch', e);\n }}\n />\n Starch (${costMappings['simple_nutrition__starch']})\n
\n
\n )\n }\n\n }\n\n render() {\n return (\n
\n
\n \n Simple Nutrition (Check to see options)\n \n
\n {this.contents()}\n
\n );\n }\n}\n\nexport default SimpleNutritionAccordion","\nconst get_data_value_from_element = (id)=>{\n try {\n return JSON.parse(document.getElementById(id).getAttribute('data_value'))\n } catch(e){\n return null;\n }\n};\nexport default (type, is_water)=>{\n const color = is_water ? '#49A1CC' : '#FCB33D'\n return {\n labels: get_data_value_from_element(`${type}-labels`),\n datasets: [\n {\n label: \"dataset\",\n fillColor: \"#FFFDFA\",\n strokeColor: color,\n pointColor: \"#4545454\",\n pointStrokeColor: color,\n pointHighlightFill: \"#4545454\",\n pointHighlightStroke: \"rgba(220,220,220,1)\",\n data: get_data_value_from_element(`${type}-data`)\n }\n ]\n };\n}","export default {\n responsive: true,\n maintainAspectRatio: true,\n ///Boolean - Whether grid lines are shown across the chart\n scaleShowGridLines: true,\n\n //String - Colour of the grid lines\n scaleGridLineColor: \"rgba(0,0,0,.05)\",\n\n //Number - Width of the grid lines\n scaleGridLineWidth: 0,\n\n //Boolean - Whether to show horizontal lines (except X axis)\n scaleShowHorizontalLines: true,\n\n //Boolean - Whether to show vertical lines (except Y axis)\n scaleShowVerticalLines: true,\n\n //Boolean - Whether the line is curved between points\n bezierCurve: true,\n\n //Number - Tension of the bezier curve between points\n bezierCurveTension: 0.4,\n\n //Boolean - Whether to show a dot for each point\n pointDot: true,\n\n //Number - Radius of each point dot in pixels\n pointDotRadius: 4,\n\n //Number - Pixel width of point dot stroke\n pointDotStrokeWidth: 2,\n\n //Number - amount extra to add to the radius to cater for hit detection outside the drawn point\n pointHitDetectionRadius: 20,\n\n //Boolean - Whether to show a stroke for datasets\n datasetStroke: true,\n\n //Number - Pixel width of dataset stroke\n datasetStrokeWidth: 2,\n\n //Boolean - Whether to fill the dataset with a colour\n datasetFill: true,\n\n //Boolean - Whether to horizontally center the label and point dot inside the grid\n offsetGridLines: true,\n\n scaleShowLabels: true,\n\n showScale: true,\n\n showTooltips: true,\n\n multiTooltipTemplate: \"<%= value %>\",\n\n tooltipTemplate: \"<%= value %>\",\n\n scaleLabel: \"<%=(value/1).toFixed(3)%>\",\n};\n","/* eslint no-console:0 */\n// This file is automatically compiled by Webpack, along with any other files\n// present in this directory. You're encouraged to place your actual application logic in\n// a relevant structure within app/javascript and only use these pack files to reference\n// that code so it'll be compiled.\n//\n// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate\n// layout file, like app/views/layouts/application.html.erb\n\nconsole.log('Hello World from Fermly')\n// Support component names relative to this directory:\nvar componentRequireContext = require.context(\"components\", true)\nvar ReactRailsUJS = require(\"react_ujs\")\nReactRailsUJS.useContext(componentRequireContext)\n","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n/*!\n * Chart.js\n * http://chartjs.org/\n * Version: 1.1.1\n *\n * Copyright 2015 Nick Downie\n * Released under the MIT license\n * https://github.com/nnnick/Chart.js/blob/master/LICENSE.md\n */\n(function () {\n \"use strict\"; //Declare root variable - window in the browser, global on the server\n\n var root = this,\n previous = root.Chart; //Occupy the global variable of Chart, and create a simple base class\n\n var Chart = function Chart(context) {\n var chart = this;\n this.canvas = context.canvas;\n this.ctx = context; //Variables global to the chart\n\n var computeDimension = function computeDimension(element, dimension) {\n if (element['offset' + dimension]) {\n return element['offset' + dimension];\n } else {\n return document.defaultView.getComputedStyle(element).getPropertyValue(dimension);\n }\n };\n\n var width = this.width = computeDimension(context.canvas, 'Width') || context.canvas.width;\n var height = this.height = computeDimension(context.canvas, 'Height') || context.canvas.height;\n this.aspectRatio = this.width / this.height; //High pixel density displays - multiply the size of the canvas height/width by the device pixel ratio, then scale.\n\n helpers.retinaScale(this);\n return this;\n }; //Globally expose the defaults to allow for user updating/changing\n\n\n Chart.defaults = {\n global: {\n // Boolean - Whether to animate the chart\n animation: true,\n // Number - Number of animation steps\n animationSteps: 60,\n // String - Animation easing effect\n animationEasing: \"easeOutQuart\",\n // Boolean - If we should show the scale at all\n showScale: true,\n // Boolean - If we want to override with a hard coded scale\n scaleOverride: false,\n // ** Required if scaleOverride is true **\n // Number - The number of steps in a hard coded scale\n scaleSteps: null,\n // Number - The value jump in the hard coded scale\n scaleStepWidth: null,\n // Number - The scale starting value\n scaleStartValue: null,\n // String - Colour of the scale line\n scaleLineColor: \"rgba(0,0,0,.1)\",\n // Number - Pixel width of the scale line\n scaleLineWidth: 1,\n // Boolean - Whether to show labels on the scale\n scaleShowLabels: true,\n // Interpolated JS string - can access value\n scaleLabel: \"<%=value%>\",\n // Boolean - Whether the scale should stick to integers, and not show any floats even if drawing space is there\n scaleIntegersOnly: true,\n // Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value\n scaleBeginAtZero: false,\n // String - Scale label font declaration for the scale label\n scaleFontFamily: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n // Number - Scale label font size in pixels\n scaleFontSize: 12,\n // String - Scale label font weight style\n scaleFontStyle: \"normal\",\n // String - Scale label font colour\n scaleFontColor: \"#666\",\n // Boolean - whether or not the chart should be responsive and resize when the browser does.\n responsive: false,\n // Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container\n maintainAspectRatio: true,\n // Boolean - Determines whether to draw tooltips on the canvas or not - attaches events to touchmove & mousemove\n showTooltips: true,\n // Boolean - Determines whether to draw built-in tooltip or call custom tooltip function\n customTooltips: false,\n // Array - Array of string names to attach tooltip events\n tooltipEvents: [\"mousemove\", \"touchstart\", \"touchmove\", \"mouseout\"],\n // String - Tooltip background colour\n tooltipFillColor: \"rgba(0,0,0,0.8)\",\n // String - Tooltip label font declaration for the scale label\n tooltipFontFamily: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n // Number - Tooltip label font size in pixels\n tooltipFontSize: 14,\n // String - Tooltip font weight style\n tooltipFontStyle: \"normal\",\n // String - Tooltip label font colour\n tooltipFontColor: \"#fff\",\n // String - Tooltip title font declaration for the scale label\n tooltipTitleFontFamily: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n // Number - Tooltip title font size in pixels\n tooltipTitleFontSize: 14,\n // String - Tooltip title font weight style\n tooltipTitleFontStyle: \"bold\",\n // String - Tooltip title font colour\n tooltipTitleFontColor: \"#fff\",\n // String - Tooltip title template\n tooltipTitleTemplate: \"<%= label%>\",\n // Number - pixel width of padding around tooltip text\n tooltipYPadding: 6,\n // Number - pixel width of padding around tooltip text\n tooltipXPadding: 6,\n // Number - Size of the caret on the tooltip\n tooltipCaretSize: 8,\n // Number - Pixel radius of the tooltip border\n tooltipCornerRadius: 6,\n // Number - Pixel offset from point x to tooltip edge\n tooltipXOffset: 10,\n // String - Template string for single tooltips\n tooltipTemplate: \"<%if (label){%><%=label%>: <%}%><%= value %>\",\n // String - Template string for single tooltips\n multiTooltipTemplate: \"<%= datasetLabel %>: <%= value %>\",\n // String - Colour behind the legend colour block\n multiTooltipKeyBackground: '#fff',\n // Array - A list of colors to use as the defaults\n segmentColorDefault: [\"#A6CEE3\", \"#1F78B4\", \"#B2DF8A\", \"#33A02C\", \"#FB9A99\", \"#E31A1C\", \"#FDBF6F\", \"#FF7F00\", \"#CAB2D6\", \"#6A3D9A\", \"#B4B482\", \"#B15928\"],\n // Array - A list of highlight colors to use as the defaults\n segmentHighlightColorDefaults: [\"#CEF6FF\", \"#47A0DC\", \"#DAFFB2\", \"#5BC854\", \"#FFC2C1\", \"#FF4244\", \"#FFE797\", \"#FFA728\", \"#F2DAFE\", \"#9265C2\", \"#DCDCAA\", \"#D98150\"],\n // Function - Will fire on animation progression.\n onAnimationProgress: function onAnimationProgress() {},\n // Function - Will fire on animation completion.\n onAnimationComplete: function onAnimationComplete() {}\n }\n }; //Create a dictionary of chart types, to allow for extension of existing types\n\n Chart.types = {}; //Global Chart helpers object for utility methods and classes\n\n var helpers = Chart.helpers = {}; //-- Basic js utility methods\n\n var each = helpers.each = function (loopable, callback, self) {\n var additionalArgs = Array.prototype.slice.call(arguments, 3); // Check to see if null or undefined firstly.\n\n if (loopable) {\n if (loopable.length === +loopable.length) {\n var i;\n\n for (i = 0; i < loopable.length; i++) {\n callback.apply(self, [loopable[i], i].concat(additionalArgs));\n }\n } else {\n for (var item in loopable) {\n callback.apply(self, [loopable[item], item].concat(additionalArgs));\n }\n }\n }\n },\n clone = helpers.clone = function (obj) {\n var objClone = {};\n each(obj, function (value, key) {\n if (obj.hasOwnProperty(key)) {\n objClone[key] = value;\n }\n });\n return objClone;\n },\n extend = helpers.extend = function (base) {\n each(Array.prototype.slice.call(arguments, 1), function (extensionObject) {\n each(extensionObject, function (value, key) {\n if (extensionObject.hasOwnProperty(key)) {\n base[key] = value;\n }\n });\n });\n return base;\n },\n merge = helpers.merge = function (base, master) {\n //Merge properties in left object over to a shallow clone of object right.\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift({});\n return extend.apply(null, args);\n },\n indexOf = helpers.indexOf = function (arrayToSearch, item) {\n if (Array.prototype.indexOf) {\n return arrayToSearch.indexOf(item);\n } else {\n for (var i = 0; i < arrayToSearch.length; i++) {\n if (arrayToSearch[i] === item) return i;\n }\n\n return -1;\n }\n },\n where = helpers.where = function (collection, filterCallback) {\n var filtered = [];\n helpers.each(collection, function (item) {\n if (filterCallback(item)) {\n filtered.push(item);\n }\n });\n return filtered;\n },\n findNextWhere = helpers.findNextWhere = function (arrayToSearch, filterCallback, startIndex) {\n // Default to start of the array\n if (!startIndex) {\n startIndex = -1;\n }\n\n for (var i = startIndex + 1; i < arrayToSearch.length; i++) {\n var currentItem = arrayToSearch[i];\n\n if (filterCallback(currentItem)) {\n return currentItem;\n }\n }\n },\n findPreviousWhere = helpers.findPreviousWhere = function (arrayToSearch, filterCallback, startIndex) {\n // Default to end of the array\n if (!startIndex) {\n startIndex = arrayToSearch.length;\n }\n\n for (var i = startIndex - 1; i >= 0; i--) {\n var currentItem = arrayToSearch[i];\n\n if (filterCallback(currentItem)) {\n return currentItem;\n }\n }\n },\n inherits = helpers.inherits = function (extensions) {\n //Basic javascript inheritance based on the model created in Backbone.js\n var parent = this;\n var ChartElement = extensions && extensions.hasOwnProperty(\"constructor\") ? extensions.constructor : function () {\n return parent.apply(this, arguments);\n };\n\n var Surrogate = function Surrogate() {\n this.constructor = ChartElement;\n };\n\n Surrogate.prototype = parent.prototype;\n ChartElement.prototype = new Surrogate();\n ChartElement.extend = inherits;\n if (extensions) extend(ChartElement.prototype, extensions);\n ChartElement.__super__ = parent.prototype;\n return ChartElement;\n },\n noop = helpers.noop = function () {},\n uid = helpers.uid = function () {\n var id = 0;\n return function () {\n return \"chart-\" + id++;\n };\n }(),\n warn = helpers.warn = function (str) {\n //Method for warning of errors\n if (window.console && typeof window.console.warn === \"function\") console.warn(str);\n },\n amd = helpers.amd = typeof define === 'function' && define.amd,\n //-- Math methods\n isNumber = helpers.isNumber = function (n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n },\n max = helpers.max = function (array) {\n return Math.max.apply(Math, array);\n },\n min = helpers.min = function (array) {\n return Math.min.apply(Math, array);\n },\n cap = helpers.cap = function (valueToCap, maxValue, minValue) {\n if (isNumber(maxValue)) {\n if (valueToCap > maxValue) {\n return maxValue;\n }\n } else if (isNumber(minValue)) {\n if (valueToCap < minValue) {\n return minValue;\n }\n }\n\n return valueToCap;\n },\n getDecimalPlaces = helpers.getDecimalPlaces = function (num) {\n if (num % 1 !== 0 && isNumber(num)) {\n var s = num.toString();\n\n if (s.indexOf(\"e-\") < 0) {\n // no exponent, e.g. 0.01\n return s.split(\".\")[1].length;\n } else if (s.indexOf(\".\") < 0) {\n // no decimal point, e.g. 1e-9\n return parseInt(s.split(\"e-\")[1]);\n } else {\n // exponent and decimal point, e.g. 1.23e-9\n var parts = s.split(\".\")[1].split(\"e-\");\n return parts[0].length + parseInt(parts[1]);\n }\n } else {\n return 0;\n }\n },\n toRadians = helpers.radians = function (degrees) {\n return degrees * (Math.PI / 180);\n },\n // Gets the angle from vertical upright to the point about a centre.\n getAngleFromPoint = helpers.getAngleFromPoint = function (centrePoint, anglePoint) {\n var distanceFromXCenter = anglePoint.x - centrePoint.x,\n distanceFromYCenter = anglePoint.y - centrePoint.y,\n radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n var angle = Math.PI * 2 + Math.atan2(distanceFromYCenter, distanceFromXCenter); //If the segment is in the top left quadrant, we need to add another rotation to the angle\n\n if (distanceFromXCenter < 0 && distanceFromYCenter < 0) {\n angle += Math.PI * 2;\n }\n\n return {\n angle: angle,\n distance: radialDistanceFromCenter\n };\n },\n aliasPixel = helpers.aliasPixel = function (pixelWidth) {\n return pixelWidth % 2 === 0 ? 0 : 0.5;\n },\n splineCurve = helpers.splineCurve = function (FirstPoint, MiddlePoint, AfterPoint, t) {\n //Props to Rob Spencer at scaled innovation for his post on splining between points\n //http://scaledinnovation.com/analytics/splines/aboutSplines.html\n var d01 = Math.sqrt(Math.pow(MiddlePoint.x - FirstPoint.x, 2) + Math.pow(MiddlePoint.y - FirstPoint.y, 2)),\n d12 = Math.sqrt(Math.pow(AfterPoint.x - MiddlePoint.x, 2) + Math.pow(AfterPoint.y - MiddlePoint.y, 2)),\n fa = t * d01 / (d01 + d12),\n // scaling factor for triangle Ta\n fb = t * d12 / (d01 + d12);\n return {\n inner: {\n x: MiddlePoint.x - fa * (AfterPoint.x - FirstPoint.x),\n y: MiddlePoint.y - fa * (AfterPoint.y - FirstPoint.y)\n },\n outer: {\n x: MiddlePoint.x + fb * (AfterPoint.x - FirstPoint.x),\n y: MiddlePoint.y + fb * (AfterPoint.y - FirstPoint.y)\n }\n };\n },\n calculateOrderOfMagnitude = helpers.calculateOrderOfMagnitude = function (val) {\n return Math.floor(Math.log(val) / Math.LN10);\n },\n calculateScaleRange = helpers.calculateScaleRange = function (valuesArray, drawingSize, textSize, startFromZero, integersOnly) {\n //Set a minimum step of two - a point at the top of the graph, and a point at the base\n var minSteps = 2,\n maxSteps = Math.floor(drawingSize / (textSize * 1.5)),\n skipFitting = minSteps >= maxSteps; // Filter out null values since these would min() to zero\n\n var values = [];\n each(valuesArray, function (v) {\n v == null || values.push(v);\n });\n var minValue = min(values),\n maxValue = max(values); // We need some degree of separation here to calculate the scales if all the values are the same\n // Adding/minusing 0.5 will give us a range of 1.\n\n if (maxValue === minValue) {\n maxValue += 0.5; // So we don't end up with a graph with a negative start value if we've said always start from zero\n\n if (minValue >= 0.5 && !startFromZero) {\n minValue -= 0.5;\n } else {\n // Make up a whole number above the values\n maxValue += 0.5;\n }\n }\n\n var valueRange = Math.abs(maxValue - minValue),\n rangeOrderOfMagnitude = calculateOrderOfMagnitude(valueRange),\n graphMax = Math.ceil(maxValue / (1 * Math.pow(10, rangeOrderOfMagnitude))) * Math.pow(10, rangeOrderOfMagnitude),\n graphMin = startFromZero ? 0 : Math.floor(minValue / (1 * Math.pow(10, rangeOrderOfMagnitude))) * Math.pow(10, rangeOrderOfMagnitude),\n graphRange = graphMax - graphMin,\n stepValue = Math.pow(10, rangeOrderOfMagnitude),\n numberOfSteps = Math.round(graphRange / stepValue); //If we have more space on the graph we'll use it to give more definition to the data\n\n while ((numberOfSteps > maxSteps || numberOfSteps * 2 < maxSteps) && !skipFitting) {\n if (numberOfSteps > maxSteps) {\n stepValue *= 2;\n numberOfSteps = Math.round(graphRange / stepValue); // Don't ever deal with a decimal number of steps - cancel fitting and just use the minimum number of steps.\n\n if (numberOfSteps % 1 !== 0) {\n skipFitting = true;\n }\n } //We can fit in double the amount of scale points on the scale\n else {\n //If user has declared ints only, and the step value isn't a decimal\n if (integersOnly && rangeOrderOfMagnitude >= 0) {\n //If the user has said integers only, we need to check that making the scale more granular wouldn't make it a float\n if (stepValue / 2 % 1 === 0) {\n stepValue /= 2;\n numberOfSteps = Math.round(graphRange / stepValue);\n } //If it would make it a float break out of the loop\n else {\n break;\n }\n } //If the scale doesn't have to be an int, make the scale more granular anyway.\n else {\n stepValue /= 2;\n numberOfSteps = Math.round(graphRange / stepValue);\n }\n }\n }\n\n if (skipFitting) {\n numberOfSteps = minSteps;\n stepValue = graphRange / numberOfSteps;\n }\n\n return {\n steps: numberOfSteps,\n stepValue: stepValue,\n min: graphMin,\n max: graphMin + numberOfSteps * stepValue\n };\n },\n\n /* jshint ignore:start */\n // Blows up jshint errors based on the new Function constructor\n //Templating methods\n //Javascript micro templating by John Resig - source at http://ejohn.org/blog/javascript-micro-templating/\n template = helpers.template = function (templateString, valuesObject) {\n // If templateString is function rather than string-template - call the function for valuesObject\n if (templateString instanceof Function) {\n return templateString(valuesObject);\n }\n\n var cache = {};\n\n function tmpl(str, data) {\n // Figure out if we're getting a template, or if we need to\n // load the template - and be sure to cache the result.\n var fn = !/\\W/.test(str) ? cache[str] = cache[str] : // Generate a reusable function that will serve as a template\n // generator (and which will be cached).\n new Function(\"obj\", \"var p=[],print=function(){p.push.apply(p,arguments);};\" + // Introduce the data as local variables using with(){}\n \"with(obj){p.push('\" + // Convert the template into pure JavaScript\n str.replace(/[\\r\\t\\n]/g, \" \").split(\"<%\").join(\"\\t\").replace(/((^|%>)[^\\t]*)'/g, \"$1\\r\").replace(/\\t=(.*?)%>/g, \"',$1,'\").split(\"\\t\").join(\"');\").split(\"%>\").join(\"p.push('\").split(\"\\r\").join(\"\\\\'\") + \"');}return p.join('');\"); // Provide some basic currying to the user\n\n return data ? fn(data) : fn;\n }\n\n return tmpl(templateString, valuesObject);\n },\n\n /* jshint ignore:end */\n generateLabels = helpers.generateLabels = function (templateString, numberOfSteps, graphMin, stepValue) {\n var labelsArray = new Array(numberOfSteps);\n\n if (templateString) {\n each(labelsArray, function (val, index) {\n labelsArray[index] = template(templateString, {\n value: graphMin + stepValue * (index + 1)\n });\n });\n }\n\n return labelsArray;\n },\n //--Animation methods\n //Easing functions adapted from Robert Penner's easing equations\n //http://www.robertpenner.com/easing/\n easingEffects = helpers.easingEffects = {\n linear: function linear(t) {\n return t;\n },\n easeInQuad: function easeInQuad(t) {\n return t * t;\n },\n easeOutQuad: function easeOutQuad(t) {\n return -1 * t * (t - 2);\n },\n easeInOutQuad: function easeInOutQuad(t) {\n if ((t /= 1 / 2) < 1) {\n return 1 / 2 * t * t;\n }\n\n return -1 / 2 * (--t * (t - 2) - 1);\n },\n easeInCubic: function easeInCubic(t) {\n return t * t * t;\n },\n easeOutCubic: function easeOutCubic(t) {\n return 1 * ((t = t / 1 - 1) * t * t + 1);\n },\n easeInOutCubic: function easeInOutCubic(t) {\n if ((t /= 1 / 2) < 1) {\n return 1 / 2 * t * t * t;\n }\n\n return 1 / 2 * ((t -= 2) * t * t + 2);\n },\n easeInQuart: function easeInQuart(t) {\n return t * t * t * t;\n },\n easeOutQuart: function easeOutQuart(t) {\n return -1 * ((t = t / 1 - 1) * t * t * t - 1);\n },\n easeInOutQuart: function easeInOutQuart(t) {\n if ((t /= 1 / 2) < 1) {\n return 1 / 2 * t * t * t * t;\n }\n\n return -1 / 2 * ((t -= 2) * t * t * t - 2);\n },\n easeInQuint: function easeInQuint(t) {\n return 1 * (t /= 1) * t * t * t * t;\n },\n easeOutQuint: function easeOutQuint(t) {\n return 1 * ((t = t / 1 - 1) * t * t * t * t + 1);\n },\n easeInOutQuint: function easeInOutQuint(t) {\n if ((t /= 1 / 2) < 1) {\n return 1 / 2 * t * t * t * t * t;\n }\n\n return 1 / 2 * ((t -= 2) * t * t * t * t + 2);\n },\n easeInSine: function easeInSine(t) {\n return -1 * Math.cos(t / 1 * (Math.PI / 2)) + 1;\n },\n easeOutSine: function easeOutSine(t) {\n return 1 * Math.sin(t / 1 * (Math.PI / 2));\n },\n easeInOutSine: function easeInOutSine(t) {\n return -1 / 2 * (Math.cos(Math.PI * t / 1) - 1);\n },\n easeInExpo: function easeInExpo(t) {\n return t === 0 ? 1 : 1 * Math.pow(2, 10 * (t / 1 - 1));\n },\n easeOutExpo: function easeOutExpo(t) {\n return t === 1 ? 1 : 1 * (-Math.pow(2, -10 * t / 1) + 1);\n },\n easeInOutExpo: function easeInOutExpo(t) {\n if (t === 0) {\n return 0;\n }\n\n if (t === 1) {\n return 1;\n }\n\n if ((t /= 1 / 2) < 1) {\n return 1 / 2 * Math.pow(2, 10 * (t - 1));\n }\n\n return 1 / 2 * (-Math.pow(2, -10 * --t) + 2);\n },\n easeInCirc: function easeInCirc(t) {\n if (t >= 1) {\n return t;\n }\n\n return -1 * (Math.sqrt(1 - (t /= 1) * t) - 1);\n },\n easeOutCirc: function easeOutCirc(t) {\n return 1 * Math.sqrt(1 - (t = t / 1 - 1) * t);\n },\n easeInOutCirc: function easeInOutCirc(t) {\n if ((t /= 1 / 2) < 1) {\n return -1 / 2 * (Math.sqrt(1 - t * t) - 1);\n }\n\n return 1 / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1);\n },\n easeInElastic: function easeInElastic(t) {\n var s = 1.70158;\n var p = 0;\n var a = 1;\n\n if (t === 0) {\n return 0;\n }\n\n if ((t /= 1) == 1) {\n return 1;\n }\n\n if (!p) {\n p = 1 * 0.3;\n }\n\n if (a < Math.abs(1)) {\n a = 1;\n s = p / 4;\n } else {\n s = p / (2 * Math.PI) * Math.asin(1 / a);\n }\n\n return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p));\n },\n easeOutElastic: function easeOutElastic(t) {\n var s = 1.70158;\n var p = 0;\n var a = 1;\n\n if (t === 0) {\n return 0;\n }\n\n if ((t /= 1) == 1) {\n return 1;\n }\n\n if (!p) {\n p = 1 * 0.3;\n }\n\n if (a < Math.abs(1)) {\n a = 1;\n s = p / 4;\n } else {\n s = p / (2 * Math.PI) * Math.asin(1 / a);\n }\n\n return a * Math.pow(2, -10 * t) * Math.sin((t * 1 - s) * (2 * Math.PI) / p) + 1;\n },\n easeInOutElastic: function easeInOutElastic(t) {\n var s = 1.70158;\n var p = 0;\n var a = 1;\n\n if (t === 0) {\n return 0;\n }\n\n if ((t /= 1 / 2) == 2) {\n return 1;\n }\n\n if (!p) {\n p = 1 * (0.3 * 1.5);\n }\n\n if (a < Math.abs(1)) {\n a = 1;\n s = p / 4;\n } else {\n s = p / (2 * Math.PI) * Math.asin(1 / a);\n }\n\n if (t < 1) {\n return -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p));\n }\n\n return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p) * 0.5 + 1;\n },\n easeInBack: function easeInBack(t) {\n var s = 1.70158;\n return 1 * (t /= 1) * t * ((s + 1) * t - s);\n },\n easeOutBack: function easeOutBack(t) {\n var s = 1.70158;\n return 1 * ((t = t / 1 - 1) * t * ((s + 1) * t + s) + 1);\n },\n easeInOutBack: function easeInOutBack(t) {\n var s = 1.70158;\n\n if ((t /= 1 / 2) < 1) {\n return 1 / 2 * (t * t * (((s *= 1.525) + 1) * t - s));\n }\n\n return 1 / 2 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2);\n },\n easeInBounce: function easeInBounce(t) {\n return 1 - easingEffects.easeOutBounce(1 - t);\n },\n easeOutBounce: function easeOutBounce(t) {\n if ((t /= 1) < 1 / 2.75) {\n return 1 * (7.5625 * t * t);\n } else if (t < 2 / 2.75) {\n return 1 * (7.5625 * (t -= 1.5 / 2.75) * t + 0.75);\n } else if (t < 2.5 / 2.75) {\n return 1 * (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375);\n } else {\n return 1 * (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375);\n }\n },\n easeInOutBounce: function easeInOutBounce(t) {\n if (t < 1 / 2) {\n return easingEffects.easeInBounce(t * 2) * 0.5;\n }\n\n return easingEffects.easeOutBounce(t * 2 - 1) * 0.5 + 1 * 0.5;\n }\n },\n //Request animation polyfill - http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/\n requestAnimFrame = helpers.requestAnimFrame = function () {\n return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback) {\n return window.setTimeout(callback, 1000 / 60);\n };\n }(),\n cancelAnimFrame = helpers.cancelAnimFrame = function () {\n return window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame || function (callback) {\n return window.clearTimeout(callback, 1000 / 60);\n };\n }(),\n animationLoop = helpers.animationLoop = function (callback, totalSteps, easingString, onProgress, onComplete, chartInstance) {\n var currentStep = 0,\n easingFunction = easingEffects[easingString] || easingEffects.linear;\n\n var animationFrame = function animationFrame() {\n currentStep++;\n var stepDecimal = currentStep / totalSteps;\n var easeDecimal = easingFunction(stepDecimal);\n callback.call(chartInstance, easeDecimal, stepDecimal, currentStep);\n onProgress.call(chartInstance, easeDecimal, stepDecimal);\n\n if (currentStep < totalSteps) {\n chartInstance.animationFrame = requestAnimFrame(animationFrame);\n } else {\n onComplete.apply(chartInstance);\n }\n };\n\n requestAnimFrame(animationFrame);\n },\n //-- DOM methods\n getRelativePosition = helpers.getRelativePosition = function (evt) {\n var mouseX, mouseY;\n var e = evt.originalEvent || evt,\n canvas = evt.currentTarget || evt.srcElement,\n boundingRect = canvas.getBoundingClientRect();\n\n if (e.touches) {\n mouseX = e.touches[0].clientX - boundingRect.left;\n mouseY = e.touches[0].clientY - boundingRect.top;\n } else {\n mouseX = e.clientX - boundingRect.left;\n mouseY = e.clientY - boundingRect.top;\n }\n\n return {\n x: mouseX,\n y: mouseY\n };\n },\n addEvent = helpers.addEvent = function (node, eventType, method) {\n if (node.addEventListener) {\n node.addEventListener(eventType, method);\n } else if (node.attachEvent) {\n node.attachEvent(\"on\" + eventType, method);\n } else {\n node[\"on\" + eventType] = method;\n }\n },\n removeEvent = helpers.removeEvent = function (node, eventType, handler) {\n if (node.removeEventListener) {\n node.removeEventListener(eventType, handler, false);\n } else if (node.detachEvent) {\n node.detachEvent(\"on\" + eventType, handler);\n } else {\n node[\"on\" + eventType] = noop;\n }\n },\n bindEvents = helpers.bindEvents = function (chartInstance, arrayOfEvents, handler) {\n // Create the events object if it's not already present\n if (!chartInstance.events) chartInstance.events = {};\n each(arrayOfEvents, function (eventName) {\n chartInstance.events[eventName] = function () {\n handler.apply(chartInstance, arguments);\n };\n\n addEvent(chartInstance.chart.canvas, eventName, chartInstance.events[eventName]);\n });\n },\n unbindEvents = helpers.unbindEvents = function (chartInstance, arrayOfEvents) {\n each(arrayOfEvents, function (handler, eventName) {\n removeEvent(chartInstance.chart.canvas, eventName, handler);\n });\n },\n getMaximumWidth = helpers.getMaximumWidth = function (domNode) {\n var container = domNode.parentNode,\n padding = parseInt(getStyle(container, 'padding-left')) + parseInt(getStyle(container, 'padding-right')); // TODO = check cross browser stuff with this.\n\n return container ? container.clientWidth - padding : 0;\n },\n getMaximumHeight = helpers.getMaximumHeight = function (domNode) {\n var container = domNode.parentNode,\n padding = parseInt(getStyle(container, 'padding-bottom')) + parseInt(getStyle(container, 'padding-top')); // TODO = check cross browser stuff with this.\n\n return container ? container.clientHeight - padding : 0;\n },\n getStyle = helpers.getStyle = function (el, property) {\n return el.currentStyle ? el.currentStyle[property] : document.defaultView.getComputedStyle(el, null).getPropertyValue(property);\n },\n getMaximumSize = helpers.getMaximumSize = helpers.getMaximumWidth,\n // legacy support\n retinaScale = helpers.retinaScale = function (chart) {\n var ctx = chart.ctx,\n width = chart.canvas.width,\n height = chart.canvas.height;\n\n if (window.devicePixelRatio) {\n ctx.canvas.style.width = width + \"px\";\n ctx.canvas.style.height = height + \"px\";\n ctx.canvas.height = height * window.devicePixelRatio;\n ctx.canvas.width = width * window.devicePixelRatio;\n ctx.scale(window.devicePixelRatio, window.devicePixelRatio);\n }\n },\n //-- Canvas methods\n _clear = helpers.clear = function (chart) {\n chart.ctx.clearRect(0, 0, chart.width, chart.height);\n },\n fontString = helpers.fontString = function (pixelSize, fontStyle, fontFamily) {\n return fontStyle + \" \" + pixelSize + \"px \" + fontFamily;\n },\n longestText = helpers.longestText = function (ctx, font, arrayOfStrings) {\n ctx.font = font;\n var longest = 0;\n each(arrayOfStrings, function (string) {\n var textWidth = ctx.measureText(string).width;\n longest = textWidth > longest ? textWidth : longest;\n });\n return longest;\n },\n drawRoundedRectangle = helpers.drawRoundedRectangle = function (ctx, x, y, width, height, radius) {\n ctx.beginPath();\n ctx.moveTo(x + radius, y);\n ctx.lineTo(x + width - radius, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + radius);\n ctx.lineTo(x + width, y + height - radius);\n ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);\n ctx.lineTo(x + radius, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - radius);\n ctx.lineTo(x, y + radius);\n ctx.quadraticCurveTo(x, y, x + radius, y);\n ctx.closePath();\n }; //Store a reference to each instance - allowing us to globally resize chart instances on window resize.\n //Destroy method on the chart will remove the instance of the chart from this reference.\n\n\n Chart.instances = {};\n\n Chart.Type = function (data, options, chart) {\n this.options = options;\n this.chart = chart;\n this.id = uid(); //Add the chart instance to the global namespace\n\n Chart.instances[this.id] = this; // Initialize is always called when a chart type is created\n // By default it is a no op, but it should be extended\n\n if (options.responsive) {\n this.resize();\n }\n\n this.initialize.call(this, data);\n }; //Core methods that'll be a part of every chart type\n\n\n extend(Chart.Type.prototype, {\n initialize: function initialize() {\n return this;\n },\n clear: function clear() {\n _clear(this.chart);\n\n return this;\n },\n stop: function stop() {\n // Stops any current animation loop occuring\n Chart.animationService.cancelAnimation(this);\n return this;\n },\n resize: function resize(callback) {\n this.stop();\n var canvas = this.chart.canvas,\n newWidth = getMaximumWidth(this.chart.canvas),\n newHeight = this.options.maintainAspectRatio ? newWidth / this.chart.aspectRatio : getMaximumHeight(this.chart.canvas);\n canvas.width = this.chart.width = newWidth;\n canvas.height = this.chart.height = newHeight;\n retinaScale(this.chart);\n\n if (typeof callback === \"function\") {\n callback.apply(this, Array.prototype.slice.call(arguments, 1));\n }\n\n return this;\n },\n reflow: noop,\n render: function render(reflow) {\n if (reflow) {\n this.reflow();\n }\n\n if (this.options.animation && !reflow) {\n var animation = new Chart.Animation();\n animation.numSteps = this.options.animationSteps;\n animation.easing = this.options.animationEasing; // render function\n\n animation.render = function (chartInstance, animationObject) {\n var easingFunction = helpers.easingEffects[animationObject.easing];\n var stepDecimal = animationObject.currentStep / animationObject.numSteps;\n var easeDecimal = easingFunction(stepDecimal);\n chartInstance.draw(easeDecimal, stepDecimal, animationObject.currentStep);\n }; // user events\n\n\n animation.onAnimationProgress = this.options.onAnimationProgress;\n animation.onAnimationComplete = this.options.onAnimationComplete;\n Chart.animationService.addAnimation(this, animation);\n } else {\n this.draw();\n this.options.onAnimationComplete.call(this);\n }\n\n return this;\n },\n generateLegend: function generateLegend() {\n return helpers.template(this.options.legendTemplate, this);\n },\n destroy: function destroy() {\n this.stop();\n this.clear();\n unbindEvents(this, this.events);\n var canvas = this.chart.canvas; // Reset canvas height/width attributes starts a fresh with the canvas context\n\n canvas.width = this.chart.width;\n canvas.height = this.chart.height; // < IE9 doesn't support removeProperty\n\n if (canvas.style.removeProperty) {\n canvas.style.removeProperty('width');\n canvas.style.removeProperty('height');\n } else {\n canvas.style.removeAttribute('width');\n canvas.style.removeAttribute('height');\n }\n\n delete Chart.instances[this.id];\n },\n showTooltip: function showTooltip(ChartElements, forceRedraw) {\n // Only redraw the chart if we've actually changed what we're hovering on.\n if (typeof this.activeElements === 'undefined') this.activeElements = [];\n\n var isChanged = function (Elements) {\n var changed = false;\n\n if (Elements.length !== this.activeElements.length) {\n changed = true;\n return changed;\n }\n\n each(Elements, function (element, index) {\n if (element !== this.activeElements[index]) {\n changed = true;\n }\n }, this);\n return changed;\n }.call(this, ChartElements);\n\n if (!isChanged && !forceRedraw) {\n return;\n } else {\n this.activeElements = ChartElements;\n }\n\n this.draw();\n\n if (this.options.customTooltips) {\n this.options.customTooltips(false);\n }\n\n if (ChartElements.length > 0) {\n // If we have multiple datasets, show a MultiTooltip for all of the data points at that index\n if (this.datasets && this.datasets.length > 1) {\n var dataArray, dataIndex;\n\n for (var i = this.datasets.length - 1; i >= 0; i--) {\n dataArray = this.datasets[i].points || this.datasets[i].bars || this.datasets[i].segments;\n dataIndex = indexOf(dataArray, ChartElements[0]);\n\n if (dataIndex !== -1) {\n break;\n }\n }\n\n var tooltipLabels = [],\n tooltipColors = [],\n medianPosition = function (index) {\n // Get all the points at that particular index\n var Elements = [],\n dataCollection,\n xPositions = [],\n yPositions = [],\n xMax,\n yMax,\n xMin,\n yMin;\n helpers.each(this.datasets, function (dataset) {\n dataCollection = dataset.points || dataset.bars || dataset.segments;\n\n if (dataCollection[dataIndex] && dataCollection[dataIndex].hasValue()) {\n Elements.push(dataCollection[dataIndex]);\n }\n });\n helpers.each(Elements, function (element) {\n xPositions.push(element.x);\n yPositions.push(element.y); //Include any colour information about the element\n\n tooltipLabels.push(helpers.template(this.options.multiTooltipTemplate, element));\n tooltipColors.push({\n fill: element._saved.fillColor || element.fillColor,\n stroke: element._saved.strokeColor || element.strokeColor\n });\n }, this);\n yMin = min(yPositions);\n yMax = max(yPositions);\n xMin = min(xPositions);\n xMax = max(xPositions);\n return {\n x: xMin > this.chart.width / 2 ? xMin : xMax,\n y: (yMin + yMax) / 2\n };\n }.call(this, dataIndex);\n\n new Chart.MultiTooltip({\n x: medianPosition.x,\n y: medianPosition.y,\n xPadding: this.options.tooltipXPadding,\n yPadding: this.options.tooltipYPadding,\n xOffset: this.options.tooltipXOffset,\n fillColor: this.options.tooltipFillColor,\n textColor: this.options.tooltipFontColor,\n fontFamily: this.options.tooltipFontFamily,\n fontStyle: this.options.tooltipFontStyle,\n fontSize: this.options.tooltipFontSize,\n titleTextColor: this.options.tooltipTitleFontColor,\n titleFontFamily: this.options.tooltipTitleFontFamily,\n titleFontStyle: this.options.tooltipTitleFontStyle,\n titleFontSize: this.options.tooltipTitleFontSize,\n cornerRadius: this.options.tooltipCornerRadius,\n labels: tooltipLabels,\n legendColors: tooltipColors,\n legendColorBackground: this.options.multiTooltipKeyBackground,\n title: template(this.options.tooltipTitleTemplate, ChartElements[0]),\n chart: this.chart,\n ctx: this.chart.ctx,\n custom: this.options.customTooltips\n }).draw();\n } else {\n each(ChartElements, function (Element) {\n var tooltipPosition = Element.tooltipPosition();\n new Chart.Tooltip({\n x: Math.round(tooltipPosition.x),\n y: Math.round(tooltipPosition.y),\n xPadding: this.options.tooltipXPadding,\n yPadding: this.options.tooltipYPadding,\n fillColor: this.options.tooltipFillColor,\n textColor: this.options.tooltipFontColor,\n fontFamily: this.options.tooltipFontFamily,\n fontStyle: this.options.tooltipFontStyle,\n fontSize: this.options.tooltipFontSize,\n caretHeight: this.options.tooltipCaretSize,\n cornerRadius: this.options.tooltipCornerRadius,\n text: template(this.options.tooltipTemplate, Element),\n chart: this.chart,\n custom: this.options.customTooltips\n }).draw();\n }, this);\n }\n }\n\n return this;\n },\n toBase64Image: function toBase64Image() {\n return this.chart.canvas.toDataURL.apply(this.chart.canvas, arguments);\n }\n });\n\n Chart.Type.extend = function (extensions) {\n var parent = this;\n\n var ChartType = function ChartType() {\n return parent.apply(this, arguments);\n }; //Copy the prototype object of the this class\n\n\n ChartType.prototype = clone(parent.prototype); //Now overwrite some of the properties in the base class with the new extensions\n\n extend(ChartType.prototype, extensions);\n ChartType.extend = Chart.Type.extend;\n\n if (extensions.name || parent.prototype.name) {\n var chartName = extensions.name || parent.prototype.name; //Assign any potential default values of the new chart type\n //If none are defined, we'll use a clone of the chart type this is being extended from.\n //I.e. if we extend a line chart, we'll use the defaults from the line chart if our new chart\n //doesn't define some defaults of their own.\n\n var baseDefaults = Chart.defaults[parent.prototype.name] ? clone(Chart.defaults[parent.prototype.name]) : {};\n Chart.defaults[chartName] = extend(baseDefaults, extensions.defaults);\n Chart.types[chartName] = ChartType; //Register this new chart type in the Chart prototype\n\n Chart.prototype[chartName] = function (data, options) {\n var config = merge(Chart.defaults.global, Chart.defaults[chartName], options || {});\n return new ChartType(data, config, this);\n };\n } else {\n warn(\"Name not provided for this chart, so it hasn't been registered\");\n }\n\n return parent;\n };\n\n Chart.Element = function (configuration) {\n extend(this, configuration);\n this.initialize.apply(this, arguments);\n this.save();\n };\n\n extend(Chart.Element.prototype, {\n initialize: function initialize() {},\n restore: function restore(props) {\n if (!props) {\n extend(this, this._saved);\n } else {\n each(props, function (key) {\n this[key] = this._saved[key];\n }, this);\n }\n\n return this;\n },\n save: function save() {\n this._saved = clone(this);\n delete this._saved._saved;\n return this;\n },\n update: function update(newProps) {\n each(newProps, function (value, key) {\n this._saved[key] = this[key];\n this[key] = value;\n }, this);\n return this;\n },\n transition: function transition(props, ease) {\n each(props, function (value, key) {\n this[key] = (value - this._saved[key]) * ease + this._saved[key];\n }, this);\n return this;\n },\n tooltipPosition: function tooltipPosition() {\n return {\n x: this.x,\n y: this.y\n };\n },\n hasValue: function hasValue() {\n return isNumber(this.value);\n }\n });\n Chart.Element.extend = inherits;\n Chart.Point = Chart.Element.extend({\n display: true,\n inRange: function inRange(chartX, chartY) {\n var hitDetectionRange = this.hitDetectionRadius + this.radius;\n return Math.pow(chartX - this.x, 2) + Math.pow(chartY - this.y, 2) < Math.pow(hitDetectionRange, 2);\n },\n draw: function draw() {\n if (this.display) {\n var ctx = this.ctx;\n ctx.beginPath();\n ctx.arc(this.x, this.y, this.radius, 0, Math.PI * 2);\n ctx.closePath();\n ctx.strokeStyle = this.strokeColor;\n ctx.lineWidth = this.strokeWidth;\n ctx.fillStyle = this.fillColor;\n ctx.fill();\n ctx.stroke();\n } //Quick debug for bezier curve splining\n //Highlights control points and the line between them.\n //Handy for dev - stripped in the min version.\n // ctx.save();\n // ctx.fillStyle = \"black\";\n // ctx.strokeStyle = \"black\"\n // ctx.beginPath();\n // ctx.arc(this.controlPoints.inner.x,this.controlPoints.inner.y, 2, 0, Math.PI*2);\n // ctx.fill();\n // ctx.beginPath();\n // ctx.arc(this.controlPoints.outer.x,this.controlPoints.outer.y, 2, 0, Math.PI*2);\n // ctx.fill();\n // ctx.moveTo(this.controlPoints.inner.x,this.controlPoints.inner.y);\n // ctx.lineTo(this.x, this.y);\n // ctx.lineTo(this.controlPoints.outer.x,this.controlPoints.outer.y);\n // ctx.stroke();\n // ctx.restore();\n\n }\n });\n Chart.Arc = Chart.Element.extend({\n inRange: function inRange(chartX, chartY) {\n var pointRelativePosition = helpers.getAngleFromPoint(this, {\n x: chartX,\n y: chartY\n }); // Normalize all angles to 0 - 2*PI (0 - 360°)\n\n var pointRelativeAngle = pointRelativePosition.angle % (Math.PI * 2),\n startAngle = (Math.PI * 2 + this.startAngle) % (Math.PI * 2),\n endAngle = (Math.PI * 2 + this.endAngle) % (Math.PI * 2) || 360; // Calculate wether the pointRelativeAngle is between the start and the end angle\n\n var betweenAngles = endAngle < startAngle ? pointRelativeAngle <= endAngle || pointRelativeAngle >= startAngle : pointRelativeAngle >= startAngle && pointRelativeAngle <= endAngle; //Check if within the range of the open/close angle\n\n var withinRadius = pointRelativePosition.distance >= this.innerRadius && pointRelativePosition.distance <= this.outerRadius;\n return betweenAngles && withinRadius; //Ensure within the outside of the arc centre, but inside arc outer\n },\n tooltipPosition: function tooltipPosition() {\n var centreAngle = this.startAngle + (this.endAngle - this.startAngle) / 2,\n rangeFromCentre = (this.outerRadius - this.innerRadius) / 2 + this.innerRadius;\n return {\n x: this.x + Math.cos(centreAngle) * rangeFromCentre,\n y: this.y + Math.sin(centreAngle) * rangeFromCentre\n };\n },\n draw: function draw(animationPercent) {\n var easingDecimal = animationPercent || 1;\n var ctx = this.ctx;\n ctx.beginPath();\n ctx.arc(this.x, this.y, this.outerRadius < 0 ? 0 : this.outerRadius, this.startAngle, this.endAngle);\n ctx.arc(this.x, this.y, this.innerRadius < 0 ? 0 : this.innerRadius, this.endAngle, this.startAngle, true);\n ctx.closePath();\n ctx.strokeStyle = this.strokeColor;\n ctx.lineWidth = this.strokeWidth;\n ctx.fillStyle = this.fillColor;\n ctx.fill();\n ctx.lineJoin = 'bevel';\n\n if (this.showStroke) {\n ctx.stroke();\n }\n }\n });\n Chart.Rectangle = Chart.Element.extend({\n draw: function draw() {\n var ctx = this.ctx,\n halfWidth = this.width / 2,\n leftX = this.x - halfWidth,\n rightX = this.x + halfWidth,\n top = this.base - (this.base - this.y),\n halfStroke = this.strokeWidth / 2; // Canvas doesn't allow us to stroke inside the width so we can\n // adjust the sizes to fit if we're setting a stroke on the line\n\n if (this.showStroke) {\n leftX += halfStroke;\n rightX -= halfStroke;\n top += halfStroke;\n }\n\n ctx.beginPath();\n ctx.fillStyle = this.fillColor;\n ctx.strokeStyle = this.strokeColor;\n ctx.lineWidth = this.strokeWidth; // It'd be nice to keep this class totally generic to any rectangle\n // and simply specify which border to miss out.\n\n ctx.moveTo(leftX, this.base);\n ctx.lineTo(leftX, top);\n ctx.lineTo(rightX, top);\n ctx.lineTo(rightX, this.base);\n ctx.fill();\n\n if (this.showStroke) {\n ctx.stroke();\n }\n },\n height: function height() {\n return this.base - this.y;\n },\n inRange: function inRange(chartX, chartY) {\n return chartX >= this.x - this.width / 2 && chartX <= this.x + this.width / 2 && chartY >= this.y && chartY <= this.base;\n }\n });\n Chart.Animation = Chart.Element.extend({\n currentStep: null,\n // the current animation step\n numSteps: 60,\n // default number of steps\n easing: \"\",\n // the easing to use for this animation\n render: null,\n // render function used by the animation service\n onAnimationProgress: null,\n // user specified callback to fire on each step of the animation \n onAnimationComplete: null // user specified callback to fire when the animation finishes\n\n });\n Chart.Tooltip = Chart.Element.extend({\n draw: function draw() {\n var ctx = this.chart.ctx;\n ctx.font = fontString(this.fontSize, this.fontStyle, this.fontFamily);\n this.xAlign = \"center\";\n this.yAlign = \"above\"; //Distance between the actual element.y position and the start of the tooltip caret\n\n var caretPadding = this.caretPadding = 2;\n var tooltipWidth = ctx.measureText(this.text).width + 2 * this.xPadding,\n tooltipRectHeight = this.fontSize + 2 * this.yPadding,\n tooltipHeight = tooltipRectHeight + this.caretHeight + caretPadding;\n\n if (this.x + tooltipWidth / 2 > this.chart.width) {\n this.xAlign = \"left\";\n } else if (this.x - tooltipWidth / 2 < 0) {\n this.xAlign = \"right\";\n }\n\n if (this.y - tooltipHeight < 0) {\n this.yAlign = \"below\";\n }\n\n var tooltipX = this.x - tooltipWidth / 2,\n tooltipY = this.y - tooltipHeight;\n ctx.fillStyle = this.fillColor; // Custom Tooltips\n\n if (this.custom) {\n this.custom(this);\n } else {\n switch (this.yAlign) {\n case \"above\":\n //Draw a caret above the x/y\n ctx.beginPath();\n ctx.moveTo(this.x, this.y - caretPadding);\n ctx.lineTo(this.x + this.caretHeight, this.y - (caretPadding + this.caretHeight));\n ctx.lineTo(this.x - this.caretHeight, this.y - (caretPadding + this.caretHeight));\n ctx.closePath();\n ctx.fill();\n break;\n\n case \"below\":\n tooltipY = this.y + caretPadding + this.caretHeight; //Draw a caret below the x/y\n\n ctx.beginPath();\n ctx.moveTo(this.x, this.y + caretPadding);\n ctx.lineTo(this.x + this.caretHeight, this.y + caretPadding + this.caretHeight);\n ctx.lineTo(this.x - this.caretHeight, this.y + caretPadding + this.caretHeight);\n ctx.closePath();\n ctx.fill();\n break;\n }\n\n switch (this.xAlign) {\n case \"left\":\n tooltipX = this.x - tooltipWidth + (this.cornerRadius + this.caretHeight);\n break;\n\n case \"right\":\n tooltipX = this.x - (this.cornerRadius + this.caretHeight);\n break;\n }\n\n drawRoundedRectangle(ctx, tooltipX, tooltipY, tooltipWidth, tooltipRectHeight, this.cornerRadius);\n ctx.fill();\n ctx.fillStyle = this.textColor;\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.fillText(this.text, tooltipX + tooltipWidth / 2, tooltipY + tooltipRectHeight / 2);\n }\n }\n });\n Chart.MultiTooltip = Chart.Element.extend({\n initialize: function initialize() {\n this.font = fontString(this.fontSize, this.fontStyle, this.fontFamily);\n this.titleFont = fontString(this.titleFontSize, this.titleFontStyle, this.titleFontFamily);\n this.titleHeight = this.title ? this.titleFontSize * 1.5 : 0;\n this.height = this.labels.length * this.fontSize + (this.labels.length - 1) * (this.fontSize / 2) + this.yPadding * 2 + this.titleHeight;\n this.ctx.font = this.titleFont;\n var titleWidth = this.ctx.measureText(this.title).width,\n //Label has a legend square as well so account for this.\n labelWidth = longestText(this.ctx, this.font, this.labels) + this.fontSize + 3,\n longestTextWidth = max([labelWidth, titleWidth]);\n this.width = longestTextWidth + this.xPadding * 2;\n var halfHeight = this.height / 2; //Check to ensure the height will fit on the canvas\n\n if (this.y - halfHeight < 0) {\n this.y = halfHeight;\n } else if (this.y + halfHeight > this.chart.height) {\n this.y = this.chart.height - halfHeight;\n } //Decide whether to align left or right based on position on canvas\n\n\n if (this.x > this.chart.width / 2) {\n this.x -= this.xOffset + this.width;\n } else {\n this.x += this.xOffset;\n }\n },\n getLineHeight: function getLineHeight(index) {\n var baseLineHeight = this.y - this.height / 2 + this.yPadding,\n afterTitleIndex = index - 1; //If the index is zero, we're getting the title\n\n if (index === 0) {\n return baseLineHeight + this.titleHeight / 3;\n } else {\n return baseLineHeight + (this.fontSize * 1.5 * afterTitleIndex + this.fontSize / 2) + this.titleHeight;\n }\n },\n draw: function draw() {\n // Custom Tooltips\n if (this.custom) {\n this.custom(this);\n } else {\n drawRoundedRectangle(this.ctx, this.x, this.y - this.height / 2, this.width, this.height, this.cornerRadius);\n var ctx = this.ctx;\n ctx.fillStyle = this.fillColor;\n ctx.fill();\n ctx.closePath();\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"middle\";\n ctx.fillStyle = this.titleTextColor;\n ctx.font = this.titleFont;\n ctx.fillText(this.title, this.x + this.xPadding, this.getLineHeight(0));\n ctx.font = this.font;\n helpers.each(this.labels, function (label, index) {\n ctx.fillStyle = this.textColor;\n ctx.fillText(label, this.x + this.xPadding + this.fontSize + 3, this.getLineHeight(index + 1)); //A bit gnarly, but clearing this rectangle breaks when using explorercanvas (clears whole canvas)\n //ctx.clearRect(this.x + this.xPadding, this.getLineHeight(index + 1) - this.fontSize/2, this.fontSize, this.fontSize);\n //Instead we'll make a white filled block to put the legendColour palette over.\n\n ctx.fillStyle = this.legendColorBackground;\n ctx.fillRect(this.x + this.xPadding, this.getLineHeight(index + 1) - this.fontSize / 2, this.fontSize, this.fontSize);\n ctx.fillStyle = this.legendColors[index].fill;\n ctx.fillRect(this.x + this.xPadding, this.getLineHeight(index + 1) - this.fontSize / 2, this.fontSize, this.fontSize);\n }, this);\n }\n }\n });\n Chart.Scale = Chart.Element.extend({\n initialize: function initialize() {\n this.fit();\n },\n buildYLabels: function buildYLabels() {\n this.yLabels = [];\n var stepDecimalPlaces = getDecimalPlaces(this.stepValue);\n\n for (var i = 0; i <= this.steps; i++) {\n this.yLabels.push(template(this.templateString, {\n value: (this.min + i * this.stepValue).toFixed(stepDecimalPlaces)\n }));\n }\n\n this.yLabelWidth = this.display && this.showLabels ? longestText(this.ctx, this.font, this.yLabels) + 10 : 0;\n },\n addXLabel: function addXLabel(label) {\n this.xLabels.push(label);\n this.valuesCount++;\n this.fit();\n },\n removeXLabel: function removeXLabel() {\n this.xLabels.shift();\n this.valuesCount--;\n this.fit();\n },\n // Fitting loop to rotate x Labels and figure out what fits there, and also calculate how many Y steps to use\n fit: function fit() {\n // First we need the width of the yLabels, assuming the xLabels aren't rotated\n // To do that we need the base line at the top and base of the chart, assuming there is no x label rotation\n this.startPoint = this.display ? this.fontSize : 0;\n this.endPoint = this.display ? this.height - this.fontSize * 1.5 - 5 : this.height; // -5 to pad labels\n // Apply padding settings to the start and end point.\n\n this.startPoint += this.padding;\n this.endPoint -= this.padding; // Cache the starting endpoint, excluding the space for x labels\n\n var cachedEndPoint = this.endPoint; // Cache the starting height, so can determine if we need to recalculate the scale yAxis\n\n var cachedHeight = this.endPoint - this.startPoint,\n cachedYLabelWidth; // Build the current yLabels so we have an idea of what size they'll be to start\n\n /*\n *\tThis sets what is returned from calculateScaleRange as static properties of this class:\n *\n \tthis.steps;\n \tthis.stepValue;\n \tthis.min;\n \tthis.max;\n *\n */\n\n this.calculateYRange(cachedHeight); // With these properties set we can now build the array of yLabels\n // and also the width of the largest yLabel\n\n this.buildYLabels();\n this.calculateXLabelRotation();\n\n while (cachedHeight > this.endPoint - this.startPoint) {\n cachedHeight = this.endPoint - this.startPoint;\n cachedYLabelWidth = this.yLabelWidth;\n this.calculateYRange(cachedHeight);\n this.buildYLabels(); // Only go through the xLabel loop again if the yLabel width has changed\n\n if (cachedYLabelWidth < this.yLabelWidth) {\n this.endPoint = cachedEndPoint;\n this.calculateXLabelRotation();\n }\n }\n },\n calculateXLabelRotation: function calculateXLabelRotation() {\n //Get the width of each grid by calculating the difference\n //between x offsets between 0 and 1.\n this.ctx.font = this.font;\n var firstWidth = this.ctx.measureText(this.xLabels[0]).width,\n lastWidth = this.ctx.measureText(this.xLabels[this.xLabels.length - 1]).width,\n firstRotated,\n lastRotated;\n this.xScalePaddingRight = lastWidth / 2 + 3;\n this.xScalePaddingLeft = firstWidth / 2 > this.yLabelWidth ? firstWidth / 2 : this.yLabelWidth;\n this.xLabelRotation = 0;\n\n if (this.display) {\n var originalLabelWidth = longestText(this.ctx, this.font, this.xLabels),\n cosRotation,\n firstRotatedWidth;\n this.xLabelWidth = originalLabelWidth; //Allow 3 pixels x2 padding either side for label readability\n\n var xGridWidth = Math.floor(this.calculateX(1) - this.calculateX(0)) - 6; //Max label rotate should be 90 - also act as a loop counter\n\n while (this.xLabelWidth > xGridWidth && this.xLabelRotation === 0 || this.xLabelWidth > xGridWidth && this.xLabelRotation <= 90 && this.xLabelRotation > 0) {\n cosRotation = Math.cos(toRadians(this.xLabelRotation));\n firstRotated = cosRotation * firstWidth;\n lastRotated = cosRotation * lastWidth; // We're right aligning the text now.\n\n if (firstRotated + this.fontSize / 2 > this.yLabelWidth) {\n this.xScalePaddingLeft = firstRotated + this.fontSize / 2;\n }\n\n this.xScalePaddingRight = this.fontSize / 2;\n this.xLabelRotation++;\n this.xLabelWidth = cosRotation * originalLabelWidth;\n }\n\n if (this.xLabelRotation > 0) {\n this.endPoint -= Math.sin(toRadians(this.xLabelRotation)) * originalLabelWidth + 3;\n }\n } else {\n this.xLabelWidth = 0;\n this.xScalePaddingRight = this.padding;\n this.xScalePaddingLeft = this.padding;\n }\n },\n // Needs to be overidden in each Chart type\n // Otherwise we need to pass all the data into the scale class\n calculateYRange: noop,\n drawingArea: function drawingArea() {\n return this.startPoint - this.endPoint;\n },\n calculateY: function calculateY(value) {\n var scalingFactor = this.drawingArea() / (this.min - this.max);\n return this.endPoint - scalingFactor * (value - this.min);\n },\n calculateX: function calculateX(index) {\n var isRotated = this.xLabelRotation > 0,\n // innerWidth = (this.offsetGridLines) ? this.width - offsetLeft - this.padding : this.width - (offsetLeft + halfLabelWidth * 2) - this.padding,\n innerWidth = this.width - (this.xScalePaddingLeft + this.xScalePaddingRight),\n valueWidth = innerWidth / Math.max(this.valuesCount - (this.offsetGridLines ? 0 : 1), 1),\n valueOffset = valueWidth * index + this.xScalePaddingLeft;\n\n if (this.offsetGridLines) {\n valueOffset += valueWidth / 2;\n }\n\n return Math.round(valueOffset);\n },\n update: function update(newProps) {\n helpers.extend(this, newProps);\n this.fit();\n },\n draw: function draw() {\n var ctx = this.ctx,\n yLabelGap = (this.endPoint - this.startPoint) / this.steps,\n xStart = Math.round(this.xScalePaddingLeft);\n\n if (this.display) {\n ctx.fillStyle = this.textColor;\n ctx.font = this.font;\n each(this.yLabels, function (labelString, index) {\n var yLabelCenter = this.endPoint - yLabelGap * index,\n linePositionY = Math.round(yLabelCenter),\n drawHorizontalLine = this.showHorizontalLines;\n ctx.textAlign = \"right\";\n ctx.textBaseline = \"middle\";\n\n if (this.showLabels) {\n ctx.fillText(labelString, xStart - 10, yLabelCenter);\n } // This is X axis, so draw it\n\n\n if (index === 0 && !drawHorizontalLine) {\n drawHorizontalLine = true;\n }\n\n if (drawHorizontalLine) {\n ctx.beginPath();\n }\n\n if (index > 0) {\n // This is a grid line in the centre, so drop that\n ctx.lineWidth = this.gridLineWidth;\n ctx.strokeStyle = this.gridLineColor;\n } else {\n // This is the first line on the scale\n ctx.lineWidth = this.lineWidth;\n ctx.strokeStyle = this.lineColor;\n }\n\n linePositionY += helpers.aliasPixel(ctx.lineWidth);\n\n if (drawHorizontalLine) {\n ctx.moveTo(xStart, linePositionY);\n ctx.lineTo(this.width, linePositionY);\n ctx.stroke();\n ctx.closePath();\n }\n\n ctx.lineWidth = this.lineWidth;\n ctx.strokeStyle = this.lineColor;\n ctx.beginPath();\n ctx.moveTo(xStart - 5, linePositionY);\n ctx.lineTo(xStart, linePositionY);\n ctx.stroke();\n ctx.closePath();\n }, this);\n each(this.xLabels, function (label, index) {\n var xPos = this.calculateX(index) + aliasPixel(this.lineWidth),\n // Check to see if line/bar here and decide where to place the line\n linePos = this.calculateX(index - (this.offsetGridLines ? 0.5 : 0)) + aliasPixel(this.lineWidth),\n isRotated = this.xLabelRotation > 0,\n drawVerticalLine = this.showVerticalLines; // This is Y axis, so draw it\n\n if (index === 0 && !drawVerticalLine) {\n drawVerticalLine = true;\n }\n\n if (drawVerticalLine) {\n ctx.beginPath();\n }\n\n if (index > 0) {\n // This is a grid line in the centre, so drop that\n ctx.lineWidth = this.gridLineWidth;\n ctx.strokeStyle = this.gridLineColor;\n } else {\n // This is the first line on the scale\n ctx.lineWidth = this.lineWidth;\n ctx.strokeStyle = this.lineColor;\n }\n\n if (drawVerticalLine) {\n ctx.moveTo(linePos, this.endPoint);\n ctx.lineTo(linePos, this.startPoint - 3);\n ctx.stroke();\n ctx.closePath();\n }\n\n ctx.lineWidth = this.lineWidth;\n ctx.strokeStyle = this.lineColor; // Small lines at the bottom of the base grid line\n\n ctx.beginPath();\n ctx.moveTo(linePos, this.endPoint);\n ctx.lineTo(linePos, this.endPoint + 5);\n ctx.stroke();\n ctx.closePath();\n ctx.save();\n ctx.translate(xPos, isRotated ? this.endPoint + 12 : this.endPoint + 8);\n ctx.rotate(toRadians(this.xLabelRotation) * -1);\n ctx.font = this.font;\n ctx.textAlign = isRotated ? \"right\" : \"center\";\n ctx.textBaseline = isRotated ? \"middle\" : \"top\";\n ctx.fillText(label, 0, 0);\n ctx.restore();\n }, this);\n }\n }\n });\n Chart.RadialScale = Chart.Element.extend({\n initialize: function initialize() {\n this.size = min([this.height, this.width]);\n this.drawingArea = this.display ? this.size / 2 - (this.fontSize / 2 + this.backdropPaddingY) : this.size / 2;\n },\n calculateCenterOffset: function calculateCenterOffset(value) {\n // Take into account half font size + the yPadding of the top value\n var scalingFactor = this.drawingArea / (this.max - this.min);\n return (value - this.min) * scalingFactor;\n },\n update: function update() {\n if (!this.lineArc) {\n this.setScaleSize();\n } else {\n this.drawingArea = this.display ? this.size / 2 - (this.fontSize / 2 + this.backdropPaddingY) : this.size / 2;\n }\n\n this.buildYLabels();\n },\n buildYLabels: function buildYLabels() {\n this.yLabels = [];\n var stepDecimalPlaces = getDecimalPlaces(this.stepValue);\n\n for (var i = 0; i <= this.steps; i++) {\n this.yLabels.push(template(this.templateString, {\n value: (this.min + i * this.stepValue).toFixed(stepDecimalPlaces)\n }));\n }\n },\n getCircumference: function getCircumference() {\n return Math.PI * 2 / this.valuesCount;\n },\n setScaleSize: function setScaleSize() {\n /*\n * Right, this is really confusing and there is a lot of maths going on here\n * The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9\n *\n * Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif\n *\n * Solution:\n *\n * We assume the radius of the polygon is half the size of the canvas at first\n * at each index we check if the text overlaps.\n *\n * Where it does, we store that angle and that index.\n *\n * After finding the largest index and angle we calculate how much we need to remove\n * from the shape radius to move the point inwards by that x.\n *\n * We average the left and right distances to get the maximum shape radius that can fit in the box\n * along with labels.\n *\n * Once we have that, we can find the centre point for the chart, by taking the x text protrusion\n * on each side, removing that from the size, halving it and adding the left x protrusion width.\n *\n * This will mean we have a shape fitted to the canvas, as large as it can be with the labels\n * and position it in the most space efficient manner\n *\n * https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif\n */\n // Get maximum radius of the polygon. Either half the height (minus the text width) or half the width.\n // Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points\n var largestPossibleRadius = min([this.height / 2 - this.pointLabelFontSize - 5, this.width / 2]),\n pointPosition,\n i,\n textWidth,\n halfTextWidth,\n furthestRight = this.width,\n furthestRightIndex,\n furthestRightAngle,\n furthestLeft = 0,\n furthestLeftIndex,\n furthestLeftAngle,\n xProtrusionLeft,\n xProtrusionRight,\n radiusReductionRight,\n radiusReductionLeft,\n maxWidthRadius;\n this.ctx.font = fontString(this.pointLabelFontSize, this.pointLabelFontStyle, this.pointLabelFontFamily);\n\n for (i = 0; i < this.valuesCount; i++) {\n // 5px to space the text slightly out - similar to what we do in the draw function.\n pointPosition = this.getPointPosition(i, largestPossibleRadius);\n textWidth = this.ctx.measureText(template(this.templateString, {\n value: this.labels[i]\n })).width + 5;\n\n if (i === 0 || i === this.valuesCount / 2) {\n // If we're at index zero, or exactly the middle, we're at exactly the top/bottom\n // of the radar chart, so text will be aligned centrally, so we'll half it and compare\n // w/left and right text sizes\n halfTextWidth = textWidth / 2;\n\n if (pointPosition.x + halfTextWidth > furthestRight) {\n furthestRight = pointPosition.x + halfTextWidth;\n furthestRightIndex = i;\n }\n\n if (pointPosition.x - halfTextWidth < furthestLeft) {\n furthestLeft = pointPosition.x - halfTextWidth;\n furthestLeftIndex = i;\n }\n } else if (i < this.valuesCount / 2) {\n // Less than half the values means we'll left align the text\n if (pointPosition.x + textWidth > furthestRight) {\n furthestRight = pointPosition.x + textWidth;\n furthestRightIndex = i;\n }\n } else if (i > this.valuesCount / 2) {\n // More than half the values means we'll right align the text\n if (pointPosition.x - textWidth < furthestLeft) {\n furthestLeft = pointPosition.x - textWidth;\n furthestLeftIndex = i;\n }\n }\n }\n\n xProtrusionLeft = furthestLeft;\n xProtrusionRight = Math.ceil(furthestRight - this.width);\n furthestRightAngle = this.getIndexAngle(furthestRightIndex);\n furthestLeftAngle = this.getIndexAngle(furthestLeftIndex);\n radiusReductionRight = xProtrusionRight / Math.sin(furthestRightAngle + Math.PI / 2);\n radiusReductionLeft = xProtrusionLeft / Math.sin(furthestLeftAngle + Math.PI / 2); // Ensure we actually need to reduce the size of the chart\n\n radiusReductionRight = isNumber(radiusReductionRight) ? radiusReductionRight : 0;\n radiusReductionLeft = isNumber(radiusReductionLeft) ? radiusReductionLeft : 0;\n this.drawingArea = largestPossibleRadius - (radiusReductionLeft + radiusReductionRight) / 2; //this.drawingArea = min([maxWidthRadius, (this.height - (2 * (this.pointLabelFontSize + 5)))/2])\n\n this.setCenterPoint(radiusReductionLeft, radiusReductionRight);\n },\n setCenterPoint: function setCenterPoint(leftMovement, rightMovement) {\n var maxRight = this.width - rightMovement - this.drawingArea,\n maxLeft = leftMovement + this.drawingArea;\n this.xCenter = (maxLeft + maxRight) / 2; // Always vertically in the centre as the text height doesn't change\n\n this.yCenter = this.height / 2;\n },\n getIndexAngle: function getIndexAngle(index) {\n var angleMultiplier = Math.PI * 2 / this.valuesCount; // Start from the top instead of right, so remove a quarter of the circle\n\n return index * angleMultiplier - Math.PI / 2;\n },\n getPointPosition: function getPointPosition(index, distanceFromCenter) {\n var thisAngle = this.getIndexAngle(index);\n return {\n x: Math.cos(thisAngle) * distanceFromCenter + this.xCenter,\n y: Math.sin(thisAngle) * distanceFromCenter + this.yCenter\n };\n },\n draw: function draw() {\n if (this.display) {\n var ctx = this.ctx;\n each(this.yLabels, function (label, index) {\n // Don't draw a centre value\n if (index > 0) {\n var yCenterOffset = index * (this.drawingArea / this.steps),\n yHeight = this.yCenter - yCenterOffset,\n pointPosition; // Draw circular lines around the scale\n\n if (this.lineWidth > 0) {\n ctx.strokeStyle = this.lineColor;\n ctx.lineWidth = this.lineWidth;\n\n if (this.lineArc) {\n ctx.beginPath();\n ctx.arc(this.xCenter, this.yCenter, yCenterOffset, 0, Math.PI * 2);\n ctx.closePath();\n ctx.stroke();\n } else {\n ctx.beginPath();\n\n for (var i = 0; i < this.valuesCount; i++) {\n pointPosition = this.getPointPosition(i, this.calculateCenterOffset(this.min + index * this.stepValue));\n\n if (i === 0) {\n ctx.moveTo(pointPosition.x, pointPosition.y);\n } else {\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n }\n\n ctx.closePath();\n ctx.stroke();\n }\n }\n\n if (this.showLabels) {\n ctx.font = fontString(this.fontSize, this.fontStyle, this.fontFamily);\n\n if (this.showLabelBackdrop) {\n var labelWidth = ctx.measureText(label).width;\n ctx.fillStyle = this.backdropColor;\n ctx.fillRect(this.xCenter - labelWidth / 2 - this.backdropPaddingX, yHeight - this.fontSize / 2 - this.backdropPaddingY, labelWidth + this.backdropPaddingX * 2, this.fontSize + this.backdropPaddingY * 2);\n }\n\n ctx.textAlign = 'center';\n ctx.textBaseline = \"middle\";\n ctx.fillStyle = this.fontColor;\n ctx.fillText(label, this.xCenter, yHeight);\n }\n }\n }, this);\n\n if (!this.lineArc) {\n ctx.lineWidth = this.angleLineWidth;\n ctx.strokeStyle = this.angleLineColor;\n\n for (var i = this.valuesCount - 1; i >= 0; i--) {\n var centerOffset = null,\n outerPosition = null;\n\n if (this.angleLineWidth > 0 && i % this.angleLineInterval === 0) {\n centerOffset = this.calculateCenterOffset(this.max);\n outerPosition = this.getPointPosition(i, centerOffset);\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(outerPosition.x, outerPosition.y);\n ctx.stroke();\n ctx.closePath();\n }\n\n if (this.backgroundColors && this.backgroundColors.length == this.valuesCount) {\n if (centerOffset == null) centerOffset = this.calculateCenterOffset(this.max);\n if (outerPosition == null) outerPosition = this.getPointPosition(i, centerOffset);\n var previousOuterPosition = this.getPointPosition(i === 0 ? this.valuesCount - 1 : i - 1, centerOffset);\n var nextOuterPosition = this.getPointPosition(i === this.valuesCount - 1 ? 0 : i + 1, centerOffset);\n var previousOuterHalfway = {\n x: (previousOuterPosition.x + outerPosition.x) / 2,\n y: (previousOuterPosition.y + outerPosition.y) / 2\n };\n var nextOuterHalfway = {\n x: (outerPosition.x + nextOuterPosition.x) / 2,\n y: (outerPosition.y + nextOuterPosition.y) / 2\n };\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(previousOuterHalfway.x, previousOuterHalfway.y);\n ctx.lineTo(outerPosition.x, outerPosition.y);\n ctx.lineTo(nextOuterHalfway.x, nextOuterHalfway.y);\n ctx.fillStyle = this.backgroundColors[i];\n ctx.fill();\n ctx.closePath();\n } // Extra 3px out for some label spacing\n\n\n var pointLabelPosition = this.getPointPosition(i, this.calculateCenterOffset(this.max) + 5);\n ctx.font = fontString(this.pointLabelFontSize, this.pointLabelFontStyle, this.pointLabelFontFamily);\n ctx.fillStyle = this.pointLabelFontColor;\n var labelsCount = this.labels.length,\n halfLabelsCount = this.labels.length / 2,\n quarterLabelsCount = halfLabelsCount / 2,\n upperHalf = i < quarterLabelsCount || i > labelsCount - quarterLabelsCount,\n exactQuarter = i === quarterLabelsCount || i === labelsCount - quarterLabelsCount;\n\n if (i === 0) {\n ctx.textAlign = 'center';\n } else if (i === halfLabelsCount) {\n ctx.textAlign = 'center';\n } else if (i < halfLabelsCount) {\n ctx.textAlign = 'left';\n } else {\n ctx.textAlign = 'right';\n } // Set the correct text baseline based on outer positioning\n\n\n if (exactQuarter) {\n ctx.textBaseline = 'middle';\n } else if (upperHalf) {\n ctx.textBaseline = 'bottom';\n } else {\n ctx.textBaseline = 'top';\n }\n\n ctx.fillText(this.labels[i], pointLabelPosition.x, pointLabelPosition.y);\n }\n }\n }\n }\n });\n Chart.animationService = {\n frameDuration: 17,\n animations: [],\n dropFrames: 0,\n addAnimation: function addAnimation(chartInstance, animationObject) {\n for (var index = 0; index < this.animations.length; ++index) {\n if (this.animations[index].chartInstance === chartInstance) {\n // replacing an in progress animation\n this.animations[index].animationObject = animationObject;\n return;\n }\n }\n\n this.animations.push({\n chartInstance: chartInstance,\n animationObject: animationObject\n }); // If there are no animations queued, manually kickstart a digest, for lack of a better word\n\n if (this.animations.length == 1) {\n helpers.requestAnimFrame.call(window, this.digestWrapper);\n }\n },\n // Cancel the animation for a given chart instance\n cancelAnimation: function cancelAnimation(chartInstance) {\n var index = helpers.findNextWhere(this.animations, function (animationWrapper) {\n return animationWrapper.chartInstance === chartInstance;\n });\n\n if (index) {\n this.animations.splice(index, 1);\n }\n },\n // calls startDigest with the proper context\n digestWrapper: function digestWrapper() {\n Chart.animationService.startDigest.call(Chart.animationService);\n },\n startDigest: function startDigest() {\n var startTime = Date.now();\n var framesToDrop = 0;\n\n if (this.dropFrames > 1) {\n framesToDrop = Math.floor(this.dropFrames);\n this.dropFrames -= framesToDrop;\n }\n\n for (var i = 0; i < this.animations.length; i++) {\n if (this.animations[i].animationObject.currentStep === null) {\n this.animations[i].animationObject.currentStep = 0;\n }\n\n this.animations[i].animationObject.currentStep += 1 + framesToDrop;\n\n if (this.animations[i].animationObject.currentStep > this.animations[i].animationObject.numSteps) {\n this.animations[i].animationObject.currentStep = this.animations[i].animationObject.numSteps;\n }\n\n this.animations[i].animationObject.render(this.animations[i].chartInstance, this.animations[i].animationObject); // Check if executed the last frame.\n\n if (this.animations[i].animationObject.currentStep == this.animations[i].animationObject.numSteps) {\n // Call onAnimationComplete\n this.animations[i].animationObject.onAnimationComplete.call(this.animations[i].chartInstance); // Remove the animation.\n\n this.animations.splice(i, 1); // Keep the index in place to offset the splice\n\n i--;\n }\n }\n\n var endTime = Date.now();\n var delay = endTime - startTime - this.frameDuration;\n var frameDelay = delay / this.frameDuration;\n\n if (frameDelay > 1) {\n this.dropFrames += frameDelay;\n } // Do we have more stuff to animate?\n\n\n if (this.animations.length > 0) {\n helpers.requestAnimFrame.call(window, this.digestWrapper);\n }\n }\n }; // Attach global event to resize each chart instance when the browser resizes\n\n helpers.addEvent(window, \"resize\", function () {\n // Basic debounce of resize function so it doesn't hurt performance when resizing browser.\n var timeout;\n return function () {\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n each(Chart.instances, function (instance) {\n // If the responsive flag is set in the chart instance config\n // Cascade the resize event down to the chart.\n if (instance.options.responsive) {\n instance.resize(instance.render, true);\n }\n });\n }, 50);\n };\n }());\n\n if (amd) {\n define('Chart', [], function () {\n return Chart;\n });\n } else if ((typeof module === \"undefined\" ? \"undefined\" : _typeof(module)) === 'object' && module.exports) {\n module.exports = Chart;\n }\n\n root.Chart = Chart;\n\n Chart.noConflict = function () {\n root.Chart = previous;\n return Chart;\n };\n}).call(this);\n(function () {\n \"use strict\";\n\n var root = this,\n Chart = root.Chart,\n helpers = Chart.helpers;\n var defaultConfig = {\n //Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value\n scaleBeginAtZero: true,\n //Boolean - Whether grid lines are shown across the chart\n scaleShowGridLines: true,\n //String - Colour of the grid lines\n scaleGridLineColor: \"rgba(0,0,0,.05)\",\n //Number - Width of the grid lines\n scaleGridLineWidth: 1,\n //Boolean - Whether to show horizontal lines (except X axis)\n scaleShowHorizontalLines: true,\n //Boolean - Whether to show vertical lines (except Y axis)\n scaleShowVerticalLines: true,\n //Boolean - If there is a stroke on each bar\n barShowStroke: true,\n //Number - Pixel width of the bar stroke\n barStrokeWidth: 2,\n //Number - Spacing between each of the X value sets\n barValueSpacing: 5,\n //Number - Spacing between data sets within X values\n barDatasetSpacing: 1,\n //String - A legend template\n legendTemplate: \"
    -legend\\\"><% for (var i=0; i
  • -legend-icon\\\" style=\\\"background-color:<%=datasets[i].fillColor%>\\\">-legend-text\\\"><%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  • <%}%>
\"\n };\n Chart.Type.extend({\n name: \"Bar\",\n defaults: defaultConfig,\n initialize: function initialize(data) {\n //Expose options as a scope variable here so we can access it in the ScaleClass\n var options = this.options;\n this.ScaleClass = Chart.Scale.extend({\n offsetGridLines: true,\n calculateBarX: function calculateBarX(datasetCount, datasetIndex, barIndex) {\n //Reusable method for calculating the xPosition of a given bar based on datasetIndex & width of the bar\n var xWidth = this.calculateBaseWidth(),\n xAbsolute = this.calculateX(barIndex) - xWidth / 2,\n barWidth = this.calculateBarWidth(datasetCount);\n return xAbsolute + barWidth * datasetIndex + datasetIndex * options.barDatasetSpacing + barWidth / 2;\n },\n calculateBaseWidth: function calculateBaseWidth() {\n return this.calculateX(1) - this.calculateX(0) - 2 * options.barValueSpacing;\n },\n calculateBarWidth: function calculateBarWidth(datasetCount) {\n //The padding between datasets is to the right of each bar, providing that there are more than 1 dataset\n var baseWidth = this.calculateBaseWidth() - (datasetCount - 1) * options.barDatasetSpacing;\n return baseWidth / datasetCount;\n }\n });\n this.datasets = []; //Set up tooltip events on the chart\n\n if (this.options.showTooltips) {\n helpers.bindEvents(this, this.options.tooltipEvents, function (evt) {\n var activeBars = evt.type !== 'mouseout' ? this.getBarsAtEvent(evt) : [];\n this.eachBars(function (bar) {\n bar.restore(['fillColor', 'strokeColor']);\n });\n helpers.each(activeBars, function (activeBar) {\n if (activeBar) {\n activeBar.fillColor = activeBar.highlightFill;\n activeBar.strokeColor = activeBar.highlightStroke;\n }\n });\n this.showTooltip(activeBars);\n });\n } //Declare the extension of the default point, to cater for the options passed in to the constructor\n\n\n this.BarClass = Chart.Rectangle.extend({\n strokeWidth: this.options.barStrokeWidth,\n showStroke: this.options.barShowStroke,\n ctx: this.chart.ctx\n }); //Iterate through each of the datasets, and build this into a property of the chart\n\n helpers.each(data.datasets, function (dataset, datasetIndex) {\n var datasetObject = {\n label: dataset.label || null,\n fillColor: dataset.fillColor,\n strokeColor: dataset.strokeColor,\n bars: []\n };\n this.datasets.push(datasetObject);\n helpers.each(dataset.data, function (dataPoint, index) {\n //Add a new point for each piece of data, passing any required data to draw.\n datasetObject.bars.push(new this.BarClass({\n value: dataPoint,\n label: data.labels[index],\n datasetLabel: dataset.label,\n strokeColor: _typeof(dataset.strokeColor) == 'object' ? dataset.strokeColor[index] : dataset.strokeColor,\n fillColor: _typeof(dataset.fillColor) == 'object' ? dataset.fillColor[index] : dataset.fillColor,\n highlightFill: dataset.highlightFill ? _typeof(dataset.highlightFill) == 'object' ? dataset.highlightFill[index] : dataset.highlightFill : _typeof(dataset.fillColor) == 'object' ? dataset.fillColor[index] : dataset.fillColor,\n highlightStroke: dataset.highlightStroke ? _typeof(dataset.highlightStroke) == 'object' ? dataset.highlightStroke[index] : dataset.highlightStroke : _typeof(dataset.strokeColor) == 'object' ? dataset.strokeColor[index] : dataset.strokeColor\n }));\n }, this);\n }, this);\n this.buildScale(data.labels);\n this.BarClass.prototype.base = this.scale.endPoint;\n this.eachBars(function (bar, index, datasetIndex) {\n helpers.extend(bar, {\n width: this.scale.calculateBarWidth(this.datasets.length),\n x: this.scale.calculateBarX(this.datasets.length, datasetIndex, index),\n y: this.scale.endPoint\n });\n bar.save();\n }, this);\n this.render();\n },\n update: function update() {\n this.scale.update(); // Reset any highlight colours before updating.\n\n helpers.each(this.activeElements, function (activeElement) {\n activeElement.restore(['fillColor', 'strokeColor']);\n });\n this.eachBars(function (bar) {\n bar.save();\n });\n this.render();\n },\n eachBars: function eachBars(callback) {\n helpers.each(this.datasets, function (dataset, datasetIndex) {\n helpers.each(dataset.bars, callback, this, datasetIndex);\n }, this);\n },\n getBarsAtEvent: function getBarsAtEvent(e) {\n var barsArray = [],\n eventPosition = helpers.getRelativePosition(e),\n datasetIterator = function datasetIterator(dataset) {\n barsArray.push(dataset.bars[barIndex]);\n },\n barIndex;\n\n for (var datasetIndex = 0; datasetIndex < this.datasets.length; datasetIndex++) {\n for (barIndex = 0; barIndex < this.datasets[datasetIndex].bars.length; barIndex++) {\n if (this.datasets[datasetIndex].bars[barIndex].inRange(eventPosition.x, eventPosition.y)) {\n helpers.each(this.datasets, datasetIterator);\n return barsArray;\n }\n }\n }\n\n return barsArray;\n },\n buildScale: function buildScale(labels) {\n var self = this;\n\n var dataTotal = function dataTotal() {\n var values = [];\n self.eachBars(function (bar) {\n values.push(bar.value);\n });\n return values;\n };\n\n var scaleOptions = {\n templateString: this.options.scaleLabel,\n height: this.chart.height,\n width: this.chart.width,\n ctx: this.chart.ctx,\n textColor: this.options.scaleFontColor,\n fontSize: this.options.scaleFontSize,\n fontStyle: this.options.scaleFontStyle,\n fontFamily: this.options.scaleFontFamily,\n valuesCount: labels.length,\n beginAtZero: this.options.scaleBeginAtZero,\n integersOnly: this.options.scaleIntegersOnly,\n calculateYRange: function calculateYRange(currentHeight) {\n var updatedRanges = helpers.calculateScaleRange(dataTotal(), currentHeight, this.fontSize, this.beginAtZero, this.integersOnly);\n helpers.extend(this, updatedRanges);\n },\n xLabels: labels,\n font: helpers.fontString(this.options.scaleFontSize, this.options.scaleFontStyle, this.options.scaleFontFamily),\n lineWidth: this.options.scaleLineWidth,\n lineColor: this.options.scaleLineColor,\n showHorizontalLines: this.options.scaleShowHorizontalLines,\n showVerticalLines: this.options.scaleShowVerticalLines,\n gridLineWidth: this.options.scaleShowGridLines ? this.options.scaleGridLineWidth : 0,\n gridLineColor: this.options.scaleShowGridLines ? this.options.scaleGridLineColor : \"rgba(0,0,0,0)\",\n padding: this.options.showScale ? 0 : this.options.barShowStroke ? this.options.barStrokeWidth : 0,\n showLabels: this.options.scaleShowLabels,\n display: this.options.showScale\n };\n\n if (this.options.scaleOverride) {\n helpers.extend(scaleOptions, {\n calculateYRange: helpers.noop,\n steps: this.options.scaleSteps,\n stepValue: this.options.scaleStepWidth,\n min: this.options.scaleStartValue,\n max: this.options.scaleStartValue + this.options.scaleSteps * this.options.scaleStepWidth\n });\n }\n\n this.scale = new this.ScaleClass(scaleOptions);\n },\n addData: function addData(valuesArray, label) {\n //Map the values array for each of the datasets\n helpers.each(valuesArray, function (value, datasetIndex) {\n //Add a new point for each piece of data, passing any required data to draw.\n this.datasets[datasetIndex].bars.push(new this.BarClass({\n value: value,\n label: label,\n datasetLabel: this.datasets[datasetIndex].label,\n x: this.scale.calculateBarX(this.datasets.length, datasetIndex, this.scale.valuesCount + 1),\n y: this.scale.endPoint,\n width: this.scale.calculateBarWidth(this.datasets.length),\n base: this.scale.endPoint,\n strokeColor: this.datasets[datasetIndex].strokeColor,\n fillColor: this.datasets[datasetIndex].fillColor\n }));\n }, this);\n this.scale.addXLabel(label); //Then re-render the chart.\n\n this.update();\n },\n removeData: function removeData() {\n this.scale.removeXLabel(); //Then re-render the chart.\n\n helpers.each(this.datasets, function (dataset) {\n dataset.bars.shift();\n }, this);\n this.update();\n },\n reflow: function reflow() {\n helpers.extend(this.BarClass.prototype, {\n y: this.scale.endPoint,\n base: this.scale.endPoint\n });\n var newScaleProps = helpers.extend({\n height: this.chart.height,\n width: this.chart.width\n });\n this.scale.update(newScaleProps);\n },\n draw: function draw(ease) {\n var easingDecimal = ease || 1;\n this.clear();\n var ctx = this.chart.ctx;\n this.scale.draw(easingDecimal); //Draw all the bars for each dataset\n\n helpers.each(this.datasets, function (dataset, datasetIndex) {\n helpers.each(dataset.bars, function (bar, index) {\n if (bar.hasValue()) {\n bar.base = this.scale.endPoint; //Transition then draw\n\n bar.transition({\n x: this.scale.calculateBarX(this.datasets.length, datasetIndex, index),\n y: this.scale.calculateY(bar.value),\n width: this.scale.calculateBarWidth(this.datasets.length)\n }, easingDecimal).draw();\n }\n }, this);\n }, this);\n }\n });\n}).call(this);\n(function () {\n \"use strict\";\n\n var root = this,\n Chart = root.Chart,\n //Cache a local reference to Chart.helpers\n helpers = Chart.helpers;\n var defaultConfig = {\n //Boolean - Whether we should show a stroke on each segment\n segmentShowStroke: true,\n //String - The colour of each segment stroke\n segmentStrokeColor: \"#fff\",\n //Number - The width of each segment stroke\n segmentStrokeWidth: 2,\n //The percentage of the chart that we cut out of the middle.\n percentageInnerCutout: 50,\n //Number - Amount of animation steps\n animationSteps: 100,\n //String - Animation easing effect\n animationEasing: \"easeOutBounce\",\n //Boolean - Whether we animate the rotation of the Doughnut\n animateRotate: true,\n //Boolean - Whether we animate scaling the Doughnut from the centre\n animateScale: false,\n //String - A legend template\n legendTemplate: \"
    -legend\\\"><% for (var i=0; i
  • -legend-icon\\\" style=\\\"background-color:<%=segments[i].fillColor%>\\\">-legend-text\\\"><%if(segments[i].label){%><%=segments[i].label%><%}%>
  • <%}%>
\"\n };\n Chart.Type.extend({\n //Passing in a name registers this chart in the Chart namespace\n name: \"Doughnut\",\n //Providing a defaults will also register the defaults in the chart namespace\n defaults: defaultConfig,\n //Initialize is fired when the chart is initialized - Data is passed in as a parameter\n //Config is automatically merged by the core of Chart.js, and is available at this.options\n initialize: function initialize(data) {\n //Declare segments as a static property to prevent inheriting across the Chart type prototype\n this.segments = [];\n this.outerRadius = (helpers.min([this.chart.width, this.chart.height]) - this.options.segmentStrokeWidth / 2) / 2;\n this.SegmentArc = Chart.Arc.extend({\n ctx: this.chart.ctx,\n x: this.chart.width / 2,\n y: this.chart.height / 2\n }); //Set up tooltip events on the chart\n\n if (this.options.showTooltips) {\n helpers.bindEvents(this, this.options.tooltipEvents, function (evt) {\n var activeSegments = evt.type !== 'mouseout' ? this.getSegmentsAtEvent(evt) : [];\n helpers.each(this.segments, function (segment) {\n segment.restore([\"fillColor\"]);\n });\n helpers.each(activeSegments, function (activeSegment) {\n activeSegment.fillColor = activeSegment.highlightColor;\n });\n this.showTooltip(activeSegments);\n });\n }\n\n this.calculateTotal(data);\n helpers.each(data, function (datapoint, index) {\n if (!datapoint.color) {\n datapoint.color = 'hsl(' + 360 * index / data.length + ', 100%, 50%)';\n }\n\n this.addData(datapoint, index, true);\n }, this);\n this.render();\n },\n getSegmentsAtEvent: function getSegmentsAtEvent(e) {\n var segmentsArray = [];\n var location = helpers.getRelativePosition(e);\n helpers.each(this.segments, function (segment) {\n if (segment.inRange(location.x, location.y)) segmentsArray.push(segment);\n }, this);\n return segmentsArray;\n },\n addData: function addData(segment, atIndex, silent) {\n var index = atIndex !== undefined ? atIndex : this.segments.length;\n\n if (typeof segment.color === \"undefined\") {\n segment.color = Chart.defaults.global.segmentColorDefault[index % Chart.defaults.global.segmentColorDefault.length];\n segment.highlight = Chart.defaults.global.segmentHighlightColorDefaults[index % Chart.defaults.global.segmentHighlightColorDefaults.length];\n }\n\n this.segments.splice(index, 0, new this.SegmentArc({\n value: segment.value,\n outerRadius: this.options.animateScale ? 0 : this.outerRadius,\n innerRadius: this.options.animateScale ? 0 : this.outerRadius / 100 * this.options.percentageInnerCutout,\n fillColor: segment.color,\n highlightColor: segment.highlight || segment.color,\n showStroke: this.options.segmentShowStroke,\n strokeWidth: this.options.segmentStrokeWidth,\n strokeColor: this.options.segmentStrokeColor,\n startAngle: Math.PI * 1.5,\n circumference: this.options.animateRotate ? 0 : this.calculateCircumference(segment.value),\n label: segment.label\n }));\n\n if (!silent) {\n this.reflow();\n this.update();\n }\n },\n calculateCircumference: function calculateCircumference(value) {\n if (this.total > 0) {\n return Math.PI * 2 * (value / this.total);\n } else {\n return 0;\n }\n },\n calculateTotal: function calculateTotal(data) {\n this.total = 0;\n helpers.each(data, function (segment) {\n this.total += Math.abs(segment.value);\n }, this);\n },\n update: function update() {\n this.calculateTotal(this.segments); // Reset any highlight colours before updating.\n\n helpers.each(this.activeElements, function (activeElement) {\n activeElement.restore(['fillColor']);\n });\n helpers.each(this.segments, function (segment) {\n segment.save();\n });\n this.render();\n },\n removeData: function removeData(atIndex) {\n var indexToDelete = helpers.isNumber(atIndex) ? atIndex : this.segments.length - 1;\n this.segments.splice(indexToDelete, 1);\n this.reflow();\n this.update();\n },\n reflow: function reflow() {\n helpers.extend(this.SegmentArc.prototype, {\n x: this.chart.width / 2,\n y: this.chart.height / 2\n });\n this.outerRadius = (helpers.min([this.chart.width, this.chart.height]) - this.options.segmentStrokeWidth / 2) / 2;\n helpers.each(this.segments, function (segment) {\n segment.update({\n outerRadius: this.outerRadius,\n innerRadius: this.outerRadius / 100 * this.options.percentageInnerCutout\n });\n }, this);\n },\n draw: function draw(easeDecimal) {\n var animDecimal = easeDecimal ? easeDecimal : 1;\n this.clear();\n helpers.each(this.segments, function (segment, index) {\n segment.transition({\n circumference: this.calculateCircumference(segment.value),\n outerRadius: this.outerRadius,\n innerRadius: this.outerRadius / 100 * this.options.percentageInnerCutout\n }, animDecimal);\n segment.endAngle = segment.startAngle + segment.circumference;\n segment.draw();\n\n if (index === 0) {\n segment.startAngle = Math.PI * 1.5;\n } //Check to see if it's the last segment, if not get the next and update the start angle\n\n\n if (index < this.segments.length - 1) {\n this.segments[index + 1].startAngle = segment.endAngle;\n }\n }, this);\n }\n });\n Chart.types.Doughnut.extend({\n name: \"Pie\",\n defaults: helpers.merge(defaultConfig, {\n percentageInnerCutout: 0\n })\n });\n}).call(this);\n(function () {\n \"use strict\";\n\n var root = this,\n Chart = root.Chart,\n helpers = Chart.helpers;\n var defaultConfig = {\n ///Boolean - Whether grid lines are shown across the chart\n scaleShowGridLines: true,\n //String - Colour of the grid lines\n scaleGridLineColor: \"rgba(0,0,0,.05)\",\n //Number - Width of the grid lines\n scaleGridLineWidth: 1,\n //Boolean - Whether to show horizontal lines (except X axis)\n scaleShowHorizontalLines: true,\n //Boolean - Whether to show vertical lines (except Y axis)\n scaleShowVerticalLines: true,\n //Boolean - Whether the line is curved between points\n bezierCurve: true,\n //Number - Tension of the bezier curve between points\n bezierCurveTension: 0.4,\n //Boolean - Whether to show a dot for each point\n pointDot: true,\n //Number - Radius of each point dot in pixels\n pointDotRadius: 4,\n //Number - Pixel width of point dot stroke\n pointDotStrokeWidth: 1,\n //Number - amount extra to add to the radius to cater for hit detection outside the drawn point\n pointHitDetectionRadius: 20,\n //Boolean - Whether to show a stroke for datasets\n datasetStroke: true,\n //Number - Pixel width of dataset stroke\n datasetStrokeWidth: 2,\n //Boolean - Whether to fill the dataset with a colour\n datasetFill: true,\n //String - A legend template\n legendTemplate: \"
    -legend\\\"><% for (var i=0; i
  • -legend-icon\\\" style=\\\"background-color:<%=datasets[i].strokeColor%>\\\">-legend-text\\\"><%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  • <%}%>
\",\n //Boolean - Whether to horizontally center the label and point dot inside the grid\n offsetGridLines: false\n };\n Chart.Type.extend({\n name: \"Line\",\n defaults: defaultConfig,\n initialize: function initialize(data) {\n //Declare the extension of the default point, to cater for the options passed in to the constructor\n this.PointClass = Chart.Point.extend({\n offsetGridLines: this.options.offsetGridLines,\n strokeWidth: this.options.pointDotStrokeWidth,\n radius: this.options.pointDotRadius,\n display: this.options.pointDot,\n hitDetectionRadius: this.options.pointHitDetectionRadius,\n ctx: this.chart.ctx,\n inRange: function inRange(mouseX) {\n return Math.pow(mouseX - this.x, 2) < Math.pow(this.radius + this.hitDetectionRadius, 2);\n }\n });\n this.datasets = []; //Set up tooltip events on the chart\n\n if (this.options.showTooltips) {\n helpers.bindEvents(this, this.options.tooltipEvents, function (evt) {\n var activePoints = evt.type !== 'mouseout' ? this.getPointsAtEvent(evt) : [];\n this.eachPoints(function (point) {\n point.restore(['fillColor', 'strokeColor']);\n });\n helpers.each(activePoints, function (activePoint) {\n activePoint.fillColor = activePoint.highlightFill;\n activePoint.strokeColor = activePoint.highlightStroke;\n });\n this.showTooltip(activePoints);\n });\n } //Iterate through each of the datasets, and build this into a property of the chart\n\n\n helpers.each(data.datasets, function (dataset) {\n var datasetObject = {\n label: dataset.label || null,\n fillColor: dataset.fillColor,\n strokeColor: dataset.strokeColor,\n pointColor: dataset.pointColor,\n pointStrokeColor: dataset.pointStrokeColor,\n points: []\n };\n this.datasets.push(datasetObject);\n helpers.each(dataset.data, function (dataPoint, index) {\n //Add a new point for each piece of data, passing any required data to draw.\n datasetObject.points.push(new this.PointClass({\n value: dataPoint,\n label: data.labels[index],\n datasetLabel: dataset.label,\n strokeColor: dataset.pointStrokeColor,\n fillColor: dataset.pointColor,\n highlightFill: dataset.pointHighlightFill || dataset.pointColor,\n highlightStroke: dataset.pointHighlightStroke || dataset.pointStrokeColor\n }));\n }, this);\n this.buildScale(data.labels);\n this.eachPoints(function (point, index) {\n helpers.extend(point, {\n x: this.scale.calculateX(index),\n y: this.scale.endPoint\n });\n point.save();\n }, this);\n }, this);\n this.render();\n },\n update: function update() {\n this.scale.update(); // Reset any highlight colours before updating.\n\n helpers.each(this.activeElements, function (activeElement) {\n activeElement.restore(['fillColor', 'strokeColor']);\n });\n this.eachPoints(function (point) {\n point.save();\n });\n this.render();\n },\n eachPoints: function eachPoints(callback) {\n helpers.each(this.datasets, function (dataset) {\n helpers.each(dataset.points, callback, this);\n }, this);\n },\n getPointsAtEvent: function getPointsAtEvent(e) {\n var pointsArray = [],\n eventPosition = helpers.getRelativePosition(e);\n helpers.each(this.datasets, function (dataset) {\n helpers.each(dataset.points, function (point) {\n if (point.inRange(eventPosition.x, eventPosition.y)) pointsArray.push(point);\n });\n }, this);\n return pointsArray;\n },\n buildScale: function buildScale(labels) {\n var self = this;\n\n var dataTotal = function dataTotal() {\n var values = [];\n self.eachPoints(function (point) {\n values.push(point.value);\n });\n return values;\n };\n\n var scaleOptions = {\n templateString: this.options.scaleLabel,\n height: this.chart.height,\n width: this.chart.width,\n ctx: this.chart.ctx,\n textColor: this.options.scaleFontColor,\n offsetGridLines: this.options.offsetGridLines,\n fontSize: this.options.scaleFontSize,\n fontStyle: this.options.scaleFontStyle,\n fontFamily: this.options.scaleFontFamily,\n valuesCount: labels.length,\n beginAtZero: this.options.scaleBeginAtZero,\n integersOnly: this.options.scaleIntegersOnly,\n calculateYRange: function calculateYRange(currentHeight) {\n var updatedRanges = helpers.calculateScaleRange(dataTotal(), currentHeight, this.fontSize, this.beginAtZero, this.integersOnly);\n helpers.extend(this, updatedRanges);\n },\n xLabels: labels,\n font: helpers.fontString(this.options.scaleFontSize, this.options.scaleFontStyle, this.options.scaleFontFamily),\n lineWidth: this.options.scaleLineWidth,\n lineColor: this.options.scaleLineColor,\n showHorizontalLines: this.options.scaleShowHorizontalLines,\n showVerticalLines: this.options.scaleShowVerticalLines,\n gridLineWidth: this.options.scaleShowGridLines ? this.options.scaleGridLineWidth : 0,\n gridLineColor: this.options.scaleShowGridLines ? this.options.scaleGridLineColor : \"rgba(0,0,0,0)\",\n padding: this.options.showScale ? 0 : this.options.pointDotRadius + this.options.pointDotStrokeWidth,\n showLabels: this.options.scaleShowLabels,\n display: this.options.showScale\n };\n\n if (this.options.scaleOverride) {\n helpers.extend(scaleOptions, {\n calculateYRange: helpers.noop,\n steps: this.options.scaleSteps,\n stepValue: this.options.scaleStepWidth,\n min: this.options.scaleStartValue,\n max: this.options.scaleStartValue + this.options.scaleSteps * this.options.scaleStepWidth\n });\n }\n\n this.scale = new Chart.Scale(scaleOptions);\n },\n addData: function addData(valuesArray, label) {\n //Map the values array for each of the datasets\n helpers.each(valuesArray, function (value, datasetIndex) {\n //Add a new point for each piece of data, passing any required data to draw.\n this.datasets[datasetIndex].points.push(new this.PointClass({\n value: value,\n label: label,\n datasetLabel: this.datasets[datasetIndex].label,\n x: this.scale.calculateX(this.scale.valuesCount + 1),\n y: this.scale.endPoint,\n strokeColor: this.datasets[datasetIndex].pointStrokeColor,\n fillColor: this.datasets[datasetIndex].pointColor\n }));\n }, this);\n this.scale.addXLabel(label); //Then re-render the chart.\n\n this.update();\n },\n removeData: function removeData() {\n this.scale.removeXLabel(); //Then re-render the chart.\n\n helpers.each(this.datasets, function (dataset) {\n dataset.points.shift();\n }, this);\n this.update();\n },\n reflow: function reflow() {\n var newScaleProps = helpers.extend({\n height: this.chart.height,\n width: this.chart.width\n });\n this.scale.update(newScaleProps);\n },\n draw: function draw(ease) {\n var easingDecimal = ease || 1;\n this.clear();\n var ctx = this.chart.ctx; // Some helper methods for getting the next/prev points\n\n var hasValue = function hasValue(item) {\n return item.value !== null;\n },\n nextPoint = function nextPoint(point, collection, index) {\n return helpers.findNextWhere(collection, hasValue, index) || point;\n },\n previousPoint = function previousPoint(point, collection, index) {\n return helpers.findPreviousWhere(collection, hasValue, index) || point;\n };\n\n if (!this.scale) return;\n this.scale.draw(easingDecimal);\n helpers.each(this.datasets, function (dataset) {\n var pointsWithValues = helpers.where(dataset.points, hasValue); //Transition each point first so that the line and point drawing isn't out of sync\n //We can use this extra loop to calculate the control points of this dataset also in this loop\n\n helpers.each(dataset.points, function (point, index) {\n if (point.hasValue()) {\n point.transition({\n y: this.scale.calculateY(point.value),\n x: this.scale.calculateX(index)\n }, easingDecimal);\n }\n }, this); // Control points need to be calculated in a separate loop, because we need to know the current x/y of the point\n // This would cause issues when there is no animation, because the y of the next point would be 0, so beziers would be skewed\n\n if (this.options.bezierCurve) {\n helpers.each(pointsWithValues, function (point, index) {\n var tension = index > 0 && index < pointsWithValues.length - 1 ? this.options.bezierCurveTension : 0;\n point.controlPoints = helpers.splineCurve(previousPoint(point, pointsWithValues, index), point, nextPoint(point, pointsWithValues, index), tension); // Prevent the bezier going outside of the bounds of the graph\n // Cap puter bezier handles to the upper/lower scale bounds\n\n if (point.controlPoints.outer.y > this.scale.endPoint) {\n point.controlPoints.outer.y = this.scale.endPoint;\n } else if (point.controlPoints.outer.y < this.scale.startPoint) {\n point.controlPoints.outer.y = this.scale.startPoint;\n } // Cap inner bezier handles to the upper/lower scale bounds\n\n\n if (point.controlPoints.inner.y > this.scale.endPoint) {\n point.controlPoints.inner.y = this.scale.endPoint;\n } else if (point.controlPoints.inner.y < this.scale.startPoint) {\n point.controlPoints.inner.y = this.scale.startPoint;\n }\n }, this);\n } //Draw the line between all the points\n\n\n ctx.lineWidth = this.options.datasetStrokeWidth;\n ctx.strokeStyle = dataset.strokeColor;\n ctx.beginPath();\n helpers.each(pointsWithValues, function (point, index) {\n if (index === 0) {\n ctx.moveTo(point.x, point.y);\n } else {\n if (this.options.bezierCurve) {\n var previous = previousPoint(point, pointsWithValues, index);\n ctx.bezierCurveTo(previous.controlPoints.outer.x, previous.controlPoints.outer.y, point.controlPoints.inner.x, point.controlPoints.inner.y, point.x, point.y);\n } else {\n ctx.lineTo(point.x, point.y);\n }\n }\n }, this);\n\n if (this.options.datasetStroke) {\n ctx.stroke();\n }\n\n if (this.options.datasetFill && pointsWithValues.length > 0) {\n //Round off the line by going to the base of the chart, back to the start, then fill.\n ctx.lineTo(pointsWithValues[pointsWithValues.length - 1].x, this.scale.endPoint);\n ctx.lineTo(pointsWithValues[0].x, this.scale.endPoint);\n ctx.fillStyle = dataset.fillColor;\n ctx.closePath();\n ctx.fill();\n } //Now draw the points over the line\n //A little inefficient double looping, but better than the line\n //lagging behind the point positions\n\n\n helpers.each(pointsWithValues, function (point) {\n point.draw();\n });\n }, this);\n }\n });\n}).call(this);\n(function () {\n \"use strict\";\n\n var root = this,\n Chart = root.Chart,\n //Cache a local reference to Chart.helpers\n helpers = Chart.helpers;\n var defaultConfig = {\n //Boolean - Show a backdrop to the scale label\n scaleShowLabelBackdrop: true,\n //String - The colour of the label backdrop\n scaleBackdropColor: \"rgba(255,255,255,0.75)\",\n // Boolean - Whether the scale should begin at zero\n scaleBeginAtZero: true,\n //Number - The backdrop padding above & below the label in pixels\n scaleBackdropPaddingY: 2,\n //Number - The backdrop padding to the side of the label in pixels\n scaleBackdropPaddingX: 2,\n //Boolean - Show line for each value in the scale\n scaleShowLine: true,\n //Boolean - Stroke a line around each segment in the chart\n segmentShowStroke: true,\n //String - The colour of the stroke on each segment.\n segmentStrokeColor: \"#fff\",\n //Number - The width of the stroke value in pixels\n segmentStrokeWidth: 2,\n //Number - Amount of animation steps\n animationSteps: 100,\n //String - Animation easing effect.\n animationEasing: \"easeOutBounce\",\n //Boolean - Whether to animate the rotation of the chart\n animateRotate: true,\n //Boolean - Whether to animate scaling the chart from the centre\n animateScale: false,\n //String - A legend template\n legendTemplate: \"
    -legend\\\"><% for (var i=0; i
  • -legend-icon\\\" style=\\\"background-color:<%=segments[i].fillColor%>\\\">-legend-text\\\"><%if(segments[i].label){%><%=segments[i].label%><%}%>
  • <%}%>
\"\n };\n Chart.Type.extend({\n //Passing in a name registers this chart in the Chart namespace\n name: \"PolarArea\",\n //Providing a defaults will also register the defaults in the chart namespace\n defaults: defaultConfig,\n //Initialize is fired when the chart is initialized - Data is passed in as a parameter\n //Config is automatically merged by the core of Chart.js, and is available at this.options\n initialize: function initialize(data) {\n this.segments = []; //Declare segment class as a chart instance specific class, so it can share props for this instance\n\n this.SegmentArc = Chart.Arc.extend({\n showStroke: this.options.segmentShowStroke,\n strokeWidth: this.options.segmentStrokeWidth,\n strokeColor: this.options.segmentStrokeColor,\n ctx: this.chart.ctx,\n innerRadius: 0,\n x: this.chart.width / 2,\n y: this.chart.height / 2\n });\n this.scale = new Chart.RadialScale({\n display: this.options.showScale,\n fontStyle: this.options.scaleFontStyle,\n fontSize: this.options.scaleFontSize,\n fontFamily: this.options.scaleFontFamily,\n fontColor: this.options.scaleFontColor,\n showLabels: this.options.scaleShowLabels,\n showLabelBackdrop: this.options.scaleShowLabelBackdrop,\n backdropColor: this.options.scaleBackdropColor,\n backdropPaddingY: this.options.scaleBackdropPaddingY,\n backdropPaddingX: this.options.scaleBackdropPaddingX,\n lineWidth: this.options.scaleShowLine ? this.options.scaleLineWidth : 0,\n lineColor: this.options.scaleLineColor,\n lineArc: true,\n width: this.chart.width,\n height: this.chart.height,\n xCenter: this.chart.width / 2,\n yCenter: this.chart.height / 2,\n ctx: this.chart.ctx,\n templateString: this.options.scaleLabel,\n valuesCount: data.length\n });\n this.updateScaleRange(data);\n this.scale.update();\n helpers.each(data, function (segment, index) {\n this.addData(segment, index, true);\n }, this); //Set up tooltip events on the chart\n\n if (this.options.showTooltips) {\n helpers.bindEvents(this, this.options.tooltipEvents, function (evt) {\n var activeSegments = evt.type !== 'mouseout' ? this.getSegmentsAtEvent(evt) : [];\n helpers.each(this.segments, function (segment) {\n segment.restore([\"fillColor\"]);\n });\n helpers.each(activeSegments, function (activeSegment) {\n activeSegment.fillColor = activeSegment.highlightColor;\n });\n this.showTooltip(activeSegments);\n });\n }\n\n this.render();\n },\n getSegmentsAtEvent: function getSegmentsAtEvent(e) {\n var segmentsArray = [];\n var location = helpers.getRelativePosition(e);\n helpers.each(this.segments, function (segment) {\n if (segment.inRange(location.x, location.y)) segmentsArray.push(segment);\n }, this);\n return segmentsArray;\n },\n addData: function addData(segment, atIndex, silent) {\n var index = atIndex || this.segments.length;\n this.segments.splice(index, 0, new this.SegmentArc({\n fillColor: segment.color,\n highlightColor: segment.highlight || segment.color,\n label: segment.label,\n value: segment.value,\n outerRadius: this.options.animateScale ? 0 : this.scale.calculateCenterOffset(segment.value),\n circumference: this.options.animateRotate ? 0 : this.scale.getCircumference(),\n startAngle: Math.PI * 1.5\n }));\n\n if (!silent) {\n this.reflow();\n this.update();\n }\n },\n removeData: function removeData(atIndex) {\n var indexToDelete = helpers.isNumber(atIndex) ? atIndex : this.segments.length - 1;\n this.segments.splice(indexToDelete, 1);\n this.reflow();\n this.update();\n },\n calculateTotal: function calculateTotal(data) {\n this.total = 0;\n helpers.each(data, function (segment) {\n this.total += segment.value;\n }, this);\n this.scale.valuesCount = this.segments.length;\n },\n updateScaleRange: function updateScaleRange(datapoints) {\n var valuesArray = [];\n helpers.each(datapoints, function (segment) {\n valuesArray.push(segment.value);\n });\n var scaleSizes = this.options.scaleOverride ? {\n steps: this.options.scaleSteps,\n stepValue: this.options.scaleStepWidth,\n min: this.options.scaleStartValue,\n max: this.options.scaleStartValue + this.options.scaleSteps * this.options.scaleStepWidth\n } : helpers.calculateScaleRange(valuesArray, helpers.min([this.chart.width, this.chart.height]) / 2, this.options.scaleFontSize, this.options.scaleBeginAtZero, this.options.scaleIntegersOnly);\n helpers.extend(this.scale, scaleSizes, {\n size: helpers.min([this.chart.width, this.chart.height]),\n xCenter: this.chart.width / 2,\n yCenter: this.chart.height / 2\n });\n },\n update: function update() {\n this.calculateTotal(this.segments);\n helpers.each(this.segments, function (segment) {\n segment.save();\n });\n this.reflow();\n this.render();\n },\n reflow: function reflow() {\n helpers.extend(this.SegmentArc.prototype, {\n x: this.chart.width / 2,\n y: this.chart.height / 2\n });\n this.updateScaleRange(this.segments);\n this.scale.update();\n helpers.extend(this.scale, {\n xCenter: this.chart.width / 2,\n yCenter: this.chart.height / 2\n });\n helpers.each(this.segments, function (segment) {\n segment.update({\n outerRadius: this.scale.calculateCenterOffset(segment.value)\n });\n }, this);\n },\n draw: function draw(ease) {\n var easingDecimal = ease || 1; //Clear & draw the canvas\n\n this.clear();\n helpers.each(this.segments, function (segment, index) {\n segment.transition({\n circumference: this.scale.getCircumference(),\n outerRadius: this.scale.calculateCenterOffset(segment.value)\n }, easingDecimal);\n segment.endAngle = segment.startAngle + segment.circumference; // If we've removed the first segment we need to set the first one to\n // start at the top.\n\n if (index === 0) {\n segment.startAngle = Math.PI * 1.5;\n } //Check to see if it's the last segment, if not get the next and update the start angle\n\n\n if (index < this.segments.length - 1) {\n this.segments[index + 1].startAngle = segment.endAngle;\n }\n\n segment.draw();\n }, this);\n this.scale.draw();\n }\n });\n}).call(this);\n(function () {\n \"use strict\";\n\n var root = this,\n Chart = root.Chart,\n helpers = Chart.helpers;\n Chart.Type.extend({\n name: \"Radar\",\n defaults: {\n //Boolean - Whether to show lines for each scale point\n scaleShowLine: true,\n //Boolean - Whether we show the angle lines out of the radar\n angleShowLineOut: true,\n //Boolean - Whether to show labels on the scale\n scaleShowLabels: false,\n // Boolean - Whether the scale should begin at zero\n scaleBeginAtZero: true,\n //String - Colour of the angle line\n angleLineColor: \"rgba(0,0,0,.1)\",\n //Number - Pixel width of the angle line\n angleLineWidth: 1,\n //Number - Interval at which to draw angle lines (\"every Nth point\")\n angleLineInterval: 1,\n //String - Point label font declaration\n pointLabelFontFamily: \"'Arial'\",\n //String - Point label font weight\n pointLabelFontStyle: \"normal\",\n //Number - Point label font size in pixels\n pointLabelFontSize: 10,\n //String - Point label font colour\n pointLabelFontColor: \"#666\",\n //Boolean - Whether to show a dot for each point\n pointDot: true,\n //Number - Radius of each point dot in pixels\n pointDotRadius: 3,\n //Number - Pixel width of point dot stroke\n pointDotStrokeWidth: 1,\n //Number - amount extra to add to the radius to cater for hit detection outside the drawn point\n pointHitDetectionRadius: 20,\n //Boolean - Whether to show a stroke for datasets\n datasetStroke: true,\n //Number - Pixel width of dataset stroke\n datasetStrokeWidth: 2,\n //Boolean - Whether to fill the dataset with a colour\n datasetFill: true,\n //String - A legend template\n legendTemplate: \"
    -legend\\\"><% for (var i=0; i
  • -legend-icon\\\" style=\\\"background-color:<%=datasets[i].strokeColor%>\\\">-legend-text\\\"><%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  • <%}%>
\"\n },\n initialize: function initialize(data) {\n this.PointClass = Chart.Point.extend({\n strokeWidth: this.options.pointDotStrokeWidth,\n radius: this.options.pointDotRadius,\n display: this.options.pointDot,\n hitDetectionRadius: this.options.pointHitDetectionRadius,\n ctx: this.chart.ctx\n });\n this.datasets = [];\n this.buildScale(data); //Set up tooltip events on the chart\n\n if (this.options.showTooltips) {\n helpers.bindEvents(this, this.options.tooltipEvents, function (evt) {\n var activePointsCollection = evt.type !== 'mouseout' ? this.getPointsAtEvent(evt) : [];\n this.eachPoints(function (point) {\n point.restore(['fillColor', 'strokeColor']);\n });\n helpers.each(activePointsCollection, function (activePoint) {\n activePoint.fillColor = activePoint.highlightFill;\n activePoint.strokeColor = activePoint.highlightStroke;\n });\n this.showTooltip(activePointsCollection);\n });\n } //Iterate through each of the datasets, and build this into a property of the chart\n\n\n helpers.each(data.datasets, function (dataset) {\n var datasetObject = {\n label: dataset.label || null,\n fillColor: dataset.fillColor,\n strokeColor: dataset.strokeColor,\n pointColor: dataset.pointColor,\n pointStrokeColor: dataset.pointStrokeColor,\n points: []\n };\n this.datasets.push(datasetObject);\n helpers.each(dataset.data, function (dataPoint, index) {\n //Add a new point for each piece of data, passing any required data to draw.\n var pointPosition;\n\n if (!this.scale.animation) {\n pointPosition = this.scale.getPointPosition(index, this.scale.calculateCenterOffset(dataPoint));\n }\n\n datasetObject.points.push(new this.PointClass({\n value: dataPoint,\n label: data.labels[index],\n datasetLabel: dataset.label,\n x: this.options.animation ? this.scale.xCenter : pointPosition.x,\n y: this.options.animation ? this.scale.yCenter : pointPosition.y,\n strokeColor: dataset.pointStrokeColor,\n fillColor: dataset.pointColor,\n highlightFill: dataset.pointHighlightFill || dataset.pointColor,\n highlightStroke: dataset.pointHighlightStroke || dataset.pointStrokeColor\n }));\n }, this);\n }, this);\n this.render();\n },\n eachPoints: function eachPoints(callback) {\n helpers.each(this.datasets, function (dataset) {\n helpers.each(dataset.points, callback, this);\n }, this);\n },\n getPointsAtEvent: function getPointsAtEvent(evt) {\n var mousePosition = helpers.getRelativePosition(evt),\n fromCenter = helpers.getAngleFromPoint({\n x: this.scale.xCenter,\n y: this.scale.yCenter\n }, mousePosition);\n var anglePerIndex = Math.PI * 2 / this.scale.valuesCount,\n pointIndex = Math.round((fromCenter.angle - Math.PI * 1.5) / anglePerIndex),\n activePointsCollection = []; // If we're at the top, make the pointIndex 0 to get the first of the array.\n\n if (pointIndex >= this.scale.valuesCount || pointIndex < 0) {\n pointIndex = 0;\n }\n\n if (fromCenter.distance <= this.scale.drawingArea) {\n helpers.each(this.datasets, function (dataset) {\n activePointsCollection.push(dataset.points[pointIndex]);\n });\n }\n\n return activePointsCollection;\n },\n buildScale: function buildScale(data) {\n this.scale = new Chart.RadialScale({\n display: this.options.showScale,\n fontStyle: this.options.scaleFontStyle,\n fontSize: this.options.scaleFontSize,\n fontFamily: this.options.scaleFontFamily,\n fontColor: this.options.scaleFontColor,\n showLabels: this.options.scaleShowLabels,\n showLabelBackdrop: this.options.scaleShowLabelBackdrop,\n backdropColor: this.options.scaleBackdropColor,\n backgroundColors: this.options.scaleBackgroundColors,\n backdropPaddingY: this.options.scaleBackdropPaddingY,\n backdropPaddingX: this.options.scaleBackdropPaddingX,\n lineWidth: this.options.scaleShowLine ? this.options.scaleLineWidth : 0,\n lineColor: this.options.scaleLineColor,\n angleLineColor: this.options.angleLineColor,\n angleLineWidth: this.options.angleShowLineOut ? this.options.angleLineWidth : 0,\n angleLineInterval: this.options.angleLineInterval ? this.options.angleLineInterval : 1,\n // Point labels at the edge of each line\n pointLabelFontColor: this.options.pointLabelFontColor,\n pointLabelFontSize: this.options.pointLabelFontSize,\n pointLabelFontFamily: this.options.pointLabelFontFamily,\n pointLabelFontStyle: this.options.pointLabelFontStyle,\n height: this.chart.height,\n width: this.chart.width,\n xCenter: this.chart.width / 2,\n yCenter: this.chart.height / 2,\n ctx: this.chart.ctx,\n templateString: this.options.scaleLabel,\n labels: data.labels,\n valuesCount: data.datasets[0].data.length\n });\n this.scale.setScaleSize();\n this.updateScaleRange(data.datasets);\n this.scale.buildYLabels();\n },\n updateScaleRange: function updateScaleRange(datasets) {\n var valuesArray = function () {\n var totalDataArray = [];\n helpers.each(datasets, function (dataset) {\n if (dataset.data) {\n totalDataArray = totalDataArray.concat(dataset.data);\n } else {\n helpers.each(dataset.points, function (point) {\n totalDataArray.push(point.value);\n });\n }\n });\n return totalDataArray;\n }();\n\n var scaleSizes = this.options.scaleOverride ? {\n steps: this.options.scaleSteps,\n stepValue: this.options.scaleStepWidth,\n min: this.options.scaleStartValue,\n max: this.options.scaleStartValue + this.options.scaleSteps * this.options.scaleStepWidth\n } : helpers.calculateScaleRange(valuesArray, helpers.min([this.chart.width, this.chart.height]) / 2, this.options.scaleFontSize, this.options.scaleBeginAtZero, this.options.scaleIntegersOnly);\n helpers.extend(this.scale, scaleSizes);\n },\n addData: function addData(valuesArray, label) {\n //Map the values array for each of the datasets\n this.scale.valuesCount++;\n helpers.each(valuesArray, function (value, datasetIndex) {\n var pointPosition = this.scale.getPointPosition(this.scale.valuesCount, this.scale.calculateCenterOffset(value));\n this.datasets[datasetIndex].points.push(new this.PointClass({\n value: value,\n label: label,\n datasetLabel: this.datasets[datasetIndex].label,\n x: pointPosition.x,\n y: pointPosition.y,\n strokeColor: this.datasets[datasetIndex].pointStrokeColor,\n fillColor: this.datasets[datasetIndex].pointColor\n }));\n }, this);\n this.scale.labels.push(label);\n this.reflow();\n this.update();\n },\n removeData: function removeData() {\n this.scale.valuesCount--;\n this.scale.labels.shift();\n helpers.each(this.datasets, function (dataset) {\n dataset.points.shift();\n }, this);\n this.reflow();\n this.update();\n },\n update: function update() {\n this.eachPoints(function (point) {\n point.save();\n });\n this.reflow();\n this.render();\n },\n reflow: function reflow() {\n helpers.extend(this.scale, {\n width: this.chart.width,\n height: this.chart.height,\n size: helpers.min([this.chart.width, this.chart.height]),\n xCenter: this.chart.width / 2,\n yCenter: this.chart.height / 2\n });\n this.updateScaleRange(this.datasets);\n this.scale.setScaleSize();\n this.scale.buildYLabels();\n },\n draw: function draw(ease) {\n var easeDecimal = ease || 1,\n ctx = this.chart.ctx;\n this.clear();\n this.scale.draw();\n helpers.each(this.datasets, function (dataset) {\n //Transition each point first so that the line and point drawing isn't out of sync\n helpers.each(dataset.points, function (point, index) {\n if (point.hasValue()) {\n point.transition(this.scale.getPointPosition(index, this.scale.calculateCenterOffset(point.value)), easeDecimal);\n }\n }, this); //Draw the line between all the points\n\n ctx.lineWidth = this.options.datasetStrokeWidth;\n ctx.strokeStyle = dataset.strokeColor;\n ctx.beginPath();\n helpers.each(dataset.points, function (point, index) {\n if (index === 0) {\n ctx.moveTo(point.x, point.y);\n } else {\n ctx.lineTo(point.x, point.y);\n }\n }, this);\n ctx.closePath();\n ctx.stroke();\n ctx.fillStyle = dataset.fillColor;\n\n if (this.options.datasetFill) {\n ctx.fill();\n } //Now draw the points over the line\n //A little inefficient double looping, but better than the line\n //lagging behind the point positions\n\n\n helpers.each(dataset.points, function (point) {\n if (point.hasValue()) {\n point.draw();\n }\n });\n }, this);\n }\n });\n}).call(this);","/**\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 *\n */\n'use strict';\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nvar _assign = require('object-assign'); // -- Inlined from fbjs --\n\n\nvar emptyObject = {};\n\nif (process.env.NODE_ENV !== 'production') {\n Object.freeze(emptyObject);\n}\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction _invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n\n throw error;\n }\n}\n\nvar warning = function warning() {};\n\nif (process.env.NODE_ENV !== 'production') {\n var printWarning = function printWarning(format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n warning = function warning(condition, format) {\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.indexOf('Failed Composite propType: ') === 0) {\n return; // Ignore CompositeComponent proptype check.\n }\n\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n} // /-- Inlined from fbjs --\n\n\nvar MIXINS_KEY = 'mixins'; // Helper function to allow the creation of anonymous functions which do not\n// have .name set to the name of the variable being assigned to.\n\nfunction identity(fn) {\n return fn;\n}\n\nvar ReactPropTypeLocationNames;\n\nif (process.env.NODE_ENV !== 'production') {\n ReactPropTypeLocationNames = {\n prop: 'prop',\n context: 'context',\n childContext: 'child context'\n };\n} else {\n ReactPropTypeLocationNames = {};\n}\n\nfunction factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {\n /**\n * Policies that describe methods in `ReactClassInterface`.\n */\n var injectedMixins = [];\n /**\n * Composite components are higher-level components that compose other composite\n * or host components.\n *\n * To create a new type of `ReactClass`, pass a specification of\n * your new class to `React.createClass`. The only requirement of your class\n * specification is that you implement a `render` method.\n *\n * var MyComponent = React.createClass({\n * render: function() {\n * return
Hello World
;\n * }\n * });\n *\n * The class specification supports a specific protocol of methods that have\n * special meaning (e.g. `render`). See `ReactClassInterface` for\n * more the comprehensive protocol. Any other properties and methods in the\n * class specification will be available on the prototype.\n *\n * @interface ReactClassInterface\n * @internal\n */\n\n var ReactClassInterface = {\n /**\n * An array of Mixin objects to include when defining your component.\n *\n * @type {array}\n * @optional\n */\n mixins: 'DEFINE_MANY',\n\n /**\n * An object containing properties and methods that should be defined on\n * the component's constructor instead of its prototype (static methods).\n *\n * @type {object}\n * @optional\n */\n statics: 'DEFINE_MANY',\n\n /**\n * Definition of prop types for this component.\n *\n * @type {object}\n * @optional\n */\n propTypes: 'DEFINE_MANY',\n\n /**\n * Definition of context types for this component.\n *\n * @type {object}\n * @optional\n */\n contextTypes: 'DEFINE_MANY',\n\n /**\n * Definition of context types this component sets for its children.\n *\n * @type {object}\n * @optional\n */\n childContextTypes: 'DEFINE_MANY',\n // ==== Definition methods ====\n\n /**\n * Invoked when the component is mounted. Values in the mapping will be set on\n * `this.props` if that prop is not specified (i.e. using an `in` check).\n *\n * This method is invoked before `getInitialState` and therefore cannot rely\n * on `this.state` or use `this.setState`.\n *\n * @return {object}\n * @optional\n */\n getDefaultProps: 'DEFINE_MANY_MERGED',\n\n /**\n * Invoked once before the component is mounted. The return value will be used\n * as the initial value of `this.state`.\n *\n * getInitialState: function() {\n * return {\n * isOn: false,\n * fooBaz: new BazFoo()\n * }\n * }\n *\n * @return {object}\n * @optional\n */\n getInitialState: 'DEFINE_MANY_MERGED',\n\n /**\n * @return {object}\n * @optional\n */\n getChildContext: 'DEFINE_MANY_MERGED',\n\n /**\n * Uses props from `this.props` and state from `this.state` to render the\n * structure of the component.\n *\n * No guarantees are made about when or how often this method is invoked, so\n * it must not have side effects.\n *\n * render: function() {\n * var name = this.props.name;\n * return
Hello, {name}!
;\n * }\n *\n * @return {ReactComponent}\n * @required\n */\n render: 'DEFINE_ONCE',\n // ==== Delegate methods ====\n\n /**\n * Invoked when the component is initially created and about to be mounted.\n * This may have side effects, but any external subscriptions or data created\n * by this method must be cleaned up in `componentWillUnmount`.\n *\n * @optional\n */\n componentWillMount: 'DEFINE_MANY',\n\n /**\n * Invoked when the component has been mounted and has a DOM representation.\n * However, there is no guarantee that the DOM node is in the document.\n *\n * Use this as an opportunity to operate on the DOM when the component has\n * been mounted (initialized and rendered) for the first time.\n *\n * @param {DOMElement} rootNode DOM element representing the component.\n * @optional\n */\n componentDidMount: 'DEFINE_MANY',\n\n /**\n * Invoked before the component receives new props.\n *\n * Use this as an opportunity to react to a prop transition by updating the\n * state using `this.setState`. Current props are accessed via `this.props`.\n *\n * componentWillReceiveProps: function(nextProps, nextContext) {\n * this.setState({\n * likesIncreasing: nextProps.likeCount > this.props.likeCount\n * });\n * }\n *\n * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop\n * transition may cause a state change, but the opposite is not true. If you\n * need it, you are probably looking for `componentWillUpdate`.\n *\n * @param {object} nextProps\n * @optional\n */\n componentWillReceiveProps: 'DEFINE_MANY',\n\n /**\n * Invoked while deciding if the component should be updated as a result of\n * receiving new props, state and/or context.\n *\n * Use this as an opportunity to `return false` when you're certain that the\n * transition to the new props/state/context will not require a component\n * update.\n *\n * shouldComponentUpdate: function(nextProps, nextState, nextContext) {\n * return !equal(nextProps, this.props) ||\n * !equal(nextState, this.state) ||\n * !equal(nextContext, this.context);\n * }\n *\n * @param {object} nextProps\n * @param {?object} nextState\n * @param {?object} nextContext\n * @return {boolean} True if the component should update.\n * @optional\n */\n shouldComponentUpdate: 'DEFINE_ONCE',\n\n /**\n * Invoked when the component is about to update due to a transition from\n * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`\n * and `nextContext`.\n *\n * Use this as an opportunity to perform preparation before an update occurs.\n *\n * NOTE: You **cannot** use `this.setState()` in this method.\n *\n * @param {object} nextProps\n * @param {?object} nextState\n * @param {?object} nextContext\n * @param {ReactReconcileTransaction} transaction\n * @optional\n */\n componentWillUpdate: 'DEFINE_MANY',\n\n /**\n * Invoked when the component's DOM representation has been updated.\n *\n * Use this as an opportunity to operate on the DOM when the component has\n * been updated.\n *\n * @param {object} prevProps\n * @param {?object} prevState\n * @param {?object} prevContext\n * @param {DOMElement} rootNode DOM element representing the component.\n * @optional\n */\n componentDidUpdate: 'DEFINE_MANY',\n\n /**\n * Invoked when the component is about to be removed from its parent and have\n * its DOM representation destroyed.\n *\n * Use this as an opportunity to deallocate any external resources.\n *\n * NOTE: There is no `componentDidUnmount` since your component will have been\n * destroyed by that point.\n *\n * @optional\n */\n componentWillUnmount: 'DEFINE_MANY',\n\n /**\n * Replacement for (deprecated) `componentWillMount`.\n *\n * @optional\n */\n UNSAFE_componentWillMount: 'DEFINE_MANY',\n\n /**\n * Replacement for (deprecated) `componentWillReceiveProps`.\n *\n * @optional\n */\n UNSAFE_componentWillReceiveProps: 'DEFINE_MANY',\n\n /**\n * Replacement for (deprecated) `componentWillUpdate`.\n *\n * @optional\n */\n UNSAFE_componentWillUpdate: 'DEFINE_MANY',\n // ==== Advanced methods ====\n\n /**\n * Updates the component's currently mounted DOM representation.\n *\n * By default, this implements React's rendering and reconciliation algorithm.\n * Sophisticated clients may wish to override this.\n *\n * @param {ReactReconcileTransaction} transaction\n * @internal\n * @overridable\n */\n updateComponent: 'OVERRIDE_BASE'\n };\n /**\n * Similar to ReactClassInterface but for static methods.\n */\n\n var ReactClassStaticInterface = {\n /**\n * This method is invoked after a component is instantiated and when it\n * receives new props. Return an object to update state in response to\n * prop changes. Return null to indicate no change to state.\n *\n * If an object is returned, its keys will be merged into the existing state.\n *\n * @return {object || null}\n * @optional\n */\n getDerivedStateFromProps: 'DEFINE_MANY_MERGED'\n };\n /**\n * Mapping from class specification keys to special processing functions.\n *\n * Although these are declared like instance properties in the specification\n * when defining classes using `React.createClass`, they are actually static\n * and are accessible on the constructor instead of the prototype. Despite\n * being static, they must be defined outside of the \"statics\" key under\n * which all other static methods are defined.\n */\n\n var RESERVED_SPEC_KEYS = {\n displayName: function displayName(Constructor, _displayName) {\n Constructor.displayName = _displayName;\n },\n mixins: function mixins(Constructor, _mixins) {\n if (_mixins) {\n for (var i = 0; i < _mixins.length; i++) {\n mixSpecIntoComponent(Constructor, _mixins[i]);\n }\n }\n },\n childContextTypes: function childContextTypes(Constructor, _childContextTypes) {\n if (process.env.NODE_ENV !== 'production') {\n validateTypeDef(Constructor, _childContextTypes, 'childContext');\n }\n\n Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, _childContextTypes);\n },\n contextTypes: function contextTypes(Constructor, _contextTypes) {\n if (process.env.NODE_ENV !== 'production') {\n validateTypeDef(Constructor, _contextTypes, 'context');\n }\n\n Constructor.contextTypes = _assign({}, Constructor.contextTypes, _contextTypes);\n },\n\n /**\n * Special case getDefaultProps which should move into statics but requires\n * automatic merging.\n */\n getDefaultProps: function getDefaultProps(Constructor, _getDefaultProps) {\n if (Constructor.getDefaultProps) {\n Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, _getDefaultProps);\n } else {\n Constructor.getDefaultProps = _getDefaultProps;\n }\n },\n propTypes: function propTypes(Constructor, _propTypes) {\n if (process.env.NODE_ENV !== 'production') {\n validateTypeDef(Constructor, _propTypes, 'prop');\n }\n\n Constructor.propTypes = _assign({}, Constructor.propTypes, _propTypes);\n },\n statics: function statics(Constructor, _statics) {\n mixStaticSpecIntoComponent(Constructor, _statics);\n },\n autobind: function autobind() {}\n };\n\n function validateTypeDef(Constructor, typeDef, location) {\n for (var propName in typeDef) {\n if (typeDef.hasOwnProperty(propName)) {\n // use a warning instead of an _invariant so components\n // don't show up in prod but only in __DEV__\n if (process.env.NODE_ENV !== 'production') {\n warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName);\n }\n }\n }\n }\n\n function validateMethodOverride(isAlreadyDefined, name) {\n var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null; // Disallow overriding of base class methods unless explicitly allowed.\n\n if (ReactClassMixin.hasOwnProperty(name)) {\n _invariant(specPolicy === 'OVERRIDE_BASE', 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name);\n } // Disallow defining methods more than once unless explicitly allowed.\n\n\n if (isAlreadyDefined) {\n _invariant(specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name);\n }\n }\n /**\n * Mixin helper which handles policy validation and reserved\n * specification keys when building React classes.\n */\n\n\n function mixSpecIntoComponent(Constructor, spec) {\n if (!spec) {\n if (process.env.NODE_ENV !== 'production') {\n var typeofSpec = _typeof(spec);\n\n var isMixinValid = typeofSpec === 'object' && spec !== null;\n\n if (process.env.NODE_ENV !== 'production') {\n warning(isMixinValid, \"%s: You're attempting to include a mixin that is either null \" + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec);\n }\n }\n\n return;\n }\n\n _invariant(typeof spec !== 'function', \"ReactClass: You're attempting to \" + 'use a component class or function as a mixin. Instead, just use a ' + 'regular object.');\n\n _invariant(!isValidElement(spec), \"ReactClass: You're attempting to \" + 'use a component as a mixin. Instead, just use a regular object.');\n\n var proto = Constructor.prototype;\n var autoBindPairs = proto.__reactAutoBindPairs; // By handling mixins before any other properties, we ensure the same\n // chaining order is applied to methods with DEFINE_MANY policy, whether\n // mixins are listed before or after these methods in the spec.\n\n if (spec.hasOwnProperty(MIXINS_KEY)) {\n RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);\n }\n\n for (var name in spec) {\n if (!spec.hasOwnProperty(name)) {\n continue;\n }\n\n if (name === MIXINS_KEY) {\n // We have already handled mixins in a special case above.\n continue;\n }\n\n var property = spec[name];\n var isAlreadyDefined = proto.hasOwnProperty(name);\n validateMethodOverride(isAlreadyDefined, name);\n\n if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {\n RESERVED_SPEC_KEYS[name](Constructor, property);\n } else {\n // Setup methods on prototype:\n // The following member methods should not be automatically bound:\n // 1. Expected ReactClass methods (in the \"interface\").\n // 2. Overridden methods (that were mixed in).\n var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);\n var isFunction = typeof property === 'function';\n var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;\n\n if (shouldAutoBind) {\n autoBindPairs.push(name, property);\n proto[name] = property;\n } else {\n if (isAlreadyDefined) {\n var specPolicy = ReactClassInterface[name]; // These cases should already be caught by validateMethodOverride.\n\n _invariant(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY'), 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name); // For methods which are defined more than once, call the existing\n // methods before calling the new property, merging if appropriate.\n\n\n if (specPolicy === 'DEFINE_MANY_MERGED') {\n proto[name] = createMergedResultFunction(proto[name], property);\n } else if (specPolicy === 'DEFINE_MANY') {\n proto[name] = createChainedFunction(proto[name], property);\n }\n } else {\n proto[name] = property;\n\n if (process.env.NODE_ENV !== 'production') {\n // Add verbose displayName to the function, which helps when looking\n // at profiling tools.\n if (typeof property === 'function' && spec.displayName) {\n proto[name].displayName = spec.displayName + '_' + name;\n }\n }\n }\n }\n }\n }\n }\n\n function mixStaticSpecIntoComponent(Constructor, statics) {\n if (!statics) {\n return;\n }\n\n for (var name in statics) {\n var property = statics[name];\n\n if (!statics.hasOwnProperty(name)) {\n continue;\n }\n\n var isReserved = (name in RESERVED_SPEC_KEYS);\n\n _invariant(!isReserved, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\\'t be on the \"statics\" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name);\n\n var isAlreadyDefined = (name in Constructor);\n\n if (isAlreadyDefined) {\n var specPolicy = ReactClassStaticInterface.hasOwnProperty(name) ? ReactClassStaticInterface[name] : null;\n\n _invariant(specPolicy === 'DEFINE_MANY_MERGED', 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name);\n\n Constructor[name] = createMergedResultFunction(Constructor[name], property);\n return;\n }\n\n Constructor[name] = property;\n }\n }\n /**\n * Merge two objects, but throw if both contain the same key.\n *\n * @param {object} one The first object, which is mutated.\n * @param {object} two The second object\n * @return {object} one after it has been mutated to contain everything in two.\n */\n\n\n function mergeIntoWithNoDuplicateKeys(one, two) {\n _invariant(one && two && _typeof(one) === 'object' && _typeof(two) === 'object', 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.');\n\n for (var key in two) {\n if (two.hasOwnProperty(key)) {\n _invariant(one[key] === undefined, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key);\n\n one[key] = two[key];\n }\n }\n\n return one;\n }\n /**\n * Creates a function that invokes two functions and merges their return values.\n *\n * @param {function} one Function to invoke first.\n * @param {function} two Function to invoke second.\n * @return {function} Function that invokes the two argument functions.\n * @private\n */\n\n\n function createMergedResultFunction(one, two) {\n return function mergedResult() {\n var a = one.apply(this, arguments);\n var b = two.apply(this, arguments);\n\n if (a == null) {\n return b;\n } else if (b == null) {\n return a;\n }\n\n var c = {};\n mergeIntoWithNoDuplicateKeys(c, a);\n mergeIntoWithNoDuplicateKeys(c, b);\n return c;\n };\n }\n /**\n * Creates a function that invokes two functions and ignores their return vales.\n *\n * @param {function} one Function to invoke first.\n * @param {function} two Function to invoke second.\n * @return {function} Function that invokes the two argument functions.\n * @private\n */\n\n\n function createChainedFunction(one, two) {\n return function chainedFunction() {\n one.apply(this, arguments);\n two.apply(this, arguments);\n };\n }\n /**\n * Binds a method to the component.\n *\n * @param {object} component Component whose method is going to be bound.\n * @param {function} method Method to be bound.\n * @return {function} The bound method.\n */\n\n\n function bindAutoBindMethod(component, method) {\n var boundMethod = method.bind(component);\n\n if (process.env.NODE_ENV !== 'production') {\n boundMethod.__reactBoundContext = component;\n boundMethod.__reactBoundMethod = method;\n boundMethod.__reactBoundArguments = null;\n var componentName = component.constructor.displayName;\n var _bind = boundMethod.bind;\n\n boundMethod.bind = function (newThis) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n } // User is trying to bind() an autobound method; we effectively will\n // ignore the value of \"this\" that the user is trying to use, so\n // let's warn.\n\n\n if (newThis !== component && newThis !== null) {\n if (process.env.NODE_ENV !== 'production') {\n warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName);\n }\n } else if (!args.length) {\n if (process.env.NODE_ENV !== 'production') {\n warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName);\n }\n\n return boundMethod;\n }\n\n var reboundMethod = _bind.apply(boundMethod, arguments);\n\n reboundMethod.__reactBoundContext = component;\n reboundMethod.__reactBoundMethod = method;\n reboundMethod.__reactBoundArguments = args;\n return reboundMethod;\n };\n }\n\n return boundMethod;\n }\n /**\n * Binds all auto-bound methods in a component.\n *\n * @param {object} component Component whose method is going to be bound.\n */\n\n\n function bindAutoBindMethods(component) {\n var pairs = component.__reactAutoBindPairs;\n\n for (var i = 0; i < pairs.length; i += 2) {\n var autoBindKey = pairs[i];\n var method = pairs[i + 1];\n component[autoBindKey] = bindAutoBindMethod(component, method);\n }\n }\n\n var IsMountedPreMixin = {\n componentDidMount: function componentDidMount() {\n this.__isMounted = true;\n }\n };\n var IsMountedPostMixin = {\n componentWillUnmount: function componentWillUnmount() {\n this.__isMounted = false;\n }\n };\n /**\n * Add more to the ReactClass base class. These are all legacy features and\n * therefore not already part of the modern ReactComponent.\n */\n\n var ReactClassMixin = {\n /**\n * TODO: This will be deprecated because state should always keep a consistent\n * type signature and the only use case for this, is to avoid that.\n */\n replaceState: function replaceState(newState, callback) {\n this.updater.enqueueReplaceState(this, newState, callback);\n },\n\n /**\n * Checks whether or not this composite component is mounted.\n * @return {boolean} True if mounted, false otherwise.\n * @protected\n * @final\n */\n isMounted: function isMounted() {\n if (process.env.NODE_ENV !== 'production') {\n warning(this.__didWarnIsMounted, '%s: isMounted is deprecated. Instead, make sure to clean up ' + 'subscriptions and pending requests in componentWillUnmount to ' + 'prevent memory leaks.', this.constructor && this.constructor.displayName || this.name || 'Component');\n this.__didWarnIsMounted = true;\n }\n\n return !!this.__isMounted;\n }\n };\n\n var ReactClassComponent = function ReactClassComponent() {};\n\n _assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);\n /**\n * Creates a composite component class given a class specification.\n * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass\n *\n * @param {object} spec Class specification (which must define `render`).\n * @return {function} Component constructor function.\n * @public\n */\n\n\n function createClass(spec) {\n // To keep our warnings more understandable, we'll use a little hack here to\n // ensure that Constructor.name !== 'Constructor'. This makes sure we don't\n // unnecessarily identify a class without displayName as 'Constructor'.\n var Constructor = identity(function (props, context, updater) {\n // This constructor gets overridden by mocks. The argument is used\n // by mocks to assert on what gets mounted.\n if (process.env.NODE_ENV !== 'production') {\n warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory');\n } // Wire up auto-binding\n\n\n if (this.__reactAutoBindPairs.length) {\n bindAutoBindMethods(this);\n }\n\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n this.state = null; // ReactClasses doesn't have constructors. Instead, they use the\n // getInitialState and componentWillMount methods for initialization.\n\n var initialState = this.getInitialState ? this.getInitialState() : null;\n\n if (process.env.NODE_ENV !== 'production') {\n // We allow auto-mocks to proceed as if they're returning null.\n if (initialState === undefined && this.getInitialState._isMockFunction) {\n // This is probably bad practice. Consider warning here and\n // deprecating this convenience.\n initialState = null;\n }\n }\n\n _invariant(_typeof(initialState) === 'object' && !Array.isArray(initialState), '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent');\n\n this.state = initialState;\n });\n Constructor.prototype = new ReactClassComponent();\n Constructor.prototype.constructor = Constructor;\n Constructor.prototype.__reactAutoBindPairs = [];\n injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));\n mixSpecIntoComponent(Constructor, IsMountedPreMixin);\n mixSpecIntoComponent(Constructor, spec);\n mixSpecIntoComponent(Constructor, IsMountedPostMixin); // Initialize the defaultProps property after all mixins have been merged.\n\n if (Constructor.getDefaultProps) {\n Constructor.defaultProps = Constructor.getDefaultProps();\n }\n\n if (process.env.NODE_ENV !== 'production') {\n // This is a tag to indicate that the use of these method names is ok,\n // since it's used with createClass. If it's not, then it's likely a\n // mistake so we'll warn you to use the static property, property\n // initializer or constructor respectively.\n if (Constructor.getDefaultProps) {\n Constructor.getDefaultProps.isReactClassApproved = {};\n }\n\n if (Constructor.prototype.getInitialState) {\n Constructor.prototype.getInitialState.isReactClassApproved = {};\n }\n }\n\n _invariant(Constructor.prototype.render, 'createClass(...): Class specification must implement a `render` method.');\n\n if (process.env.NODE_ENV !== 'production') {\n warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component');\n warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component');\n warning(!Constructor.prototype.UNSAFE_componentWillRecieveProps, '%s has a method called UNSAFE_componentWillRecieveProps(). ' + 'Did you mean UNSAFE_componentWillReceiveProps()?', spec.displayName || 'A component');\n } // Reduce time spent doing lookups by setting these on the prototype.\n\n\n for (var methodName in ReactClassInterface) {\n if (!Constructor.prototype[methodName]) {\n Constructor.prototype[methodName] = null;\n }\n }\n\n return Constructor;\n }\n\n return createClass;\n}\n\nmodule.exports = factory;","/**\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 *\n */\n'use strict';\n\nvar React = require('react');\n\nvar factory = require('./factory');\n\nif (typeof React === 'undefined') {\n throw Error('create-react-class could not find the React object. If you are using script tags, ' + 'make sure that React is being loaded before create-react-class.');\n} // Hack to grab NoopUpdateQueue from isomorphic React\n\n\nvar ReactNoopUpdateQueue = new React.Component().updater;\nmodule.exports = factory(React.Component, React.isValidElement, ReactNoopUpdateQueue);","module.exports = require('./lib/dom-scroll-into-view');","var util = require('./util');\n\nfunction scrollIntoView(elem, container, config) {\n config = config || {}; // document 归一化到 window\n\n if (container.nodeType === 9) {\n container = util.getWindow(container);\n }\n\n var allowHorizontalScroll = config.allowHorizontalScroll;\n var onlyScrollIfNeeded = config.onlyScrollIfNeeded;\n var alignWithTop = config.alignWithTop;\n var alignWithLeft = config.alignWithLeft;\n allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll;\n var isWin = util.isWindow(container);\n var elemOffset = util.offset(elem);\n var eh = util.outerHeight(elem);\n var ew = util.outerWidth(elem);\n var containerOffset, ch, cw, containerScroll, diffTop, diffBottom, win, winScroll, ww, wh;\n\n if (isWin) {\n win = container;\n wh = util.height(win);\n ww = util.width(win);\n winScroll = {\n left: util.scrollLeft(win),\n top: util.scrollTop(win)\n }; // elem 相对 container 可视视窗的距离\n\n diffTop = {\n left: elemOffset.left - winScroll.left,\n top: elemOffset.top - winScroll.top\n };\n diffBottom = {\n left: elemOffset.left + ew - (winScroll.left + ww),\n top: elemOffset.top + eh - (winScroll.top + wh)\n };\n containerScroll = winScroll;\n } else {\n containerOffset = util.offset(container);\n ch = container.clientHeight;\n cw = container.clientWidth;\n containerScroll = {\n left: container.scrollLeft,\n top: container.scrollTop\n }; // elem 相对 container 可视视窗的距离\n // 注意边框, offset 是边框到根节点\n\n diffTop = {\n left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)),\n top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0))\n };\n diffBottom = {\n left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)),\n top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0))\n };\n }\n\n if (diffTop.top < 0 || diffBottom.top > 0) {\n // 强制向上\n if (alignWithTop === true) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else if (alignWithTop === false) {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n } else {\n // 自动调整\n if (diffTop.top < 0) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n }\n }\n } else {\n if (!onlyScrollIfNeeded) {\n alignWithTop = alignWithTop === undefined ? true : !!alignWithTop;\n\n if (alignWithTop) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n }\n }\n }\n\n if (allowHorizontalScroll) {\n if (diffTop.left < 0 || diffBottom.left > 0) {\n // 强制向上\n if (alignWithLeft === true) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else if (alignWithLeft === false) {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n } else {\n // 自动调整\n if (diffTop.left < 0) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n }\n }\n } else {\n if (!onlyScrollIfNeeded) {\n alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft;\n\n if (alignWithLeft) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n }\n }\n }\n }\n}\n\nmodule.exports = scrollIntoView;","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nvar RE_NUM = /[\\-+]?(?:\\d*\\.|)\\d+(?:[eE][\\-+]?\\d+|)/.source;\n\nfunction getClientPosition(elem) {\n var box, x, y;\n var doc = elem.ownerDocument;\n var body = doc.body;\n var docElem = doc && doc.documentElement; // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式\n\n box = elem.getBoundingClientRect(); // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop\n // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确\n // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin\n\n x = box.left;\n y = box.top; // In IE, most of the time, 2 extra pixels are added to the top and left\n // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and\n // IE6 standards mode, this border can be overridden by setting the\n // document element's border to zero -- thus, we cannot rely on the\n // offset always being 2 pixels.\n // In quirks mode, the offset can be determined by querying the body's\n // clientLeft/clientTop, but in standards mode, it is found by querying\n // the document element's clientLeft/clientTop. Since we already called\n // getClientBoundingRect we have already forced a reflow, so it is not\n // too expensive just to query them all.\n // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的\n // 窗口边框标准是设 documentElement ,quirks 时设置 body\n // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去\n // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置\n // 标准 ie 下 docElem.clientTop 就是 border-top\n // ie7 html 即窗口边框改变不了。永远为 2\n // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0\n\n x -= docElem.clientLeft || body.clientLeft || 0;\n y -= docElem.clientTop || body.clientTop || 0;\n return {\n left: x,\n top: y\n };\n}\n\nfunction getScroll(w, top) {\n var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];\n var method = 'scroll' + (top ? 'Top' : 'Left');\n\n if (typeof ret !== 'number') {\n var d = w.document; //ie6,7,8 standard mode\n\n ret = d.documentElement[method];\n\n if (typeof ret !== 'number') {\n //quirks mode\n ret = d.body[method];\n }\n }\n\n return ret;\n}\n\nfunction getScrollLeft(w) {\n return getScroll(w);\n}\n\nfunction getScrollTop(w) {\n return getScroll(w, true);\n}\n\nfunction getOffset(el) {\n var pos = getClientPosition(el);\n var doc = el.ownerDocument;\n var w = doc.defaultView || doc.parentWindow;\n pos.left += getScrollLeft(w);\n pos.top += getScrollTop(w);\n return pos;\n}\n\nfunction _getComputedStyle(elem, name, computedStyle) {\n var val = '';\n var d = elem.ownerDocument; // https://github.com/kissyteam/kissy/issues/61\n\n if (computedStyle = computedStyle || d.defaultView.getComputedStyle(elem, null)) {\n val = computedStyle.getPropertyValue(name) || computedStyle[name];\n }\n\n return val;\n}\n\nvar _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');\n\nvar RE_POS = /^(top|right|bottom|left)$/,\n CURRENT_STYLE = 'currentStyle',\n RUNTIME_STYLE = 'runtimeStyle',\n LEFT = 'left',\n PX = 'px';\n\nfunction _getComputedStyleIE(elem, name) {\n // currentStyle maybe null\n // http://msdn.microsoft.com/en-us/library/ms535231.aspx\n var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name]; // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值\n // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19\n // 在 ie 下不对,需要直接用 offset 方式\n // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了\n // From the awesome hack by Dean Edwards\n // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291\n // If we're not dealing with a regular pixel number\n // but a number that has a weird ending, we need to convert it to pixels\n // exclude left right for relativity\n\n if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {\n // Remember the original values\n var style = elem.style,\n left = style[LEFT],\n rsLeft = elem[RUNTIME_STYLE][LEFT]; // prevent flashing of content\n\n elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT]; // Put in the new values to get a computed value out\n\n style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;\n ret = style.pixelLeft + PX; // Revert the changed values\n\n style[LEFT] = left;\n elem[RUNTIME_STYLE][LEFT] = rsLeft;\n }\n\n return ret === '' ? 'auto' : ret;\n}\n\nvar getComputedStyleX;\n\nif (typeof window !== 'undefined') {\n getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;\n} // 设置 elem 相对 elem.ownerDocument 的坐标\n\n\nfunction setOffset(elem, offset) {\n // set position first, in-case top/left are set even on static elem\n if (css(elem, 'position') === 'static') {\n elem.style.position = 'relative';\n }\n\n var old = getOffset(elem),\n ret = {},\n current,\n key;\n\n for (key in offset) {\n current = parseFloat(css(elem, key)) || 0;\n ret[key] = current + offset[key] - old[key];\n }\n\n css(elem, ret);\n}\n\nfunction each(arr, fn) {\n for (var i = 0; i < arr.length; i++) {\n fn(arr[i]);\n }\n}\n\nfunction isBorderBoxFn(elem) {\n return getComputedStyleX(elem, 'boxSizing') === 'border-box';\n}\n\nvar BOX_MODELS = ['margin', 'border', 'padding'],\n CONTENT_INDEX = -1,\n PADDING_INDEX = 2,\n BORDER_INDEX = 1,\n MARGIN_INDEX = 0;\n\nfunction swap(elem, options, callback) {\n var old = {},\n style = elem.style,\n name; // Remember the old values, and insert the new ones\n\n for (name in options) {\n old[name] = style[name];\n style[name] = options[name];\n }\n\n callback.call(elem); // Revert the old values\n\n for (name in options) {\n style[name] = old[name];\n }\n}\n\nfunction getPBMWidth(elem, props, which) {\n var value = 0,\n prop,\n j,\n i;\n\n for (j = 0; j < props.length; j++) {\n prop = props[j];\n\n if (prop) {\n for (i = 0; i < which.length; i++) {\n var cssProp;\n\n if (prop === 'border') {\n cssProp = prop + which[i] + 'Width';\n } else {\n cssProp = prop + which[i];\n }\n\n value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;\n }\n }\n }\n\n return value;\n}\n/**\n * A crude way of determining if an object is a window\n * @member util\n */\n\n\nfunction isWindow(obj) {\n // must use == for ie8\n\n /*jshint eqeqeq:false*/\n return obj != null && obj == obj.window;\n}\n\nvar domUtils = {};\neach(['Width', 'Height'], function (name) {\n domUtils['doc' + name] = function (refWin) {\n var d = refWin.document;\n return Math.max( //firefox chrome documentElement.scrollHeight< body.scrollHeight\n //ie standard mode : documentElement.scrollHeight> body.scrollHeight\n d.documentElement['scroll' + name], //quirks : documentElement.scrollHeight 最大等于可视窗口多一点?\n d.body['scroll' + name], domUtils['viewport' + name](d));\n };\n\n domUtils['viewport' + name] = function (win) {\n // pc browser includes scrollbar in window.innerWidth\n var prop = 'client' + name,\n doc = win.document,\n body = doc.body,\n documentElement = doc.documentElement,\n documentElementProp = documentElement[prop]; // 标准模式取 documentElement\n // backcompat 取 body\n\n return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;\n };\n});\n/*\n 得到元素的大小信息\n @param elem\n @param name\n @param {String} [extra] 'padding' : (css width) + padding\n 'border' : (css width) + padding + border\n 'margin' : (css width) + padding + border + margin\n */\n\nfunction getWH(elem, name, extra) {\n if (isWindow(elem)) {\n return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);\n } else if (elem.nodeType === 9) {\n return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);\n }\n\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'],\n borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight;\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem, computedStyle);\n var cssBoxValue = 0;\n\n if (borderBoxValue == null || borderBoxValue <= 0) {\n borderBoxValue = undefined; // Fall back to computed then un computed css if necessary\n\n cssBoxValue = getComputedStyleX(elem, name);\n\n if (cssBoxValue == null || Number(cssBoxValue) < 0) {\n cssBoxValue = elem.style[name] || 0;\n } // Normalize '', auto, and prepare for extra\n\n\n cssBoxValue = parseFloat(cssBoxValue) || 0;\n }\n\n if (extra === undefined) {\n extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;\n }\n\n var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;\n var val = borderBoxValue || cssBoxValue;\n\n if (extra === CONTENT_INDEX) {\n if (borderBoxValueOrIsBorderBox) {\n return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);\n } else {\n return cssBoxValue;\n }\n } else if (borderBoxValueOrIsBorderBox) {\n return val + (extra === BORDER_INDEX ? 0 : extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle));\n } else {\n return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);\n }\n}\n\nvar cssShow = {\n position: 'absolute',\n visibility: 'hidden',\n display: 'block'\n}; // fix #119 : https://github.com/kissyteam/kissy/issues/119\n\nfunction getWHIgnoreDisplay(elem) {\n var val,\n args = arguments; // in case elem is window\n // elem.offsetWidth === undefined\n\n if (elem.offsetWidth !== 0) {\n val = getWH.apply(undefined, args);\n } else {\n swap(elem, cssShow, function () {\n val = getWH.apply(undefined, args);\n });\n }\n\n return val;\n}\n\neach(['width', 'height'], function (name) {\n var first = name.charAt(0).toUpperCase() + name.slice(1);\n\n domUtils['outer' + first] = function (el, includeMargin) {\n return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);\n };\n\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n\n domUtils[name] = function (elem, val) {\n if (val !== undefined) {\n if (elem) {\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem);\n\n if (isBorderBox) {\n val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);\n }\n\n return css(elem, name, val);\n }\n\n return;\n }\n\n return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);\n };\n});\n\nfunction css(el, name, value) {\n if (_typeof(name) === 'object') {\n for (var i in name) {\n css(el, i, name[i]);\n }\n\n return;\n }\n\n if (typeof value !== 'undefined') {\n if (typeof value === 'number') {\n value = value + 'px';\n }\n\n el.style[name] = value;\n } else {\n return getComputedStyleX(el, name);\n }\n}\n\nfunction mix(to, from) {\n for (var i in from) {\n to[i] = from[i];\n }\n\n return to;\n}\n\nvar utils = module.exports = {\n getWindow: function getWindow(node) {\n var doc = node.ownerDocument || node;\n return doc.defaultView || doc.parentWindow;\n },\n offset: function offset(el, value) {\n if (typeof value !== 'undefined') {\n setOffset(el, value);\n } else {\n return getOffset(el);\n }\n },\n isWindow: isWindow,\n each: each,\n css: css,\n clone: function clone(obj) {\n var ret = {};\n\n for (var i in obj) {\n ret[i] = obj[i];\n }\n\n var overflow = obj.overflow;\n\n if (overflow) {\n for (i in obj) {\n ret.overflow[i] = obj.overflow[i];\n }\n }\n\n return ret;\n },\n mix: mix,\n scrollLeft: function scrollLeft(w, v) {\n if (isWindow(w)) {\n if (v === undefined) {\n return getScrollLeft(w);\n } else {\n window.scrollTo(v, getScrollTop(w));\n }\n } else {\n if (v === undefined) {\n return w.scrollLeft;\n } else {\n w.scrollLeft = v;\n }\n }\n },\n scrollTop: function scrollTop(w, v) {\n if (isWindow(w)) {\n if (v === undefined) {\n return getScrollTop(w);\n } else {\n window.scrollTo(getScrollLeft(w), v);\n }\n } else {\n if (v === undefined) {\n return w.scrollTop;\n } else {\n w.scrollTop = v;\n }\n }\n },\n merge: function merge() {\n var ret = {};\n\n for (var i = 0; i < arguments.length; i++) {\n utils.mix(ret, arguments[i]);\n }\n\n return ret;\n },\n viewportWidth: 0,\n viewportHeight: 0\n};\nmix(utils, domUtils);","'use strict';\n\nvar reactIs = require('react-is');\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\n\n\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\n\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;","/**\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 */\n'use strict';\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function invariant(condition, format, a, b, c, d, e, f) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n\n throw error;\n }\n};\n\nmodule.exports = invariant;","/*\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};","// 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};","'use strict';\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _createClass = function () {\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\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (_typeof(call) === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + _typeof(superClass));\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n\nvar React = require('react');\n\nvar PropTypes = require('prop-types');\n\nvar _require = require('react-dom'),\n findDOMNode = _require.findDOMNode;\n\nvar scrollIntoView = require('dom-scroll-into-view');\n\nvar IMPERATIVE_API = ['blur', 'checkValidity', 'click', 'focus', 'select', 'setCustomValidity', 'setSelectionRange', 'setRangeText'];\n\nfunction getScrollOffset() {\n return {\n x: window.pageXOffset !== undefined ? window.pageXOffset : (document.documentElement || document.body.parentNode || document.body).scrollLeft,\n y: window.pageYOffset !== undefined ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop\n };\n}\n\nvar Autocomplete = function (_React$Component) {\n _inherits(Autocomplete, _React$Component);\n\n function Autocomplete(props) {\n _classCallCheck(this, Autocomplete);\n\n var _this = _possibleConstructorReturn(this, (Autocomplete.__proto__ || Object.getPrototypeOf(Autocomplete)).call(this, props));\n\n _this.state = {\n isOpen: false,\n highlightedIndex: null\n };\n _this._debugStates = [];\n _this.ensureHighlightedIndex = _this.ensureHighlightedIndex.bind(_this);\n _this.exposeAPI = _this.exposeAPI.bind(_this);\n _this.handleInputFocus = _this.handleInputFocus.bind(_this);\n _this.handleInputBlur = _this.handleInputBlur.bind(_this);\n _this.handleChange = _this.handleChange.bind(_this);\n _this.handleKeyDown = _this.handleKeyDown.bind(_this);\n _this.handleInputClick = _this.handleInputClick.bind(_this);\n _this.maybeAutoCompleteText = _this.maybeAutoCompleteText.bind(_this);\n return _this;\n }\n\n _createClass(Autocomplete, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n // this.refs is frozen, so we need to assign a new object to it\n this.refs = {};\n this._ignoreBlur = false;\n this._ignoreFocus = false;\n this._scrollOffset = null;\n this._scrollTimer = null;\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n clearTimeout(this._scrollTimer);\n this._scrollTimer = null;\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n if (this.state.highlightedIndex !== null) {\n this.setState(this.ensureHighlightedIndex);\n }\n\n if (nextProps.autoHighlight && (this.props.value !== nextProps.value || this.state.highlightedIndex === null)) {\n this.setState(this.maybeAutoCompleteText);\n }\n }\n }, {\n key: 'componentDidMount',\n value: function componentDidMount() {\n if (this.isOpen()) {\n this.setMenuPositions();\n }\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps, prevState) {\n if (this.state.isOpen && !prevState.isOpen || 'open' in this.props && this.props.open && !prevProps.open) this.setMenuPositions();\n this.maybeScrollItemIntoView();\n\n if (prevState.isOpen !== this.state.isOpen) {\n this.props.onMenuVisibilityChange(this.state.isOpen);\n }\n }\n }, {\n key: 'exposeAPI',\n value: function exposeAPI(el) {\n var _this2 = this;\n\n this.refs.input = el;\n IMPERATIVE_API.forEach(function (ev) {\n return _this2[ev] = el && el[ev] && el[ev].bind(el);\n });\n }\n }, {\n key: 'maybeScrollItemIntoView',\n value: function maybeScrollItemIntoView() {\n if (this.isOpen() && this.state.highlightedIndex !== null) {\n var itemNode = this.refs['item-' + this.state.highlightedIndex];\n var menuNode = this.refs.menu;\n scrollIntoView(findDOMNode(itemNode), findDOMNode(menuNode), {\n onlyScrollIfNeeded: true\n });\n }\n }\n }, {\n key: 'handleKeyDown',\n value: function handleKeyDown(event) {\n if (Autocomplete.keyDownHandlers[event.key]) Autocomplete.keyDownHandlers[event.key].call(this, event);else if (!this.isOpen()) {\n this.setState({\n isOpen: true\n });\n }\n }\n }, {\n key: 'handleChange',\n value: function handleChange(event) {\n this.props.onChange(event, event.target.value);\n }\n }, {\n key: 'getFilteredItems',\n value: function getFilteredItems(props) {\n var items = props.items;\n\n if (props.shouldItemRender) {\n items = items.filter(function (item) {\n return props.shouldItemRender(item, props.value);\n });\n }\n\n if (props.sortItems) {\n items.sort(function (a, b) {\n return props.sortItems(a, b, props.value);\n });\n }\n\n return items;\n }\n }, {\n key: 'maybeAutoCompleteText',\n value: function maybeAutoCompleteText(state, props) {\n var highlightedIndex = state.highlightedIndex;\n var value = props.value,\n getItemValue = props.getItemValue;\n var index = highlightedIndex === null ? 0 : highlightedIndex;\n var items = this.getFilteredItems(props);\n\n for (var i = 0; i < items.length; i++) {\n if (props.isItemSelectable(items[index])) break;\n index = (index + 1) % items.length;\n }\n\n var matchedItem = items[index] && props.isItemSelectable(items[index]) ? items[index] : null;\n\n if (value !== '' && matchedItem) {\n var itemValue = getItemValue(matchedItem);\n var itemValueDoesMatch = itemValue.toLowerCase().indexOf(value.toLowerCase()) === 0;\n\n if (itemValueDoesMatch) {\n return {\n highlightedIndex: index\n };\n }\n }\n\n return {\n highlightedIndex: null\n };\n }\n }, {\n key: 'ensureHighlightedIndex',\n value: function ensureHighlightedIndex(state, props) {\n if (state.highlightedIndex >= this.getFilteredItems(props).length) {\n return {\n highlightedIndex: null\n };\n }\n }\n }, {\n key: 'setMenuPositions',\n value: function setMenuPositions() {\n var node = this.refs.input;\n var rect = node.getBoundingClientRect();\n var computedStyle = global.window.getComputedStyle(node);\n var marginBottom = parseInt(computedStyle.marginBottom, 10) || 0;\n var marginLeft = parseInt(computedStyle.marginLeft, 10) || 0;\n var marginRight = parseInt(computedStyle.marginRight, 10) || 0;\n this.setState({\n menuTop: rect.bottom + marginBottom,\n menuLeft: rect.left + marginLeft,\n menuWidth: rect.width + marginLeft + marginRight\n });\n }\n }, {\n key: 'highlightItemFromMouse',\n value: function highlightItemFromMouse(index) {\n this.setState({\n highlightedIndex: index\n });\n }\n }, {\n key: 'selectItemFromMouse',\n value: function selectItemFromMouse(item) {\n var _this3 = this;\n\n var value = this.props.getItemValue(item); // The menu will de-render before a mouseLeave event\n // happens. Clear the flag to release control over focus\n\n this.setIgnoreBlur(false);\n this.setState({\n isOpen: false,\n highlightedIndex: null\n }, function () {\n _this3.props.onSelect(value, item);\n });\n }\n }, {\n key: 'setIgnoreBlur',\n value: function setIgnoreBlur(ignore) {\n this._ignoreBlur = ignore;\n }\n }, {\n key: 'renderMenu',\n value: function renderMenu() {\n var _this4 = this;\n\n var items = this.getFilteredItems(this.props).map(function (item, index) {\n var element = _this4.props.renderItem(item, _this4.state.highlightedIndex === index, {\n cursor: 'default'\n });\n\n return React.cloneElement(element, {\n onMouseEnter: _this4.props.isItemSelectable(item) ? function () {\n return _this4.highlightItemFromMouse(index);\n } : null,\n onClick: _this4.props.isItemSelectable(item) ? function () {\n return _this4.selectItemFromMouse(item);\n } : null,\n ref: function ref(e) {\n return _this4.refs['item-' + index] = e;\n }\n });\n });\n var style = {\n left: this.state.menuLeft,\n top: this.state.menuTop,\n minWidth: this.state.menuWidth\n };\n var menu = this.props.renderMenu(items, this.props.value, style);\n return React.cloneElement(menu, {\n ref: function ref(e) {\n return _this4.refs.menu = e;\n },\n // Ignore blur to prevent menu from de-rendering before we can process click\n onTouchStart: function onTouchStart() {\n return _this4.setIgnoreBlur(true);\n },\n onMouseEnter: function onMouseEnter() {\n return _this4.setIgnoreBlur(true);\n },\n onMouseLeave: function onMouseLeave() {\n return _this4.setIgnoreBlur(false);\n }\n });\n }\n }, {\n key: 'handleInputBlur',\n value: function handleInputBlur(event) {\n var _this5 = this;\n\n if (this._ignoreBlur) {\n this._ignoreFocus = true;\n this._scrollOffset = getScrollOffset();\n this.refs.input.focus();\n return;\n }\n\n var setStateCallback = void 0;\n var highlightedIndex = this.state.highlightedIndex;\n\n if (this.props.selectOnBlur && highlightedIndex !== null) {\n var items = this.getFilteredItems(this.props);\n var item = items[highlightedIndex];\n var value = this.props.getItemValue(item);\n\n setStateCallback = function setStateCallback() {\n return _this5.props.onSelect(value, item);\n };\n }\n\n this.setState({\n isOpen: false,\n highlightedIndex: null\n }, setStateCallback);\n var onBlur = this.props.inputProps.onBlur;\n\n if (onBlur) {\n onBlur(event);\n }\n }\n }, {\n key: 'handleInputFocus',\n value: function handleInputFocus(event) {\n var _this6 = this;\n\n if (this._ignoreFocus) {\n this._ignoreFocus = false;\n var _scrollOffset = this._scrollOffset,\n x = _scrollOffset.x,\n y = _scrollOffset.y;\n this._scrollOffset = null; // Focus will cause the browser to scroll the into view.\n // This can cause the mouse coords to change, which in turn\n // could cause a new highlight to happen, cancelling the click\n // event (when selecting with the mouse)\n\n window.scrollTo(x, y); // Some browsers wait until all focus event handlers have been\n // processed before scrolling the into view, so let's\n // scroll again on the next tick to ensure we're back to where\n // the user was before focus was lost. We could do the deferred\n // scroll only, but that causes a jarring split second jump in\n // some browsers that scroll before the focus event handlers\n // are triggered.\n\n clearTimeout(this._scrollTimer);\n this._scrollTimer = setTimeout(function () {\n _this6._scrollTimer = null;\n window.scrollTo(x, y);\n }, 0);\n return;\n }\n\n this.setState({\n isOpen: true\n });\n var onFocus = this.props.inputProps.onFocus;\n\n if (onFocus) {\n onFocus(event);\n }\n }\n }, {\n key: 'isInputFocused',\n value: function isInputFocused() {\n var el = this.refs.input;\n return el.ownerDocument && el === el.ownerDocument.activeElement;\n }\n }, {\n key: 'handleInputClick',\n value: function handleInputClick() {\n // Input will not be focused if it's disabled\n if (this.isInputFocused() && !this.isOpen()) this.setState({\n isOpen: true\n });\n }\n }, {\n key: 'composeEventHandlers',\n value: function composeEventHandlers(internal, external) {\n return external ? function (e) {\n internal(e);\n external(e);\n } : internal;\n }\n }, {\n key: 'isOpen',\n value: function isOpen() {\n return 'open' in this.props ? this.props.open : this.state.isOpen;\n }\n }, {\n key: 'render',\n value: function render() {\n if (this.props.debug) {\n // you don't like it, you love it\n this._debugStates.push({\n id: this._debugStates.length,\n state: this.state\n });\n }\n\n var inputProps = this.props.inputProps;\n var open = this.isOpen();\n return React.createElement('div', _extends({\n style: _extends({}, this.props.wrapperStyle)\n }, this.props.wrapperProps), this.props.renderInput(_extends({}, inputProps, {\n role: 'combobox',\n 'aria-autocomplete': 'list',\n 'aria-expanded': open,\n autoComplete: 'off',\n ref: this.exposeAPI,\n onFocus: this.handleInputFocus,\n onBlur: this.handleInputBlur,\n onChange: this.handleChange,\n onKeyDown: this.composeEventHandlers(this.handleKeyDown, inputProps.onKeyDown),\n onClick: this.composeEventHandlers(this.handleInputClick, inputProps.onClick),\n value: this.props.value\n })), open && this.renderMenu(), this.props.debug && React.createElement('pre', {\n style: {\n marginLeft: 300\n }\n }, JSON.stringify(this._debugStates.slice(Math.max(0, this._debugStates.length - 5), this._debugStates.length), null, 2)));\n }\n }]);\n\n return Autocomplete;\n}(React.Component);\n\nAutocomplete.propTypes = {\n /**\n * The items to display in the dropdown menu\n */\n items: PropTypes.array.isRequired,\n\n /**\n * The value to display in the input field\n */\n value: PropTypes.any,\n\n /**\n * Arguments: `event: Event, value: String`\n *\n * Invoked every time the user changes the input's value.\n */\n onChange: PropTypes.func,\n\n /**\n * Arguments: `value: String, item: Any`\n *\n * Invoked when the user selects an item from the dropdown menu.\n */\n onSelect: PropTypes.func,\n\n /**\n * Arguments: `item: Any, value: String`\n *\n * Invoked for each entry in `items` and its return value is used to\n * determine whether or not it should be displayed in the dropdown menu.\n * By default all items are always rendered.\n */\n shouldItemRender: PropTypes.func,\n\n /**\n * Arguments: `item: Any`\n *\n * Invoked when attempting to select an item. The return value is used to\n * determine whether the item should be selectable or not.\n * By default all items are selectable.\n */\n isItemSelectable: PropTypes.func,\n\n /**\n * Arguments: `itemA: Any, itemB: Any, value: String`\n *\n * The function which is used to sort `items` before display.\n */\n sortItems: PropTypes.func,\n\n /**\n * Arguments: `item: Any`\n *\n * Used to read the display value from each entry in `items`.\n */\n getItemValue: PropTypes.func.isRequired,\n\n /**\n * Arguments: `item: Any, isHighlighted: Boolean, styles: Object`\n *\n * Invoked for each entry in `items` that also passes `shouldItemRender` to\n * generate the render tree for each item in the dropdown menu. `styles` is\n * an optional set of styles that can be applied to improve the look/feel\n * of the items in the dropdown menu.\n */\n renderItem: PropTypes.func.isRequired,\n\n /**\n * Arguments: `items: Array, value: String, styles: Object`\n *\n * Invoked to generate the render tree for the dropdown menu. Ensure the\n * returned tree includes every entry in `items` or else the highlight order\n * and keyboard navigation logic will break. `styles` will contain\n * { top, left, minWidth } which are the coordinates of the top-left corner\n * and the width of the dropdown menu.\n */\n renderMenu: PropTypes.func,\n\n /**\n * Styles that are applied to the dropdown menu in the default `renderMenu`\n * implementation. If you override `renderMenu` and you want to use\n * `menuStyle` you must manually apply them (`this.props.menuStyle`).\n */\n menuStyle: PropTypes.object,\n\n /**\n * Arguments: `props: Object`\n *\n * Invoked to generate the input element. The `props` argument is the result\n * of merging `props.inputProps` with a selection of props that are required\n * both for functionality and accessibility. At the very least you need to\n * apply `props.ref` and all `props.on` event handlers. Failing to do\n * this will cause `Autocomplete` to behave unexpectedly.\n */\n renderInput: PropTypes.func,\n\n /**\n * Props passed to `props.renderInput`. By default these props will be\n * applied to the `` element rendered by `Autocomplete`, unless you\n * have specified a custom value for `props.renderInput`. Any properties\n * supported by `HTMLInputElement` can be specified, apart from the\n * following which are set by `Autocomplete`: value, autoComplete, role,\n * aria-autocomplete. `inputProps` is commonly used for (but not limited to)\n * placeholder, event handlers (onFocus, onBlur, etc.), autoFocus, etc..\n */\n inputProps: PropTypes.object,\n\n /**\n * Props that are applied to the element which wraps the `` and\n * dropdown menu elements rendered by `Autocomplete`.\n */\n wrapperProps: PropTypes.object,\n\n /**\n * This is a shorthand for `wrapperProps={{ style: }}`.\n * Note that `wrapperStyle` is applied before `wrapperProps`, so the latter\n * will win if it contains a `style` entry.\n */\n wrapperStyle: PropTypes.object,\n\n /**\n * Whether or not to automatically highlight the top match in the dropdown\n * menu.\n */\n autoHighlight: PropTypes.bool,\n\n /**\n * Whether or not to automatically select the highlighted item when the\n * `` loses focus.\n */\n selectOnBlur: PropTypes.bool,\n\n /**\n * Arguments: `isOpen: Boolean`\n *\n * Invoked every time the dropdown menu's visibility changes (i.e. every\n * time it is displayed/hidden).\n */\n onMenuVisibilityChange: PropTypes.func,\n\n /**\n * Used to override the internal logic which displays/hides the dropdown\n * menu. This is useful if you want to force a certain state based on your\n * UX/business logic. Use it together with `onMenuVisibilityChange` for\n * fine-grained control over the dropdown menu dynamics.\n */\n open: PropTypes.bool,\n debug: PropTypes.bool\n};\nAutocomplete.defaultProps = {\n value: '',\n wrapperProps: {},\n wrapperStyle: {\n display: 'inline-block'\n },\n inputProps: {},\n renderInput: function renderInput(props) {\n return React.createElement('input', props);\n },\n onChange: function onChange() {},\n onSelect: function onSelect() {},\n isItemSelectable: function isItemSelectable() {\n return true;\n },\n renderMenu: function renderMenu(items, value, style) {\n return React.createElement('div', {\n style: _extends({}, style, this.menuStyle),\n children: items\n });\n },\n menuStyle: {\n borderRadius: '3px',\n boxShadow: '0 2px 12px rgba(0, 0, 0, 0.1)',\n background: 'rgba(255, 255, 255, 0.9)',\n padding: '2px 0',\n fontSize: '90%',\n position: 'fixed',\n overflow: 'auto',\n maxHeight: '50%'\n },\n autoHighlight: true,\n selectOnBlur: false,\n onMenuVisibilityChange: function onMenuVisibilityChange() {}\n};\nAutocomplete.keyDownHandlers = {\n ArrowDown: function ArrowDown(event) {\n event.preventDefault();\n var items = this.getFilteredItems(this.props);\n if (!items.length) return;\n var highlightedIndex = this.state.highlightedIndex;\n var index = highlightedIndex === null ? -1 : highlightedIndex;\n\n for (var i = 0; i < items.length; i++) {\n var p = (index + i + 1) % items.length;\n\n if (this.props.isItemSelectable(items[p])) {\n index = p;\n break;\n }\n }\n\n if (index > -1 && index !== highlightedIndex) {\n this.setState({\n highlightedIndex: index,\n isOpen: true\n });\n }\n },\n ArrowUp: function ArrowUp(event) {\n event.preventDefault();\n var items = this.getFilteredItems(this.props);\n if (!items.length) return;\n var highlightedIndex = this.state.highlightedIndex;\n var index = highlightedIndex === null ? items.length : highlightedIndex;\n\n for (var i = 0; i < items.length; i++) {\n var p = (index - (1 + i) + items.length) % items.length;\n\n if (this.props.isItemSelectable(items[p])) {\n index = p;\n break;\n }\n }\n\n if (index !== items.length) {\n this.setState({\n highlightedIndex: index,\n isOpen: true\n });\n }\n },\n Enter: function Enter(event) {\n var _this7 = this; // Key code 229 is used for selecting items from character selectors (Pinyin, Kana, etc)\n\n\n if (event.keyCode !== 13) return; // In case the user is currently hovering over the menu\n\n this.setIgnoreBlur(false);\n\n if (!this.isOpen()) {\n // menu is closed so there is no selection to accept -> do nothing\n return;\n } else if (this.state.highlightedIndex == null) {\n // input has focus but no menu item is selected + enter is hit -> close the menu, highlight whatever's in input\n this.setState({\n isOpen: false\n }, function () {\n _this7.refs.input.select();\n });\n } else {\n // text entered + menu item has been highlighted + enter is hit -> update value to that of selected menu item, close the menu\n event.preventDefault();\n var item = this.getFilteredItems(this.props)[this.state.highlightedIndex];\n var value = this.props.getItemValue(item);\n this.setState({\n isOpen: false,\n highlightedIndex: null\n }, function () {\n //this.refs.input.focus() // TODO: file issue\n _this7.refs.input.setSelectionRange(value.length, value.length);\n\n _this7.props.onSelect(value, item);\n });\n }\n },\n Escape: function Escape() {\n // In case the user is currently hovering over the menu\n this.setIgnoreBlur(false);\n this.setState({\n highlightedIndex: null,\n isOpen: false\n });\n },\n Tab: function Tab() {\n // In case the user is currently hovering over the menu\n this.setIgnoreBlur(false);\n }\n};\nmodule.exports = Autocomplete;","/**\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 */\n'use strict';\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nvar printWarning = function printWarning() {};\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\n var loggedTypeFailures = {};\n\n var has = require('./lib/has');\n\n printWarning = function printWarning(text) {\n var message = 'Warning: ' + text;\n\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {\n /**/\n }\n };\n}\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\n\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + _typeof(typeSpecs[typeSpecName]) + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n\n if (error && !(error instanceof Error)) {\n printWarning((componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + _typeof(error) + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).');\n }\n\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n var stack = getStack ? getStack() : '';\n printWarning('Failed ' + location + ' type: ' + error.message + (stack != null ? stack : ''));\n }\n }\n }\n }\n}\n/**\n * Resets warning cache when testing.\n *\n * @private\n */\n\n\ncheckPropTypes.resetWarningCache = function () {\n if (process.env.NODE_ENV !== 'production') {\n loggedTypeFailures = {};\n }\n};\n\nmodule.exports = checkPropTypes;","/**\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 */\n'use strict';\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nvar ReactIs = require('react-is');\n\nvar assign = require('object-assign');\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nvar has = require('./lib/has');\n\nvar checkPropTypes = require('./checkPropTypes');\n\nvar printWarning = function printWarning() {};\n\nif (process.env.NODE_ENV !== 'production') {\n printWarning = function printWarning(text) {\n var message = 'Warning: ' + text;\n\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n}\n\nfunction emptyFunctionThatReturnsNull() {\n return null;\n}\n\nmodule.exports = function (isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n\n var ANONYMOUS = '<>'; // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bigint: createPrimitiveTypeChecker('bigint'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n elementType: createElementTypeTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker,\n exact: createStrictShapeTypeChecker\n };\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n\n /*eslint-disable no-self-compare*/\n\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n\n\n function PropTypeError(message, data) {\n this.message = message;\n this.data = data && _typeof(data) === 'object' ? data : {};\n this.stack = '';\n } // Make `instanceof Error` still work for returned errors.\n\n\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (process.env.NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');\n err.name = 'Invariant Violation';\n throw err;\n } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n\n if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3) {\n printWarning('You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.');\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), {\n expectedType: expectedType\n });\n }\n\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunctionThatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n\n var propValue = props[propName];\n\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n\n if (error instanceof Error) {\n return error;\n }\n }\n\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n\n if (!ReactIs.isValidElementType(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));\n }\n\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n if (process.env.NODE_ENV !== 'production') {\n if (arguments.length > 1) {\n printWarning('Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).');\n } else {\n printWarning('Invalid argument supplied to oneOf, expected an array.');\n }\n }\n\n return emptyFunctionThatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {\n var type = getPreciseType(value);\n\n if (type === 'symbol') {\n return String(value);\n }\n\n return value;\n });\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n\n var propValue = props[propName];\n var propType = getPropType(propValue);\n\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n\n for (var key in propValue) {\n if (has(propValue, key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n\n if (error instanceof Error) {\n return error;\n }\n }\n }\n\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunctionThatReturnsNull;\n }\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n\n if (typeof checker !== 'function') {\n printWarning('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.');\n return emptyFunctionThatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var expectedTypes = [];\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);\n\n if (checkerResult == null) {\n return null;\n }\n\n if (checkerResult.data && has(checkerResult.data, 'expectedType')) {\n expectedTypes.push(checkerResult.data.expectedType);\n }\n }\n\n var expectedTypesMessage = expectedTypes.length > 0 ? ', expected one of type [' + expectedTypes.join(', ') + ']' : '';\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function invalidValidatorError(componentName, location, propFullName, key, type) {\n return new PropTypeError((componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.');\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n\n if (typeof checker !== 'function') {\n return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));\n }\n\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n\n if (error) {\n return error;\n }\n }\n\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function createStrictShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n } // We need to check all keys in case some are required but missing from props.\n\n\n var allKeys = assign({}, props[propName], shapeTypes);\n\n for (var key in allKeys) {\n var checker = shapeTypes[key];\n\n if (has(shapeTypes, key) && typeof checker !== 'function') {\n return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));\n }\n\n if (!checker) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' '));\n }\n\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n\n if (error) {\n return error;\n }\n }\n\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (_typeof(propValue)) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n\n case 'boolean':\n return !propValue;\n\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n } // falsy value can't be a Symbol\n\n\n if (!propValue) {\n return false;\n } // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n\n\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n } // Fallback for non-spec compliant Symbols which are polyfilled.\n\n\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n } // Equivalent of `typeof` but with special handling for array and regexp.\n\n\n function getPropType(propValue) {\n var propType = _typeof(propValue);\n\n if (Array.isArray(propValue)) {\n return 'array';\n }\n\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n\n return propType;\n } // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n\n\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n\n var propType = getPropType(propValue);\n\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n\n return propType;\n } // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n\n\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n\n default:\n return type;\n }\n } // Returns class name of the object, if any.\n\n\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;\n ReactPropTypes.PropTypes = ReactPropTypes;\n return ReactPropTypes;\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}","/**\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 */\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\nmodule.exports = ReactPropTypesSecret;","module.exports = Function.call.bind(Object.prototype.hasOwnProperty);","module.exports = {\n Bar: require('./lib/bar'),\n Doughnut: require('./lib/doughnut'),\n Line: require('./lib/line'),\n Pie: require('./lib/pie'),\n PolarArea: require('./lib/polar-area'),\n Radar: require('./lib/radar'),\n createClass: require('./lib/core').createClass\n};","var vars = require('./core');\n\nmodule.exports = vars.createClass('Bar', ['getBarsAtEvent']);","var React = require('react');\n\nvar createReactClass = require('create-react-class');\n\nvar ReactDOM = require('react-dom');\n\nmodule.exports = {\n createClass: function createClass(chartType, methodNames, dataKey) {\n var excludedProps = ['data', 'options', 'redraw'];\n var classData = {\n displayName: chartType + 'Chart',\n getInitialState: function getInitialState() {\n return {};\n },\n render: function render() {\n var _props = {\n ref: 'canvass'\n };\n\n for (var name in this.props) {\n if (this.props.hasOwnProperty(name)) {\n if (excludedProps.indexOf(name) === -1) {\n _props[name] = this.props[name];\n }\n }\n }\n\n return React.createElement('canvas', _props);\n }\n };\n var extras = ['clear', 'stop', 'resize', 'toBase64Image', 'generateLegend', 'update', 'addData', 'removeData'];\n\n function extra(type) {\n classData[type] = function () {\n return this.state.chart[type].apply(this.state.chart, arguments);\n };\n }\n\n classData.componentDidMount = function () {\n this.initializeChart(this.props);\n };\n\n classData.componentWillUnmount = function () {\n var chart = this.state.chart;\n chart.destroy();\n };\n\n classData.componentWillReceiveProps = function (nextProps) {\n var chart = this.state.chart;\n\n if (nextProps.redraw) {\n chart.destroy();\n this.initializeChart(nextProps);\n } else {\n dataKey = dataKey || dataKeys[chart.name];\n updatePoints(nextProps, chart, dataKey);\n\n if (chart.scale) {\n chart.scale.xLabels = nextProps.data.labels;\n\n if (chart.scale.calculateXLabelRotation) {\n chart.scale.calculateXLabelRotation();\n }\n }\n\n chart.update();\n }\n };\n\n classData.initializeChart = function (nextProps) {\n var Chart = require('chart.js');\n\n var el = ReactDOM.findDOMNode(this);\n var ctx = el.getContext(\"2d\");\n var chart = new Chart(ctx)[chartType](nextProps.data, nextProps.options || {});\n this.state.chart = chart;\n }; // return the chartjs instance\n\n\n classData.getChart = function () {\n return this.state.chart;\n }; // return the canvass element that contains the chart\n\n\n classData.getCanvass = function () {\n return this.refs.canvass;\n };\n\n classData.getCanvas = classData.getCanvass;\n var i;\n\n for (i = 0; i < extras.length; i++) {\n extra(extras[i]);\n }\n\n for (i = 0; i < methodNames.length; i++) {\n extra(methodNames[i]);\n }\n\n return createReactClass(classData);\n }\n};\nvar dataKeys = {\n 'Line': 'points',\n 'Radar': 'points',\n 'Bar': 'bars'\n};\n\nvar updatePoints = function updatePoints(nextProps, chart, dataKey) {\n var name = chart.name;\n\n if (name === 'PolarArea' || name === 'Pie' || name === 'Doughnut') {\n nextProps.data.forEach(function (segment, segmentIndex) {\n if (!chart.segments[segmentIndex]) {\n chart.addData(segment);\n } else {\n Object.keys(segment).forEach(function (key) {\n chart.segments[segmentIndex][key] = segment[key];\n });\n }\n });\n\n while (nextProps.data.length < chart.segments.length) {\n chart.removeData();\n }\n } else if (name === \"Radar\") {\n chart.removeData();\n nextProps.data.datasets.forEach(function (set, setIndex) {\n set.data.forEach(function (val, pointIndex) {\n if (typeof chart.datasets[setIndex][dataKey][pointIndex] == \"undefined\") {\n addData(nextProps, chart, setIndex, pointIndex);\n } else {\n chart.datasets[setIndex][dataKey][pointIndex].value = val;\n }\n });\n });\n } else {\n while (chart.scale.xLabels.length > nextProps.data.labels.length) {\n chart.removeData();\n }\n\n nextProps.data.datasets.forEach(function (set, setIndex) {\n set.data.forEach(function (val, pointIndex) {\n if (typeof chart.datasets[setIndex][dataKey][pointIndex] == \"undefined\") {\n addData(nextProps, chart, setIndex, pointIndex);\n } else {\n chart.datasets[setIndex][dataKey][pointIndex].value = val;\n }\n });\n });\n }\n};\n\nvar addData = function addData(nextProps, chart, setIndex, pointIndex) {\n var values = [];\n nextProps.data.datasets.forEach(function (set) {\n values.push(set.data[pointIndex]);\n });\n chart.addData(values, nextProps.data.labels[setIndex]);\n};","var vars = require('./core');\n\nmodule.exports = vars.createClass('Doughnut', ['getSegmentsAtEvent']);","var vars = require('./core');\n\nmodule.exports = vars.createClass('Line', ['getPointsAtEvent']);","var vars = require('./core');\n\nmodule.exports = vars.createClass('Pie', ['getSegmentsAtEvent']);","var vars = require('./core');\n\nmodule.exports = vars.createClass('PolarArea', ['getSegmentsAtEvent']);","var vars = require('./core');\n\nmodule.exports = vars.createClass('Radar', ['getPointsAtEvent']);","/**\n * @license React\n * react-dom-server-legacy.browser.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\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'use strict';\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nif (process.env.NODE_ENV !== \"production\") {\n (function () {\n 'use strict';\n\n var React = require('react');\n\n var ReactVersion = '18.3.1';\n var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // by calls to these methods by a Babel plugin.\n //\n // In PROD (or in packages without access to React internals),\n // they are left as they are instead.\n\n function warn(format) {\n {\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 printWarning('warn', format, args);\n }\n }\n }\n\n function error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n }\n\n function printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n }\n\n function scheduleWork(callback) {\n callback();\n }\n\n function beginWriting(destination) {}\n\n function writeChunk(destination, chunk) {\n writeChunkAndReturn(destination, chunk);\n }\n\n function writeChunkAndReturn(destination, chunk) {\n return destination.push(chunk);\n }\n\n function completeWriting(destination) {}\n\n function close(destination) {\n destination.push(null);\n }\n\n function stringToChunk(content) {\n return content;\n }\n\n function stringToPrecomputedChunk(content) {\n return content;\n }\n\n function closeWithError(destination, error) {\n // $FlowFixMe: This is an Error object or the destination accepts other types.\n destination.destroy(error);\n }\n /*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n // $FlowFixMe only called in DEV, so void return is not possible.\n\n\n function typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n } // $FlowFixMe only called in DEV, so void return is not possible.\n\n\n function willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n }\n\n function testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n }\n\n function checkAttributeStringCoercion(value, attributeName) {\n {\n if (willCoercionThrow(value)) {\n error('The provided `%s` attribute is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', attributeName, typeName(value));\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n }\n\n function checkCSSPropertyStringCoercion(value, propName) {\n {\n if (willCoercionThrow(value)) {\n error('The provided `%s` CSS property is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', propName, typeName(value));\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n }\n\n function checkHtmlStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided HTML markup uses a value of unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n }\n\n var hasOwnProperty = Object.prototype.hasOwnProperty; // A reserved attribute.\n // It is handled by React separately and shouldn't be written to the DOM.\n\n var RESERVED = 0; // A simple string attribute.\n // Attributes that aren't in the filter are presumed to have this type.\n\n var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called\n // \"enumerated\" attributes with \"true\" and \"false\" as possible values.\n // When true, it should be set to a \"true\" string.\n // When false, it should be set to a \"false\" string.\n\n var BOOLEANISH_STRING = 2; // A real boolean attribute.\n // When true, it should be present (set either to an empty string or its name).\n // When false, it should be omitted.\n\n var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value.\n // When true, it should be present (set either to an empty string or its name).\n // When false, it should be omitted.\n // For any other value, should be present with that value.\n\n var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.\n // When falsy, it should be removed.\n\n var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.\n // When falsy, it should be removed.\n\n var POSITIVE_NUMERIC = 6;\n /* eslint-disable max-len */\n\n var ATTRIBUTE_NAME_START_CHAR = \":A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\";\n /* eslint-enable max-len */\n\n var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + \"\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040\";\n var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');\n var illegalAttributeNameCache = {};\n var validatedAttributeNameCache = {};\n\n function isAttributeNameSafe(attributeName) {\n if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {\n return true;\n }\n\n if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {\n return false;\n }\n\n if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {\n validatedAttributeNameCache[attributeName] = true;\n return true;\n }\n\n illegalAttributeNameCache[attributeName] = true;\n {\n error('Invalid attribute name: `%s`', attributeName);\n }\n return false;\n }\n\n function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {\n if (propertyInfo !== null && propertyInfo.type === RESERVED) {\n return false;\n }\n\n switch (_typeof(value)) {\n case 'function': // $FlowIssue symbol is perfectly valid here\n\n case 'symbol':\n // eslint-disable-line\n return true;\n\n case 'boolean':\n {\n if (isCustomComponentTag) {\n return false;\n }\n\n if (propertyInfo !== null) {\n return !propertyInfo.acceptsBooleans;\n } else {\n var prefix = name.toLowerCase().slice(0, 5);\n return prefix !== 'data-' && prefix !== 'aria-';\n }\n }\n\n default:\n return false;\n }\n }\n\n function getPropertyInfo(name) {\n return properties.hasOwnProperty(name) ? properties[name] : null;\n }\n\n function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) {\n this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;\n this.attributeName = attributeName;\n this.attributeNamespace = attributeNamespace;\n this.mustUseProperty = mustUseProperty;\n this.propertyName = name;\n this.type = type;\n this.sanitizeURL = sanitizeURL;\n this.removeEmptyString = removeEmptyString;\n } // When adding attributes to this list, be sure to also add them to\n // the `possibleStandardNames` module to ensure casing and incorrect\n // name warnings.\n\n\n var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.\n\n var reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular\n // elements (not just inputs). Now that ReactDOMInput assigns to the\n // defaultValue property -- do we need this?\n 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'];\n reservedProps.forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n }); // A few React string attributes have a different name.\n // This is a mapping from React prop names to the attribute names.\n\n [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {\n var name = _ref[0],\n attributeName = _ref[1];\n properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n attributeName, // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n }); // These are \"enumerated\" HTML attributes that accept \"true\" and \"false\".\n // In React, we let users pass `true` and `false` even though technically\n // these aren't boolean attributes (they are coerced to strings).\n\n ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty\n name.toLowerCase(), // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n }); // These are \"enumerated\" SVG attributes that accept \"true\" and \"false\".\n // In React, we let users pass `true` and `false` even though technically\n // these aren't boolean attributes (they are coerced to strings).\n // Since these are SVG attributes, their attribute names are case-sensitive.\n\n ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n }); // These are HTML boolean attributes.\n\n ['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM\n // on the client side because the browsers are inconsistent. Instead we call focus().\n 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'disableRemotePlayback', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata\n 'itemScope'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty\n name.toLowerCase(), // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n }); // These are the few React props that we set as DOM properties\n // rather than attributes. These are all booleans.\n\n ['checked', // Note: `option.selected` is not updated if `select.multiple` is\n // disabled with `removeAttribute`. We have special logic for handling this.\n 'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list,\n // you'll need to set attributeName to name.toLowerCase()\n // instead in the assignment below.\n ].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n }); // These are HTML attributes that are \"overloaded booleans\": they behave like\n // booleans, but can also accept a string value.\n\n ['capture', 'download' // NOTE: if you add a camelCased prop to this list,\n // you'll need to set attributeName to name.toLowerCase()\n // instead in the assignment below.\n ].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n }); // These are HTML attributes that must be positive numbers.\n\n ['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list,\n // you'll need to set attributeName to name.toLowerCase()\n // instead in the assignment below.\n ].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n }); // These are HTML attributes that must be numbers.\n\n ['rowSpan', 'start'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty\n name.toLowerCase(), // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n });\n var CAMELIZE = /[\\-\\:]([a-z])/g;\n\n var capitalize = function capitalize(token) {\n return token[1].toUpperCase();\n }; // This is a list of all SVG attributes that need special casing, namespacing,\n // or boolean value assignment. Regular attributes that just accept strings\n // and have the same names are omitted, just like in the HTML attribute filter.\n // Some of these attributes can be hard to find. This list was created by\n // scraping the MDN documentation.\n\n\n ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' // NOTE: if you add a camelCased prop to this list,\n // you'll need to set attributeName to name.toLowerCase()\n // instead in the assignment below.\n ].forEach(function (attributeName) {\n var name = attributeName.replace(CAMELIZE, capitalize);\n properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n attributeName, null, // attributeNamespace\n false, // sanitizeURL\n false);\n }); // String SVG attributes with the xlink namespace.\n\n ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list,\n // you'll need to set attributeName to name.toLowerCase()\n // instead in the assignment below.\n ].forEach(function (attributeName) {\n var name = attributeName.replace(CAMELIZE, capitalize);\n properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n attributeName, 'http://www.w3.org/1999/xlink', false, // sanitizeURL\n false);\n }); // String SVG attributes with the xml namespace.\n\n ['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list,\n // you'll need to set attributeName to name.toLowerCase()\n // instead in the assignment below.\n ].forEach(function (attributeName) {\n var name = attributeName.replace(CAMELIZE, capitalize);\n properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n attributeName, 'http://www.w3.org/XML/1998/namespace', false, // sanitizeURL\n false);\n }); // These attribute exists both in HTML and SVG.\n // The attribute name is case-sensitive in SVG so we can't just use\n // the React name like we do for attributes that exist only in HTML.\n\n ['tabIndex', 'crossOrigin'].forEach(function (attributeName) {\n properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty\n attributeName.toLowerCase(), // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n }); // These attributes accept URLs. These must not allow javascript: URLS.\n // These will also need to accept Trusted Types object in the future.\n\n var xlinkHref = 'xlinkHref';\n properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty\n 'xlink:href', 'http://www.w3.org/1999/xlink', true, // sanitizeURL\n false);\n ['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {\n properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty\n attributeName.toLowerCase(), // attributeName\n null, // attributeNamespace\n true, // sanitizeURL\n true);\n });\n /**\n * CSS properties which accept numbers but are not in units of \"px\".\n */\n\n var isUnitlessNumber = {\n animationIterationCount: true,\n aspectRatio: true,\n borderImageOutset: true,\n borderImageSlice: true,\n borderImageWidth: true,\n boxFlex: true,\n boxFlexGroup: true,\n boxOrdinalGroup: true,\n columnCount: true,\n columns: true,\n flex: true,\n flexGrow: true,\n flexPositive: true,\n flexShrink: true,\n flexNegative: true,\n flexOrder: true,\n gridArea: true,\n gridRow: true,\n gridRowEnd: true,\n gridRowSpan: true,\n gridRowStart: true,\n gridColumn: true,\n gridColumnEnd: true,\n gridColumnSpan: true,\n gridColumnStart: true,\n fontWeight: true,\n lineClamp: true,\n lineHeight: true,\n opacity: true,\n order: true,\n orphans: true,\n tabSize: true,\n widows: true,\n zIndex: true,\n zoom: true,\n // SVG-related properties\n fillOpacity: true,\n floodOpacity: true,\n stopOpacity: true,\n strokeDasharray: true,\n strokeDashoffset: true,\n strokeMiterlimit: true,\n strokeOpacity: true,\n strokeWidth: true\n };\n /**\n * @param {string} prefix vendor-specific prefix, eg: Webkit\n * @param {string} key style name, eg: transitionDuration\n * @return {string} style name prefixed with `prefix`, properly camelCased, eg:\n * WebkitTransitionDuration\n */\n\n function prefixKey(prefix, key) {\n return prefix + key.charAt(0).toUpperCase() + key.substring(1);\n }\n /**\n * Support style names that may come passed in prefixed by adding permutations\n * of vendor prefixes.\n */\n\n\n var prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an\n // infinite loop, because it iterates over the newly added props too.\n\n Object.keys(isUnitlessNumber).forEach(function (prop) {\n prefixes.forEach(function (prefix) {\n isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];\n });\n });\n var hasReadOnlyValue = {\n button: true,\n checkbox: true,\n image: true,\n hidden: true,\n radio: true,\n reset: true,\n submit: true\n };\n\n function checkControlledValueProps(tagName, props) {\n {\n if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) {\n error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');\n }\n\n if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) {\n error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');\n }\n }\n }\n\n function isCustomComponent(tagName, props) {\n if (tagName.indexOf('-') === -1) {\n return typeof props.is === 'string';\n }\n\n switch (tagName) {\n // These are reserved SVG and MathML elements.\n // We don't mind this list too much because we expect it to never grow.\n // The alternative is to track the namespace in a few places which is convoluted.\n // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts\n case 'annotation-xml':\n case 'color-profile':\n case 'font-face':\n case 'font-face-src':\n case 'font-face-uri':\n case 'font-face-format':\n case 'font-face-name':\n case 'missing-glyph':\n return false;\n\n default:\n return true;\n }\n }\n\n var ariaProperties = {\n 'aria-current': 0,\n // state\n 'aria-description': 0,\n 'aria-details': 0,\n 'aria-disabled': 0,\n // state\n 'aria-hidden': 0,\n // state\n 'aria-invalid': 0,\n // state\n 'aria-keyshortcuts': 0,\n 'aria-label': 0,\n 'aria-roledescription': 0,\n // Widget Attributes\n 'aria-autocomplete': 0,\n 'aria-checked': 0,\n 'aria-expanded': 0,\n 'aria-haspopup': 0,\n 'aria-level': 0,\n 'aria-modal': 0,\n 'aria-multiline': 0,\n 'aria-multiselectable': 0,\n 'aria-orientation': 0,\n 'aria-placeholder': 0,\n 'aria-pressed': 0,\n 'aria-readonly': 0,\n 'aria-required': 0,\n 'aria-selected': 0,\n 'aria-sort': 0,\n 'aria-valuemax': 0,\n 'aria-valuemin': 0,\n 'aria-valuenow': 0,\n 'aria-valuetext': 0,\n // Live Region Attributes\n 'aria-atomic': 0,\n 'aria-busy': 0,\n 'aria-live': 0,\n 'aria-relevant': 0,\n // Drag-and-Drop Attributes\n 'aria-dropeffect': 0,\n 'aria-grabbed': 0,\n // Relationship Attributes\n 'aria-activedescendant': 0,\n 'aria-colcount': 0,\n 'aria-colindex': 0,\n 'aria-colspan': 0,\n 'aria-controls': 0,\n 'aria-describedby': 0,\n 'aria-errormessage': 0,\n 'aria-flowto': 0,\n 'aria-labelledby': 0,\n 'aria-owns': 0,\n 'aria-posinset': 0,\n 'aria-rowcount': 0,\n 'aria-rowindex': 0,\n 'aria-rowspan': 0,\n 'aria-setsize': 0\n };\n var warnedProperties = {};\n var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');\n var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');\n\n function validateProperty(tagName, name) {\n {\n if (hasOwnProperty.call(warnedProperties, name) && warnedProperties[name]) {\n return true;\n }\n\n if (rARIACamel.test(name)) {\n var ariaName = 'aria-' + name.slice(4).toLowerCase();\n var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM\n // DOM properties, then it is an invalid aria-* attribute.\n\n if (correctName == null) {\n error('Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);\n warnedProperties[name] = true;\n return true;\n } // aria-* attributes should be lowercase; suggest the lowercase version.\n\n\n if (name !== correctName) {\n error('Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);\n warnedProperties[name] = true;\n return true;\n }\n }\n\n if (rARIA.test(name)) {\n var lowerCasedName = name.toLowerCase();\n var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM\n // DOM properties, then it is an invalid aria-* attribute.\n\n if (standardName == null) {\n warnedProperties[name] = true;\n return false;\n } // aria-* attributes should be lowercase; suggest the lowercase version.\n\n\n if (name !== standardName) {\n error('Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);\n warnedProperties[name] = true;\n return true;\n }\n }\n }\n return true;\n }\n\n function warnInvalidARIAProps(type, props) {\n {\n var invalidProps = [];\n\n for (var key in props) {\n var isValid = validateProperty(type, key);\n\n if (!isValid) {\n invalidProps.push(key);\n }\n }\n\n var unknownPropString = invalidProps.map(function (prop) {\n return '`' + prop + '`';\n }).join(', ');\n\n if (invalidProps.length === 1) {\n error('Invalid aria prop %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type);\n } else if (invalidProps.length > 1) {\n error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type);\n }\n }\n }\n\n function validateProperties(type, props) {\n if (isCustomComponent(type, props)) {\n return;\n }\n\n warnInvalidARIAProps(type, props);\n }\n\n var didWarnValueNull = false;\n\n function validateProperties$1(type, props) {\n {\n if (type !== 'input' && type !== 'textarea' && type !== 'select') {\n return;\n }\n\n if (props != null && props.value === null && !didWarnValueNull) {\n didWarnValueNull = true;\n\n if (type === 'select' && props.multiple) {\n error('`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type);\n } else {\n error('`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);\n }\n }\n }\n } // When adding attributes to the HTML or SVG allowed attribute list, be sure to\n // also add them to this module to ensure casing and incorrect name\n // warnings.\n\n\n var possibleStandardNames = {\n // HTML\n accept: 'accept',\n acceptcharset: 'acceptCharset',\n 'accept-charset': 'acceptCharset',\n accesskey: 'accessKey',\n action: 'action',\n allowfullscreen: 'allowFullScreen',\n alt: 'alt',\n as: 'as',\n async: 'async',\n autocapitalize: 'autoCapitalize',\n autocomplete: 'autoComplete',\n autocorrect: 'autoCorrect',\n autofocus: 'autoFocus',\n autoplay: 'autoPlay',\n autosave: 'autoSave',\n capture: 'capture',\n cellpadding: 'cellPadding',\n cellspacing: 'cellSpacing',\n challenge: 'challenge',\n charset: 'charSet',\n checked: 'checked',\n children: 'children',\n cite: 'cite',\n class: 'className',\n classid: 'classID',\n classname: 'className',\n cols: 'cols',\n colspan: 'colSpan',\n content: 'content',\n contenteditable: 'contentEditable',\n contextmenu: 'contextMenu',\n controls: 'controls',\n controlslist: 'controlsList',\n coords: 'coords',\n crossorigin: 'crossOrigin',\n dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',\n data: 'data',\n datetime: 'dateTime',\n default: 'default',\n defaultchecked: 'defaultChecked',\n defaultvalue: 'defaultValue',\n defer: 'defer',\n dir: 'dir',\n disabled: 'disabled',\n disablepictureinpicture: 'disablePictureInPicture',\n disableremoteplayback: 'disableRemotePlayback',\n download: 'download',\n draggable: 'draggable',\n enctype: 'encType',\n enterkeyhint: 'enterKeyHint',\n for: 'htmlFor',\n form: 'form',\n formmethod: 'formMethod',\n formaction: 'formAction',\n formenctype: 'formEncType',\n formnovalidate: 'formNoValidate',\n formtarget: 'formTarget',\n frameborder: 'frameBorder',\n headers: 'headers',\n height: 'height',\n hidden: 'hidden',\n high: 'high',\n href: 'href',\n hreflang: 'hrefLang',\n htmlfor: 'htmlFor',\n httpequiv: 'httpEquiv',\n 'http-equiv': 'httpEquiv',\n icon: 'icon',\n id: 'id',\n imagesizes: 'imageSizes',\n imagesrcset: 'imageSrcSet',\n innerhtml: 'innerHTML',\n inputmode: 'inputMode',\n integrity: 'integrity',\n is: 'is',\n itemid: 'itemID',\n itemprop: 'itemProp',\n itemref: 'itemRef',\n itemscope: 'itemScope',\n itemtype: 'itemType',\n keyparams: 'keyParams',\n keytype: 'keyType',\n kind: 'kind',\n label: 'label',\n lang: 'lang',\n list: 'list',\n loop: 'loop',\n low: 'low',\n manifest: 'manifest',\n marginwidth: 'marginWidth',\n marginheight: 'marginHeight',\n max: 'max',\n maxlength: 'maxLength',\n media: 'media',\n mediagroup: 'mediaGroup',\n method: 'method',\n min: 'min',\n minlength: 'minLength',\n multiple: 'multiple',\n muted: 'muted',\n name: 'name',\n nomodule: 'noModule',\n nonce: 'nonce',\n novalidate: 'noValidate',\n open: 'open',\n optimum: 'optimum',\n pattern: 'pattern',\n placeholder: 'placeholder',\n playsinline: 'playsInline',\n poster: 'poster',\n preload: 'preload',\n profile: 'profile',\n radiogroup: 'radioGroup',\n readonly: 'readOnly',\n referrerpolicy: 'referrerPolicy',\n rel: 'rel',\n required: 'required',\n reversed: 'reversed',\n role: 'role',\n rows: 'rows',\n rowspan: 'rowSpan',\n sandbox: 'sandbox',\n scope: 'scope',\n scoped: 'scoped',\n scrolling: 'scrolling',\n seamless: 'seamless',\n selected: 'selected',\n shape: 'shape',\n size: 'size',\n sizes: 'sizes',\n span: 'span',\n spellcheck: 'spellCheck',\n src: 'src',\n srcdoc: 'srcDoc',\n srclang: 'srcLang',\n srcset: 'srcSet',\n start: 'start',\n step: 'step',\n style: 'style',\n summary: 'summary',\n tabindex: 'tabIndex',\n target: 'target',\n title: 'title',\n type: 'type',\n usemap: 'useMap',\n value: 'value',\n width: 'width',\n wmode: 'wmode',\n wrap: 'wrap',\n // SVG\n about: 'about',\n accentheight: 'accentHeight',\n 'accent-height': 'accentHeight',\n accumulate: 'accumulate',\n additive: 'additive',\n alignmentbaseline: 'alignmentBaseline',\n 'alignment-baseline': 'alignmentBaseline',\n allowreorder: 'allowReorder',\n alphabetic: 'alphabetic',\n amplitude: 'amplitude',\n arabicform: 'arabicForm',\n 'arabic-form': 'arabicForm',\n ascent: 'ascent',\n attributename: 'attributeName',\n attributetype: 'attributeType',\n autoreverse: 'autoReverse',\n azimuth: 'azimuth',\n basefrequency: 'baseFrequency',\n baselineshift: 'baselineShift',\n 'baseline-shift': 'baselineShift',\n baseprofile: 'baseProfile',\n bbox: 'bbox',\n begin: 'begin',\n bias: 'bias',\n by: 'by',\n calcmode: 'calcMode',\n capheight: 'capHeight',\n 'cap-height': 'capHeight',\n clip: 'clip',\n clippath: 'clipPath',\n 'clip-path': 'clipPath',\n clippathunits: 'clipPathUnits',\n cliprule: 'clipRule',\n 'clip-rule': 'clipRule',\n color: 'color',\n colorinterpolation: 'colorInterpolation',\n 'color-interpolation': 'colorInterpolation',\n colorinterpolationfilters: 'colorInterpolationFilters',\n 'color-interpolation-filters': 'colorInterpolationFilters',\n colorprofile: 'colorProfile',\n 'color-profile': 'colorProfile',\n colorrendering: 'colorRendering',\n 'color-rendering': 'colorRendering',\n contentscripttype: 'contentScriptType',\n contentstyletype: 'contentStyleType',\n cursor: 'cursor',\n cx: 'cx',\n cy: 'cy',\n d: 'd',\n datatype: 'datatype',\n decelerate: 'decelerate',\n descent: 'descent',\n diffuseconstant: 'diffuseConstant',\n direction: 'direction',\n display: 'display',\n divisor: 'divisor',\n dominantbaseline: 'dominantBaseline',\n 'dominant-baseline': 'dominantBaseline',\n dur: 'dur',\n dx: 'dx',\n dy: 'dy',\n edgemode: 'edgeMode',\n elevation: 'elevation',\n enablebackground: 'enableBackground',\n 'enable-background': 'enableBackground',\n end: 'end',\n exponent: 'exponent',\n externalresourcesrequired: 'externalResourcesRequired',\n fill: 'fill',\n fillopacity: 'fillOpacity',\n 'fill-opacity': 'fillOpacity',\n fillrule: 'fillRule',\n 'fill-rule': 'fillRule',\n filter: 'filter',\n filterres: 'filterRes',\n filterunits: 'filterUnits',\n floodopacity: 'floodOpacity',\n 'flood-opacity': 'floodOpacity',\n floodcolor: 'floodColor',\n 'flood-color': 'floodColor',\n focusable: 'focusable',\n fontfamily: 'fontFamily',\n 'font-family': 'fontFamily',\n fontsize: 'fontSize',\n 'font-size': 'fontSize',\n fontsizeadjust: 'fontSizeAdjust',\n 'font-size-adjust': 'fontSizeAdjust',\n fontstretch: 'fontStretch',\n 'font-stretch': 'fontStretch',\n fontstyle: 'fontStyle',\n 'font-style': 'fontStyle',\n fontvariant: 'fontVariant',\n 'font-variant': 'fontVariant',\n fontweight: 'fontWeight',\n 'font-weight': 'fontWeight',\n format: 'format',\n from: 'from',\n fx: 'fx',\n fy: 'fy',\n g1: 'g1',\n g2: 'g2',\n glyphname: 'glyphName',\n 'glyph-name': 'glyphName',\n glyphorientationhorizontal: 'glyphOrientationHorizontal',\n 'glyph-orientation-horizontal': 'glyphOrientationHorizontal',\n glyphorientationvertical: 'glyphOrientationVertical',\n 'glyph-orientation-vertical': 'glyphOrientationVertical',\n glyphref: 'glyphRef',\n gradienttransform: 'gradientTransform',\n gradientunits: 'gradientUnits',\n hanging: 'hanging',\n horizadvx: 'horizAdvX',\n 'horiz-adv-x': 'horizAdvX',\n horizoriginx: 'horizOriginX',\n 'horiz-origin-x': 'horizOriginX',\n ideographic: 'ideographic',\n imagerendering: 'imageRendering',\n 'image-rendering': 'imageRendering',\n in2: 'in2',\n in: 'in',\n inlist: 'inlist',\n intercept: 'intercept',\n k1: 'k1',\n k2: 'k2',\n k3: 'k3',\n k4: 'k4',\n k: 'k',\n kernelmatrix: 'kernelMatrix',\n kernelunitlength: 'kernelUnitLength',\n kerning: 'kerning',\n keypoints: 'keyPoints',\n keysplines: 'keySplines',\n keytimes: 'keyTimes',\n lengthadjust: 'lengthAdjust',\n letterspacing: 'letterSpacing',\n 'letter-spacing': 'letterSpacing',\n lightingcolor: 'lightingColor',\n 'lighting-color': 'lightingColor',\n limitingconeangle: 'limitingConeAngle',\n local: 'local',\n markerend: 'markerEnd',\n 'marker-end': 'markerEnd',\n markerheight: 'markerHeight',\n markermid: 'markerMid',\n 'marker-mid': 'markerMid',\n markerstart: 'markerStart',\n 'marker-start': 'markerStart',\n markerunits: 'markerUnits',\n markerwidth: 'markerWidth',\n mask: 'mask',\n maskcontentunits: 'maskContentUnits',\n maskunits: 'maskUnits',\n mathematical: 'mathematical',\n mode: 'mode',\n numoctaves: 'numOctaves',\n offset: 'offset',\n opacity: 'opacity',\n operator: 'operator',\n order: 'order',\n orient: 'orient',\n orientation: 'orientation',\n origin: 'origin',\n overflow: 'overflow',\n overlineposition: 'overlinePosition',\n 'overline-position': 'overlinePosition',\n overlinethickness: 'overlineThickness',\n 'overline-thickness': 'overlineThickness',\n paintorder: 'paintOrder',\n 'paint-order': 'paintOrder',\n panose1: 'panose1',\n 'panose-1': 'panose1',\n pathlength: 'pathLength',\n patterncontentunits: 'patternContentUnits',\n patterntransform: 'patternTransform',\n patternunits: 'patternUnits',\n pointerevents: 'pointerEvents',\n 'pointer-events': 'pointerEvents',\n points: 'points',\n pointsatx: 'pointsAtX',\n pointsaty: 'pointsAtY',\n pointsatz: 'pointsAtZ',\n prefix: 'prefix',\n preservealpha: 'preserveAlpha',\n preserveaspectratio: 'preserveAspectRatio',\n primitiveunits: 'primitiveUnits',\n property: 'property',\n r: 'r',\n radius: 'radius',\n refx: 'refX',\n refy: 'refY',\n renderingintent: 'renderingIntent',\n 'rendering-intent': 'renderingIntent',\n repeatcount: 'repeatCount',\n repeatdur: 'repeatDur',\n requiredextensions: 'requiredExtensions',\n requiredfeatures: 'requiredFeatures',\n resource: 'resource',\n restart: 'restart',\n result: 'result',\n results: 'results',\n rotate: 'rotate',\n rx: 'rx',\n ry: 'ry',\n scale: 'scale',\n security: 'security',\n seed: 'seed',\n shaperendering: 'shapeRendering',\n 'shape-rendering': 'shapeRendering',\n slope: 'slope',\n spacing: 'spacing',\n specularconstant: 'specularConstant',\n specularexponent: 'specularExponent',\n speed: 'speed',\n spreadmethod: 'spreadMethod',\n startoffset: 'startOffset',\n stddeviation: 'stdDeviation',\n stemh: 'stemh',\n stemv: 'stemv',\n stitchtiles: 'stitchTiles',\n stopcolor: 'stopColor',\n 'stop-color': 'stopColor',\n stopopacity: 'stopOpacity',\n 'stop-opacity': 'stopOpacity',\n strikethroughposition: 'strikethroughPosition',\n 'strikethrough-position': 'strikethroughPosition',\n strikethroughthickness: 'strikethroughThickness',\n 'strikethrough-thickness': 'strikethroughThickness',\n string: 'string',\n stroke: 'stroke',\n strokedasharray: 'strokeDasharray',\n 'stroke-dasharray': 'strokeDasharray',\n strokedashoffset: 'strokeDashoffset',\n 'stroke-dashoffset': 'strokeDashoffset',\n strokelinecap: 'strokeLinecap',\n 'stroke-linecap': 'strokeLinecap',\n strokelinejoin: 'strokeLinejoin',\n 'stroke-linejoin': 'strokeLinejoin',\n strokemiterlimit: 'strokeMiterlimit',\n 'stroke-miterlimit': 'strokeMiterlimit',\n strokewidth: 'strokeWidth',\n 'stroke-width': 'strokeWidth',\n strokeopacity: 'strokeOpacity',\n 'stroke-opacity': 'strokeOpacity',\n suppresscontenteditablewarning: 'suppressContentEditableWarning',\n suppresshydrationwarning: 'suppressHydrationWarning',\n surfacescale: 'surfaceScale',\n systemlanguage: 'systemLanguage',\n tablevalues: 'tableValues',\n targetx: 'targetX',\n targety: 'targetY',\n textanchor: 'textAnchor',\n 'text-anchor': 'textAnchor',\n textdecoration: 'textDecoration',\n 'text-decoration': 'textDecoration',\n textlength: 'textLength',\n textrendering: 'textRendering',\n 'text-rendering': 'textRendering',\n to: 'to',\n transform: 'transform',\n typeof: 'typeof',\n u1: 'u1',\n u2: 'u2',\n underlineposition: 'underlinePosition',\n 'underline-position': 'underlinePosition',\n underlinethickness: 'underlineThickness',\n 'underline-thickness': 'underlineThickness',\n unicode: 'unicode',\n unicodebidi: 'unicodeBidi',\n 'unicode-bidi': 'unicodeBidi',\n unicoderange: 'unicodeRange',\n 'unicode-range': 'unicodeRange',\n unitsperem: 'unitsPerEm',\n 'units-per-em': 'unitsPerEm',\n unselectable: 'unselectable',\n valphabetic: 'vAlphabetic',\n 'v-alphabetic': 'vAlphabetic',\n values: 'values',\n vectoreffect: 'vectorEffect',\n 'vector-effect': 'vectorEffect',\n version: 'version',\n vertadvy: 'vertAdvY',\n 'vert-adv-y': 'vertAdvY',\n vertoriginx: 'vertOriginX',\n 'vert-origin-x': 'vertOriginX',\n vertoriginy: 'vertOriginY',\n 'vert-origin-y': 'vertOriginY',\n vhanging: 'vHanging',\n 'v-hanging': 'vHanging',\n videographic: 'vIdeographic',\n 'v-ideographic': 'vIdeographic',\n viewbox: 'viewBox',\n viewtarget: 'viewTarget',\n visibility: 'visibility',\n vmathematical: 'vMathematical',\n 'v-mathematical': 'vMathematical',\n vocab: 'vocab',\n widths: 'widths',\n wordspacing: 'wordSpacing',\n 'word-spacing': 'wordSpacing',\n writingmode: 'writingMode',\n 'writing-mode': 'writingMode',\n x1: 'x1',\n x2: 'x2',\n x: 'x',\n xchannelselector: 'xChannelSelector',\n xheight: 'xHeight',\n 'x-height': 'xHeight',\n xlinkactuate: 'xlinkActuate',\n 'xlink:actuate': 'xlinkActuate',\n xlinkarcrole: 'xlinkArcrole',\n 'xlink:arcrole': 'xlinkArcrole',\n xlinkhref: 'xlinkHref',\n 'xlink:href': 'xlinkHref',\n xlinkrole: 'xlinkRole',\n 'xlink:role': 'xlinkRole',\n xlinkshow: 'xlinkShow',\n 'xlink:show': 'xlinkShow',\n xlinktitle: 'xlinkTitle',\n 'xlink:title': 'xlinkTitle',\n xlinktype: 'xlinkType',\n 'xlink:type': 'xlinkType',\n xmlbase: 'xmlBase',\n 'xml:base': 'xmlBase',\n xmllang: 'xmlLang',\n 'xml:lang': 'xmlLang',\n xmlns: 'xmlns',\n 'xml:space': 'xmlSpace',\n xmlnsxlink: 'xmlnsXlink',\n 'xmlns:xlink': 'xmlnsXlink',\n xmlspace: 'xmlSpace',\n y1: 'y1',\n y2: 'y2',\n y: 'y',\n ychannelselector: 'yChannelSelector',\n z: 'z',\n zoomandpan: 'zoomAndPan'\n };\n\n var validateProperty$1 = function validateProperty$1() {};\n\n {\n var warnedProperties$1 = {};\n var EVENT_NAME_REGEX = /^on./;\n var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;\n var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');\n var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');\n\n validateProperty$1 = function validateProperty$1(tagName, name, value, eventRegistry) {\n if (hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {\n return true;\n }\n\n var lowerCasedName = name.toLowerCase();\n\n if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {\n error('React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');\n warnedProperties$1[name] = true;\n return true;\n } // We can't rely on the event system being injected on the server.\n\n\n if (eventRegistry != null) {\n var registrationNameDependencies = eventRegistry.registrationNameDependencies,\n possibleRegistrationNames = eventRegistry.possibleRegistrationNames;\n\n if (registrationNameDependencies.hasOwnProperty(name)) {\n return true;\n }\n\n var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;\n\n if (registrationName != null) {\n error('Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (EVENT_NAME_REGEX.test(name)) {\n error('Unknown event handler property `%s`. It will be ignored.', name);\n warnedProperties$1[name] = true;\n return true;\n }\n } else if (EVENT_NAME_REGEX.test(name)) {\n // If no event plugins have been injected, we are in a server environment.\n // So we can't tell if the event name is correct for sure, but we can filter\n // out known bad ones like `onclick`. We can't suggest a specific replacement though.\n if (INVALID_EVENT_NAME_REGEX.test(name)) {\n error('Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);\n }\n\n warnedProperties$1[name] = true;\n return true;\n } // Let the ARIA attribute hook validate ARIA attributes\n\n\n if (rARIA$1.test(name) || rARIACamel$1.test(name)) {\n return true;\n }\n\n if (lowerCasedName === 'innerhtml') {\n error('Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (lowerCasedName === 'aria') {\n error('The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {\n error('Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', _typeof(value));\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (typeof value === 'number' && isNaN(value)) {\n error('Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);\n warnedProperties$1[name] = true;\n return true;\n }\n\n var propertyInfo = getPropertyInfo(name);\n var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; // Known attributes should match the casing specified in the property config.\n\n if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {\n var standardName = possibleStandardNames[lowerCasedName];\n\n if (standardName !== name) {\n error('Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);\n warnedProperties$1[name] = true;\n return true;\n }\n } else if (!isReserved && name !== lowerCasedName) {\n // Unknown attributes should have lowercase casing since that's how they\n // will be cased anyway with server rendering.\n error('React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {\n if (value) {\n error('Received `%s` for a non-boolean attribute `%s`.\\n\\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s=\"%s\" or %s={value.toString()}.', value, name, name, value, name);\n } else {\n error('Received `%s` for a non-boolean attribute `%s`.\\n\\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s=\"%s\" or %s={value.toString()}.\\n\\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);\n }\n\n warnedProperties$1[name] = true;\n return true;\n } // Now that we've validated casing, do not validate\n // data types for reserved props\n\n\n if (isReserved) {\n return true;\n } // Warn when a known attribute is a bad type\n\n\n if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {\n warnedProperties$1[name] = true;\n return false;\n } // Warn when passing the strings 'false' or 'true' into a boolean prop\n\n\n if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {\n error('Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string \"false\".', name, value);\n warnedProperties$1[name] = true;\n return true;\n }\n\n return true;\n };\n }\n\n var warnUnknownProperties = function warnUnknownProperties(type, props, eventRegistry) {\n {\n var unknownProps = [];\n\n for (var key in props) {\n var isValid = validateProperty$1(type, key, props[key], eventRegistry);\n\n if (!isValid) {\n unknownProps.push(key);\n }\n }\n\n var unknownPropString = unknownProps.map(function (prop) {\n return '`' + prop + '`';\n }).join(', ');\n\n if (unknownProps.length === 1) {\n error('Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type);\n } else if (unknownProps.length > 1) {\n error('Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type);\n }\n }\n };\n\n function validateProperties$2(type, props, eventRegistry) {\n if (isCustomComponent(type, props)) {\n return;\n }\n\n warnUnknownProperties(type, props, eventRegistry);\n }\n\n var warnValidStyle = function warnValidStyle() {};\n\n {\n // 'msTransform' is correct, but the other prefixes should be capitalized\n var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;\n var msPattern = /^-ms-/;\n var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon\n\n var badStyleValueWithSemicolonPattern = /;\\s*$/;\n var warnedStyleNames = {};\n var warnedStyleValues = {};\n var warnedForNaNValue = false;\n var warnedForInfinityValue = false;\n\n var camelize = function camelize(string) {\n return string.replace(hyphenPattern, function (_, character) {\n return character.toUpperCase();\n });\n };\n\n var warnHyphenatedStyleName = function warnHyphenatedStyleName(name) {\n if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n return;\n }\n\n warnedStyleNames[name] = true;\n error('Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests\n // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix\n // is converted to lowercase `ms`.\n camelize(name.replace(msPattern, 'ms-')));\n };\n\n var warnBadVendoredStyleName = function warnBadVendoredStyleName(name) {\n if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n return;\n }\n\n warnedStyleNames[name] = true;\n error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));\n };\n\n var warnStyleValueWithSemicolon = function warnStyleValueWithSemicolon(name, value) {\n if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {\n return;\n }\n\n warnedStyleValues[value] = true;\n error(\"Style property values shouldn't contain a semicolon. \" + 'Try \"%s: %s\" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));\n };\n\n var warnStyleValueIsNaN = function warnStyleValueIsNaN(name, value) {\n if (warnedForNaNValue) {\n return;\n }\n\n warnedForNaNValue = true;\n error('`NaN` is an invalid value for the `%s` css style property.', name);\n };\n\n var warnStyleValueIsInfinity = function warnStyleValueIsInfinity(name, value) {\n if (warnedForInfinityValue) {\n return;\n }\n\n warnedForInfinityValue = true;\n error('`Infinity` is an invalid value for the `%s` css style property.', name);\n };\n\n warnValidStyle = function warnValidStyle(name, value) {\n if (name.indexOf('-') > -1) {\n warnHyphenatedStyleName(name);\n } else if (badVendoredStyleNamePattern.test(name)) {\n warnBadVendoredStyleName(name);\n } else if (badStyleValueWithSemicolonPattern.test(value)) {\n warnStyleValueWithSemicolon(name, value);\n }\n\n if (typeof value === 'number') {\n if (isNaN(value)) {\n warnStyleValueIsNaN(name, value);\n } else if (!isFinite(value)) {\n warnStyleValueIsInfinity(name, value);\n }\n }\n };\n }\n var warnValidStyle$1 = warnValidStyle; // code copied and modified from escape-html\n\n var matchHtmlRegExp = /[\"'&<>]/;\n /**\n * Escapes special characters and HTML entities in a given html string.\n *\n * @param {string} string HTML string to escape for later insertion\n * @return {string}\n * @public\n */\n\n function escapeHtml(string) {\n {\n checkHtmlStringCoercion(string);\n }\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34:\n // \"\n escape = '"';\n break;\n\n case 38:\n // &\n escape = '&';\n break;\n\n case 39:\n // '\n escape = '''; // modified from escape-html; used to be '''\n\n break;\n\n case 60:\n // <\n escape = '<';\n break;\n\n case 62:\n // >\n escape = '>';\n break;\n\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index ? html + str.substring(lastIndex, index) : html;\n } // end code copied and modified from escape-html\n\n /**\n * Escapes text to prevent scripting attacks.\n *\n * @param {*} text Text value to escape.\n * @return {string} An escaped string.\n */\n\n\n function escapeTextForBrowser(text) {\n if (typeof text === 'boolean' || typeof text === 'number') {\n // this shortcircuit helps perf for types that we know will never have\n // special characters, especially given that this function is used often\n // for numeric dom ids.\n return '' + text;\n }\n\n return escapeHtml(text);\n }\n\n var uppercasePattern = /([A-Z])/g;\n var msPattern$1 = /^ms-/;\n /**\n * Hyphenates a camelcased CSS property name, for example:\n *\n * > hyphenateStyleName('backgroundColor')\n * < \"background-color\"\n * > hyphenateStyleName('MozTransition')\n * < \"-moz-transition\"\n * > hyphenateStyleName('msTransition')\n * < \"-ms-transition\"\n *\n * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix\n * is converted to `-ms-`.\n */\n\n function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern$1, '-ms-');\n } // and any newline or tab are filtered out as if they're not part of the URL.\n // https://url.spec.whatwg.org/#url-parsing\n // Tab or newline are defined as \\r\\n\\t:\n // https://infra.spec.whatwg.org/#ascii-tab-or-newline\n // A C0 control is a code point in the range \\u0000 NULL to \\u001F\n // INFORMATION SEPARATOR ONE, inclusive:\n // https://infra.spec.whatwg.org/#c0-control-or-space\n\n /* eslint-disable max-len */\n\n\n var isJavaScriptProtocol = /^[\\u0000-\\u001F ]*j[\\r\\n\\t]*a[\\r\\n\\t]*v[\\r\\n\\t]*a[\\r\\n\\t]*s[\\r\\n\\t]*c[\\r\\n\\t]*r[\\r\\n\\t]*i[\\r\\n\\t]*p[\\r\\n\\t]*t[\\r\\n\\t]*\\:/i;\n var didWarn = false;\n\n function sanitizeURL(url) {\n {\n if (!didWarn && isJavaScriptProtocol.test(url)) {\n didWarn = true;\n error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));\n }\n }\n }\n\n var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\n function isArray(a) {\n return isArrayImpl(a);\n }\n\n var startInlineScript = stringToPrecomputedChunk('');\n var startScriptSrc = stringToPrecomputedChunk('');\n /**\n * This escaping function is designed to work with bootstrapScriptContent only.\n * because we know we are escaping the entire script. We can avoid for instance\n * escaping html comment string sequences that are valid javascript as well because\n * if there are no sebsequent ');\n\n function writeCompletedSegmentInstruction(destination, responseState, contentSegmentID) {\n writeChunk(destination, responseState.startInlineScript);\n\n if (!responseState.sentCompleteSegmentFunction) {\n // The first time we write this, we'll need to include the full implementation.\n responseState.sentCompleteSegmentFunction = true;\n writeChunk(destination, completeSegmentScript1Full);\n } else {\n // Future calls can just reuse the same function.\n writeChunk(destination, completeSegmentScript1Partial);\n }\n\n writeChunk(destination, responseState.segmentPrefix);\n var formattedID = stringToChunk(contentSegmentID.toString(16));\n writeChunk(destination, formattedID);\n writeChunk(destination, completeSegmentScript2);\n writeChunk(destination, responseState.placeholderPrefix);\n writeChunk(destination, formattedID);\n return writeChunkAndReturn(destination, completeSegmentScript3);\n }\n\n var completeBoundaryScript1Full = stringToPrecomputedChunk(completeBoundaryFunction + ';$RC(\"');\n var completeBoundaryScript1Partial = stringToPrecomputedChunk('$RC(\"');\n var completeBoundaryScript2 = stringToPrecomputedChunk('\",\"');\n var completeBoundaryScript3 = stringToPrecomputedChunk('\")');\n\n function writeCompletedBoundaryInstruction(destination, responseState, boundaryID, contentSegmentID) {\n writeChunk(destination, responseState.startInlineScript);\n\n if (!responseState.sentCompleteBoundaryFunction) {\n // The first time we write this, we'll need to include the full implementation.\n responseState.sentCompleteBoundaryFunction = true;\n writeChunk(destination, completeBoundaryScript1Full);\n } else {\n // Future calls can just reuse the same function.\n writeChunk(destination, completeBoundaryScript1Partial);\n }\n\n if (boundaryID === null) {\n throw new Error('An ID must have been assigned before we can complete the boundary.');\n }\n\n var formattedContentID = stringToChunk(contentSegmentID.toString(16));\n writeChunk(destination, boundaryID);\n writeChunk(destination, completeBoundaryScript2);\n writeChunk(destination, responseState.segmentPrefix);\n writeChunk(destination, formattedContentID);\n return writeChunkAndReturn(destination, completeBoundaryScript3);\n }\n\n var clientRenderScript1Full = stringToPrecomputedChunk(clientRenderFunction + ';$RX(\"');\n var clientRenderScript1Partial = stringToPrecomputedChunk('$RX(\"');\n var clientRenderScript1A = stringToPrecomputedChunk('\"');\n var clientRenderScript2 = stringToPrecomputedChunk(')');\n var clientRenderErrorScriptArgInterstitial = stringToPrecomputedChunk(',');\n\n function writeClientRenderBoundaryInstruction(destination, responseState, boundaryID, errorDigest, errorMessage, errorComponentStack) {\n writeChunk(destination, responseState.startInlineScript);\n\n if (!responseState.sentClientRenderFunction) {\n // The first time we write this, we'll need to include the full implementation.\n responseState.sentClientRenderFunction = true;\n writeChunk(destination, clientRenderScript1Full);\n } else {\n // Future calls can just reuse the same function.\n writeChunk(destination, clientRenderScript1Partial);\n }\n\n if (boundaryID === null) {\n throw new Error('An ID must have been assigned before we can complete the boundary.');\n }\n\n writeChunk(destination, boundaryID);\n writeChunk(destination, clientRenderScript1A);\n\n if (errorDigest || errorMessage || errorComponentStack) {\n writeChunk(destination, clientRenderErrorScriptArgInterstitial);\n writeChunk(destination, stringToChunk(escapeJSStringsForInstructionScripts(errorDigest || '')));\n }\n\n if (errorMessage || errorComponentStack) {\n writeChunk(destination, clientRenderErrorScriptArgInterstitial);\n writeChunk(destination, stringToChunk(escapeJSStringsForInstructionScripts(errorMessage || '')));\n }\n\n if (errorComponentStack) {\n writeChunk(destination, clientRenderErrorScriptArgInterstitial);\n writeChunk(destination, stringToChunk(escapeJSStringsForInstructionScripts(errorComponentStack)));\n }\n\n return writeChunkAndReturn(destination, clientRenderScript2);\n }\n\n var regexForJSStringsInScripts = /[<\\u2028\\u2029]/g;\n\n function escapeJSStringsForInstructionScripts(input) {\n var escaped = JSON.stringify(input);\n return escaped.replace(regexForJSStringsInScripts, function (match) {\n switch (match) {\n // santizing breaking out of strings and script tags\n case '<':\n return \"\\\\u003c\";\n\n case \"\\u2028\":\n return \"\\\\u2028\";\n\n case \"\\u2029\":\n return \"\\\\u2029\";\n\n default:\n {\n // eslint-disable-next-line react-internal/prod-error-codes\n throw new Error('escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React');\n }\n }\n });\n }\n\n function createResponseState$1(generateStaticMarkup, identifierPrefix) {\n var responseState = createResponseState(identifierPrefix, undefined);\n return {\n // Keep this in sync with ReactDOMServerFormatConfig\n bootstrapChunks: responseState.bootstrapChunks,\n startInlineScript: responseState.startInlineScript,\n placeholderPrefix: responseState.placeholderPrefix,\n segmentPrefix: responseState.segmentPrefix,\n boundaryPrefix: responseState.boundaryPrefix,\n idPrefix: responseState.idPrefix,\n nextSuspenseID: responseState.nextSuspenseID,\n sentCompleteSegmentFunction: responseState.sentCompleteSegmentFunction,\n sentCompleteBoundaryFunction: responseState.sentCompleteBoundaryFunction,\n sentClientRenderFunction: responseState.sentClientRenderFunction,\n // This is an extra field for the legacy renderer\n generateStaticMarkup: generateStaticMarkup\n };\n }\n\n function createRootFormatContext() {\n return {\n insertionMode: HTML_MODE,\n // We skip the root mode because we don't want to emit the DOCTYPE in legacy mode.\n selectedValue: null\n };\n }\n\n function pushTextInstance$1(target, text, responseState, textEmbedded) {\n if (responseState.generateStaticMarkup) {\n target.push(stringToChunk(escapeTextForBrowser(text)));\n return false;\n } else {\n return pushTextInstance(target, text, responseState, textEmbedded);\n }\n }\n\n function pushSegmentFinale$1(target, responseState, lastPushedText, textEmbedded) {\n if (responseState.generateStaticMarkup) {\n return;\n } else {\n return pushSegmentFinale(target, responseState, lastPushedText, textEmbedded);\n }\n }\n\n function writeStartCompletedSuspenseBoundary$1(destination, responseState) {\n if (responseState.generateStaticMarkup) {\n // A completed boundary is done and doesn't need a representation in the HTML\n // if we're not going to be hydrating it.\n return true;\n }\n\n return writeStartCompletedSuspenseBoundary(destination);\n }\n\n function writeStartClientRenderedSuspenseBoundary$1(destination, responseState, // flushing these error arguments are not currently supported in this legacy streaming format.\n errorDigest, errorMessage, errorComponentStack) {\n if (responseState.generateStaticMarkup) {\n // A client rendered boundary is done and doesn't need a representation in the HTML\n // since we'll never hydrate it. This is arguably an error in static generation.\n return true;\n }\n\n return writeStartClientRenderedSuspenseBoundary(destination, responseState, errorDigest, errorMessage, errorComponentStack);\n }\n\n function writeEndCompletedSuspenseBoundary$1(destination, responseState) {\n if (responseState.generateStaticMarkup) {\n return true;\n }\n\n return writeEndCompletedSuspenseBoundary(destination);\n }\n\n function writeEndClientRenderedSuspenseBoundary$1(destination, responseState) {\n if (responseState.generateStaticMarkup) {\n return true;\n }\n\n return writeEndClientRenderedSuspenseBoundary(destination);\n }\n\n var assign = Object.assign; // ATTENTION\n // When adding new symbols to this file,\n // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n // The Symbol used to tag the ReactElement-like types.\n\n var REACT_ELEMENT_TYPE = Symbol.for('react.element');\n var REACT_PORTAL_TYPE = Symbol.for('react.portal');\n var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\n var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\n var REACT_PROFILER_TYPE = Symbol.for('react.profiler');\n var REACT_PROVIDER_TYPE = Symbol.for('react.provider');\n var REACT_CONTEXT_TYPE = Symbol.for('react.context');\n var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\n var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\n var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\n var REACT_MEMO_TYPE = Symbol.for('react.memo');\n var REACT_LAZY_TYPE = Symbol.for('react.lazy');\n var REACT_SCOPE_TYPE = Symbol.for('react.scope');\n var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode');\n var REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden');\n var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for('react.default_value');\n var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator';\n\n function getIteratorFn(maybeIterable) {\n if (maybeIterable === null || _typeof(maybeIterable) !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n }\n\n function getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n } // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\n function getContextName(type) {\n return type.displayName || 'Context';\n } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\n function getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n }\n\n if (_typeof(type) === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n } // Helpers to patch console.logs to avoid logging during side-effect free\n // replaying on render function. This currently only patches the object\n // lazily which won't cover if the log function was extracted eagerly.\n // We could also eagerly patch the method.\n\n\n var disabledDepth = 0;\n var prevLog;\n var prevInfo;\n var prevWarn;\n var prevError;\n var prevGroup;\n var prevGroupCollapsed;\n var prevGroupEnd;\n\n function disabledLog() {}\n\n disabledLog.__reactDisabledLog = true;\n\n function disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n }\n\n function reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n }\n\n var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\n var prefix;\n\n function describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n }\n\n var reentry = false;\n var componentFrameCache;\n {\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n }\n\n function describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if (!fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function Fake() {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function set() {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if ((typeof Reflect === \"undefined\" ? \"undefined\" : _typeof(Reflect)) === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n return syntheticFrame;\n }\n\n function describeClassComponentFrame(ctor, source, ownerFn) {\n {\n return describeNativeComponentFrame(ctor, true);\n }\n }\n\n function describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n }\n\n function shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n }\n\n function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (_typeof(type) === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n }\n\n var loggedTypeFailures = {};\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\n function setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n }\n\n function checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + _typeof(typeSpecs[typeSpecName]) + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, _typeof(error$1));\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n error('Failed %s type: %s', location, error$1.message);\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n }\n\n var warnedAboutMissingGetChildContext;\n {\n warnedAboutMissingGetChildContext = {};\n }\n var emptyContextObject = {};\n {\n Object.freeze(emptyContextObject);\n }\n\n function getMaskedContext(type, unmaskedContext) {\n {\n var contextTypes = type.contextTypes;\n\n if (!contextTypes) {\n return emptyContextObject;\n }\n\n var context = {};\n\n for (var key in contextTypes) {\n context[key] = unmaskedContext[key];\n }\n\n {\n var name = getComponentNameFromType(type) || 'Unknown';\n checkPropTypes(contextTypes, context, 'context', name);\n }\n return context;\n }\n }\n\n function processChildContext(instance, type, parentContext, childContextTypes) {\n {\n // TODO (bvaughn) Replace this behavior with an invariant() in the future.\n // It has only been added in Fiber to match the (unintentional) behavior in Stack.\n if (typeof instance.getChildContext !== 'function') {\n {\n var componentName = getComponentNameFromType(type) || 'Unknown';\n\n if (!warnedAboutMissingGetChildContext[componentName]) {\n warnedAboutMissingGetChildContext[componentName] = true;\n error('%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName);\n }\n }\n return parentContext;\n }\n\n var childContext = instance.getChildContext();\n\n for (var contextKey in childContext) {\n if (!(contextKey in childContextTypes)) {\n throw new Error((getComponentNameFromType(type) || 'Unknown') + \".getChildContext(): key \\\"\" + contextKey + \"\\\" is not defined in childContextTypes.\");\n }\n }\n\n {\n var name = getComponentNameFromType(type) || 'Unknown';\n checkPropTypes(childContextTypes, childContext, 'child context', name);\n }\n return assign({}, parentContext, childContext);\n }\n }\n\n var rendererSigil;\n {\n // Use this to detect multiple renderers using the same context\n rendererSigil = {};\n } // Used to store the parent path of all context overrides in a shared linked list.\n // Forming a reverse tree.\n\n var rootContextSnapshot = null; // We assume that this runtime owns the \"current\" field on all ReactContext instances.\n // This global (actually thread local) state represents what state all those \"current\",\n // fields are currently in.\n\n var currentActiveSnapshot = null;\n\n function popNode(prev) {\n {\n prev.context._currentValue2 = prev.parentValue;\n }\n }\n\n function pushNode(next) {\n {\n next.context._currentValue2 = next.value;\n }\n }\n\n function popToNearestCommonAncestor(prev, next) {\n if (prev === next) ;else {\n popNode(prev);\n var parentPrev = prev.parent;\n var parentNext = next.parent;\n\n if (parentPrev === null) {\n if (parentNext !== null) {\n throw new Error('The stacks must reach the root at the same time. This is a bug in React.');\n }\n } else {\n if (parentNext === null) {\n throw new Error('The stacks must reach the root at the same time. This is a bug in React.');\n }\n\n popToNearestCommonAncestor(parentPrev, parentNext);\n } // On the way back, we push the new ones that weren't common.\n\n\n pushNode(next);\n }\n }\n\n function popAllPrevious(prev) {\n popNode(prev);\n var parentPrev = prev.parent;\n\n if (parentPrev !== null) {\n popAllPrevious(parentPrev);\n }\n }\n\n function pushAllNext(next) {\n var parentNext = next.parent;\n\n if (parentNext !== null) {\n pushAllNext(parentNext);\n }\n\n pushNode(next);\n }\n\n function popPreviousToCommonLevel(prev, next) {\n popNode(prev);\n var parentPrev = prev.parent;\n\n if (parentPrev === null) {\n throw new Error('The depth must equal at least at zero before reaching the root. This is a bug in React.');\n }\n\n if (parentPrev.depth === next.depth) {\n // We found the same level. Now we just need to find a shared ancestor.\n popToNearestCommonAncestor(parentPrev, next);\n } else {\n // We must still be deeper.\n popPreviousToCommonLevel(parentPrev, next);\n }\n }\n\n function popNextToCommonLevel(prev, next) {\n var parentNext = next.parent;\n\n if (parentNext === null) {\n throw new Error('The depth must equal at least at zero before reaching the root. This is a bug in React.');\n }\n\n if (prev.depth === parentNext.depth) {\n // We found the same level. Now we just need to find a shared ancestor.\n popToNearestCommonAncestor(prev, parentNext);\n } else {\n // We must still be deeper.\n popNextToCommonLevel(prev, parentNext);\n }\n\n pushNode(next);\n } // Perform context switching to the new snapshot.\n // To make it cheap to read many contexts, while not suspending, we make the switch eagerly by\n // updating all the context's current values. That way reads, always just read the current value.\n // At the cost of updating contexts even if they're never read by this subtree.\n\n\n function switchContext(newSnapshot) {\n // The basic algorithm we need to do is to pop back any contexts that are no longer on the stack.\n // We also need to update any new contexts that are now on the stack with the deepest value.\n // The easiest way to update new contexts is to just reapply them in reverse order from the\n // perspective of the backpointers. To avoid allocating a lot when switching, we use the stack\n // for that. Therefore this algorithm is recursive.\n // 1) First we pop which ever snapshot tree was deepest. Popping old contexts as we go.\n // 2) Then we find the nearest common ancestor from there. Popping old contexts as we go.\n // 3) Then we reapply new contexts on the way back up the stack.\n var prev = currentActiveSnapshot;\n var next = newSnapshot;\n\n if (prev !== next) {\n if (prev === null) {\n // $FlowFixMe: This has to be non-null since it's not equal to prev.\n pushAllNext(next);\n } else if (next === null) {\n popAllPrevious(prev);\n } else if (prev.depth === next.depth) {\n popToNearestCommonAncestor(prev, next);\n } else if (prev.depth > next.depth) {\n popPreviousToCommonLevel(prev, next);\n } else {\n popNextToCommonLevel(prev, next);\n }\n\n currentActiveSnapshot = next;\n }\n }\n\n function pushProvider(context, nextValue) {\n var prevValue;\n {\n prevValue = context._currentValue2;\n context._currentValue2 = nextValue;\n {\n if (context._currentRenderer2 !== undefined && context._currentRenderer2 !== null && context._currentRenderer2 !== rendererSigil) {\n error('Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.');\n }\n\n context._currentRenderer2 = rendererSigil;\n }\n }\n var prevNode = currentActiveSnapshot;\n var newNode = {\n parent: prevNode,\n depth: prevNode === null ? 0 : prevNode.depth + 1,\n context: context,\n parentValue: prevValue,\n value: nextValue\n };\n currentActiveSnapshot = newNode;\n return newNode;\n }\n\n function popProvider(context) {\n var prevSnapshot = currentActiveSnapshot;\n\n if (prevSnapshot === null) {\n throw new Error('Tried to pop a Context at the root of the app. This is a bug in React.');\n }\n\n {\n if (prevSnapshot.context !== context) {\n error('The parent context is not the expected context. This is probably a bug in React.');\n }\n }\n {\n var _value = prevSnapshot.parentValue;\n\n if (_value === REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED) {\n prevSnapshot.context._currentValue2 = prevSnapshot.context._defaultValue;\n } else {\n prevSnapshot.context._currentValue2 = _value;\n }\n\n {\n if (context._currentRenderer2 !== undefined && context._currentRenderer2 !== null && context._currentRenderer2 !== rendererSigil) {\n error('Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.');\n }\n\n context._currentRenderer2 = rendererSigil;\n }\n }\n return currentActiveSnapshot = prevSnapshot.parent;\n }\n\n function getActiveContext() {\n return currentActiveSnapshot;\n }\n\n function readContext(context) {\n var value = context._currentValue2;\n return value;\n }\n /**\n * `ReactInstanceMap` maintains a mapping from a public facing stateful\n * instance (key) and the internal representation (value). This allows public\n * methods to accept the user facing instance as an argument and map them back\n * to internal methods.\n *\n * Note that this module is currently shared and assumed to be stateless.\n * If this becomes an actual Map, that will break.\n */\n\n\n function get(key) {\n return key._reactInternals;\n }\n\n function set(key, value) {\n key._reactInternals = value;\n }\n\n var didWarnAboutNoopUpdateForComponent = {};\n var didWarnAboutDeprecatedWillMount = {};\n var didWarnAboutUninitializedState;\n var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;\n var didWarnAboutLegacyLifecyclesAndDerivedState;\n var didWarnAboutUndefinedDerivedState;\n var warnOnUndefinedDerivedState;\n var warnOnInvalidCallback;\n var didWarnAboutDirectlyAssigningPropsToState;\n var didWarnAboutContextTypeAndContextTypes;\n var didWarnAboutInvalidateContextType;\n {\n didWarnAboutUninitializedState = new Set();\n didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();\n didWarnAboutLegacyLifecyclesAndDerivedState = new Set();\n didWarnAboutDirectlyAssigningPropsToState = new Set();\n didWarnAboutUndefinedDerivedState = new Set();\n didWarnAboutContextTypeAndContextTypes = new Set();\n didWarnAboutInvalidateContextType = new Set();\n var didWarnOnInvalidCallback = new Set();\n\n warnOnInvalidCallback = function warnOnInvalidCallback(callback, callerName) {\n if (callback === null || typeof callback === 'function') {\n return;\n }\n\n var key = callerName + '_' + callback;\n\n if (!didWarnOnInvalidCallback.has(key)) {\n didWarnOnInvalidCallback.add(key);\n error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);\n }\n };\n\n warnOnUndefinedDerivedState = function warnOnUndefinedDerivedState(type, partialState) {\n if (partialState === undefined) {\n var componentName = getComponentNameFromType(type) || 'Component';\n\n if (!didWarnAboutUndefinedDerivedState.has(componentName)) {\n didWarnAboutUndefinedDerivedState.add(componentName);\n error('%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName);\n }\n }\n };\n }\n\n function warnNoop(publicInstance, callerName) {\n {\n var _constructor = publicInstance.constructor;\n var componentName = _constructor && getComponentNameFromType(_constructor) || 'ReactClass';\n var warningKey = componentName + '.' + callerName;\n\n if (didWarnAboutNoopUpdateForComponent[warningKey]) {\n return;\n }\n\n error('%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMount() on the server. ' + 'This is a no-op.\\n\\nPlease check the code for the %s component.', callerName, callerName, componentName);\n didWarnAboutNoopUpdateForComponent[warningKey] = true;\n }\n }\n\n var classComponentUpdater = {\n isMounted: function isMounted(inst) {\n return false;\n },\n enqueueSetState: function enqueueSetState(inst, payload, callback) {\n var internals = get(inst);\n\n if (internals.queue === null) {\n warnNoop(inst, 'setState');\n } else {\n internals.queue.push(payload);\n {\n if (callback !== undefined && callback !== null) {\n warnOnInvalidCallback(callback, 'setState');\n }\n }\n }\n },\n enqueueReplaceState: function enqueueReplaceState(inst, payload, callback) {\n var internals = get(inst);\n internals.replace = true;\n internals.queue = [payload];\n {\n if (callback !== undefined && callback !== null) {\n warnOnInvalidCallback(callback, 'setState');\n }\n }\n },\n enqueueForceUpdate: function enqueueForceUpdate(inst, callback) {\n var internals = get(inst);\n\n if (internals.queue === null) {\n warnNoop(inst, 'forceUpdate');\n } else {\n {\n if (callback !== undefined && callback !== null) {\n warnOnInvalidCallback(callback, 'setState');\n }\n }\n }\n }\n };\n\n function applyDerivedStateFromProps(instance, ctor, getDerivedStateFromProps, prevState, nextProps) {\n var partialState = getDerivedStateFromProps(nextProps, prevState);\n {\n warnOnUndefinedDerivedState(ctor, partialState);\n } // Merge the partial state and the previous state.\n\n var newState = partialState === null || partialState === undefined ? prevState : assign({}, prevState, partialState);\n return newState;\n }\n\n function constructClassInstance(ctor, props, maskedLegacyContext) {\n var context = emptyContextObject;\n var contextType = ctor.contextType;\n {\n if ('contextType' in ctor) {\n var isValid = // Allow null for conditional declaration\n contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a \n\n if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {\n didWarnAboutInvalidateContextType.add(ctor);\n var addendum = '';\n\n if (contextType === undefined) {\n addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.';\n } else if (_typeof(contextType) !== 'object') {\n addendum = ' However, it is set to a ' + _typeof(contextType) + '.';\n } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {\n addendum = ' Did you accidentally pass the Context.Provider instead?';\n } else if (contextType._context !== undefined) {\n // \n addendum = ' Did you accidentally pass the Context.Consumer instead?';\n } else {\n addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';\n }\n\n error('%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentNameFromType(ctor) || 'Component', addendum);\n }\n }\n }\n\n if (_typeof(contextType) === 'object' && contextType !== null) {\n context = readContext(contextType);\n } else {\n context = maskedLegacyContext;\n }\n\n var instance = new ctor(props, context);\n {\n if (typeof ctor.getDerivedStateFromProps === 'function' && (instance.state === null || instance.state === undefined)) {\n var componentName = getComponentNameFromType(ctor) || 'Component';\n\n if (!didWarnAboutUninitializedState.has(componentName)) {\n didWarnAboutUninitializedState.add(componentName);\n error('`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName);\n }\n } // If new component APIs are defined, \"unsafe\" lifecycles won't be called.\n // Warn about these lifecycles if they are present.\n // Don't warn about react-lifecycles-compat polyfilled methods though.\n\n\n if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') {\n var foundWillMountName = null;\n var foundWillReceivePropsName = null;\n var foundWillUpdateName = null;\n\n if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) {\n foundWillMountName = 'componentWillMount';\n } else if (typeof instance.UNSAFE_componentWillMount === 'function') {\n foundWillMountName = 'UNSAFE_componentWillMount';\n }\n\n if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {\n foundWillReceivePropsName = 'componentWillReceiveProps';\n } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';\n }\n\n if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {\n foundWillUpdateName = 'componentWillUpdate';\n } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') {\n foundWillUpdateName = 'UNSAFE_componentWillUpdate';\n }\n\n if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {\n var _componentName = getComponentNameFromType(ctor) || 'Component';\n\n var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';\n\n if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {\n didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);\n error('Unsafe legacy lifecycles will not be called for components using new component APIs.\\n\\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\\n\\n' + 'The above lifecycles should be removed. Learn more about this warning here:\\n' + 'https://reactjs.org/link/unsafe-component-lifecycles', _componentName, newApiName, foundWillMountName !== null ? \"\\n \" + foundWillMountName : '', foundWillReceivePropsName !== null ? \"\\n \" + foundWillReceivePropsName : '', foundWillUpdateName !== null ? \"\\n \" + foundWillUpdateName : '');\n }\n }\n }\n }\n return instance;\n }\n\n function checkClassInstance(instance, ctor, newProps) {\n {\n var name = getComponentNameFromType(ctor) || 'Component';\n var renderPresent = instance.render;\n\n if (!renderPresent) {\n if (ctor.prototype && typeof ctor.prototype.render === 'function') {\n error('%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name);\n } else {\n error('%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name);\n }\n }\n\n if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) {\n error('getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name);\n }\n\n if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name);\n }\n\n if (instance.propTypes) {\n error('propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name);\n }\n\n if (instance.contextType) {\n error('contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name);\n }\n\n {\n if (instance.contextTypes) {\n error('contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name);\n }\n\n if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {\n didWarnAboutContextTypeAndContextTypes.add(ctor);\n error('%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name);\n }\n }\n\n if (typeof instance.componentShouldUpdate === 'function') {\n error('%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name);\n }\n\n if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') {\n error('%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentNameFromType(ctor) || 'A pure component');\n }\n\n if (typeof instance.componentDidUnmount === 'function') {\n error('%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name);\n }\n\n if (typeof instance.componentDidReceiveProps === 'function') {\n error('%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name);\n }\n\n if (typeof instance.componentWillRecieveProps === 'function') {\n error('%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name);\n }\n\n if (typeof instance.UNSAFE_componentWillRecieveProps === 'function') {\n error('%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name);\n }\n\n var hasMutatedProps = instance.props !== newProps;\n\n if (instance.props !== undefined && hasMutatedProps) {\n error('%s(...): When calling super() in `%s`, make sure to pass ' + \"up the same props that your component's constructor was passed.\", name, name);\n }\n\n if (instance.defaultProps) {\n error('Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name);\n }\n\n if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {\n didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);\n error('%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentNameFromType(ctor));\n }\n\n if (typeof instance.getDerivedStateFromProps === 'function') {\n error('%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name);\n }\n\n if (typeof instance.getDerivedStateFromError === 'function') {\n error('%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name);\n }\n\n if (typeof ctor.getSnapshotBeforeUpdate === 'function') {\n error('%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name);\n }\n\n var _state = instance.state;\n\n if (_state && (_typeof(_state) !== 'object' || isArray(_state))) {\n error('%s.state: must be set to an object or null', name);\n }\n\n if (typeof instance.getChildContext === 'function' && _typeof(ctor.childContextTypes) !== 'object') {\n error('%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name);\n }\n }\n }\n\n function callComponentWillMount(type, instance) {\n var oldState = instance.state;\n\n if (typeof instance.componentWillMount === 'function') {\n {\n if (instance.componentWillMount.__suppressDeprecationWarning !== true) {\n var componentName = getComponentNameFromType(type) || 'Unknown';\n\n if (!didWarnAboutDeprecatedWillMount[componentName]) {\n warn( // keep this warning in sync with ReactStrictModeWarning.js\n 'componentWillMount has been renamed, and is not recommended for use. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\\n\\n' + '* Move code from componentWillMount to componentDidMount (preferred in most cases) ' + 'or the constructor.\\n' + '\\nPlease update the following components: %s', componentName);\n didWarnAboutDeprecatedWillMount[componentName] = true;\n }\n }\n }\n instance.componentWillMount();\n }\n\n if (typeof instance.UNSAFE_componentWillMount === 'function') {\n instance.UNSAFE_componentWillMount();\n }\n\n if (oldState !== instance.state) {\n {\n error('%s.componentWillMount(): Assigning directly to this.state is ' + \"deprecated (except inside a component's \" + 'constructor). Use setState instead.', getComponentNameFromType(type) || 'Component');\n }\n classComponentUpdater.enqueueReplaceState(instance, instance.state, null);\n }\n }\n\n function processUpdateQueue(internalInstance, inst, props, maskedLegacyContext) {\n if (internalInstance.queue !== null && internalInstance.queue.length > 0) {\n var oldQueue = internalInstance.queue;\n var oldReplace = internalInstance.replace;\n internalInstance.queue = null;\n internalInstance.replace = false;\n\n if (oldReplace && oldQueue.length === 1) {\n inst.state = oldQueue[0];\n } else {\n var nextState = oldReplace ? oldQueue[0] : inst.state;\n var dontMutate = true;\n\n for (var i = oldReplace ? 1 : 0; i < oldQueue.length; i++) {\n var partial = oldQueue[i];\n var partialState = typeof partial === 'function' ? partial.call(inst, nextState, props, maskedLegacyContext) : partial;\n\n if (partialState != null) {\n if (dontMutate) {\n dontMutate = false;\n nextState = assign({}, nextState, partialState);\n } else {\n assign(nextState, partialState);\n }\n }\n }\n\n inst.state = nextState;\n }\n } else {\n internalInstance.queue = null;\n }\n } // Invokes the mount life-cycles on a previously never rendered instance.\n\n\n function mountClassInstance(instance, ctor, newProps, maskedLegacyContext) {\n {\n checkClassInstance(instance, ctor, newProps);\n }\n var initialState = instance.state !== undefined ? instance.state : null;\n instance.updater = classComponentUpdater;\n instance.props = newProps;\n instance.state = initialState; // We don't bother initializing the refs object on the server, since we're not going to resolve them anyway.\n // The internal instance will be used to manage updates that happen during this mount.\n\n var internalInstance = {\n queue: [],\n replace: false\n };\n set(instance, internalInstance);\n var contextType = ctor.contextType;\n\n if (_typeof(contextType) === 'object' && contextType !== null) {\n instance.context = readContext(contextType);\n } else {\n instance.context = maskedLegacyContext;\n }\n\n {\n if (instance.state === newProps) {\n var componentName = getComponentNameFromType(ctor) || 'Component';\n\n if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {\n didWarnAboutDirectlyAssigningPropsToState.add(componentName);\n error('%s: It is not recommended to assign props directly to state ' + \"because updates to props won't be reflected in state. \" + 'In most cases, it is better to use props directly.', componentName);\n }\n }\n }\n var getDerivedStateFromProps = ctor.getDerivedStateFromProps;\n\n if (typeof getDerivedStateFromProps === 'function') {\n instance.state = applyDerivedStateFromProps(instance, ctor, getDerivedStateFromProps, initialState, newProps);\n } // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for components using the new APIs.\n\n\n if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {\n callComponentWillMount(ctor, instance); // If we had additional state updates during this life-cycle, let's\n // process them now.\n\n processUpdateQueue(internalInstance, instance, newProps, maskedLegacyContext);\n }\n } // Ids are base 32 strings whose binary representation corresponds to the\n // position of a node in a tree.\n // Every time the tree forks into multiple children, we add additional bits to\n // the left of the sequence that represent the position of the child within the\n // current level of children.\n //\n // 00101 00010001011010101\n // ╰─┬─╯ ╰───────┬───────╯\n // Fork 5 of 20 Parent id\n //\n // The leading 0s are important. In the above example, you only need 3 bits to\n // represent slot 5. However, you need 5 bits to represent all the forks at\n // the current level, so we must account for the empty bits at the end.\n //\n // For this same reason, slots are 1-indexed instead of 0-indexed. Otherwise,\n // the zeroth id at a level would be indistinguishable from its parent.\n //\n // If a node has only one child, and does not materialize an id (i.e. does not\n // contain a useId hook), then we don't need to allocate any space in the\n // sequence. It's treated as a transparent indirection. For example, these two\n // trees produce the same ids:\n //\n // <> <>\n // \n // \n // \n // \n // \n //\n // However, we cannot skip any node that materializes an id. Otherwise, a parent\n // id that does not fork would be indistinguishable from its child id. For\n // example, this tree does not fork, but the parent and child must have\n // different ids.\n //\n // \n // \n // \n //\n // To handle this scenario, every time we materialize an id, we allocate a\n // new level with a single slot. You can think of this as a fork with only one\n // prong, or an array of children with length 1.\n //\n // It's possible for the size of the sequence to exceed 32 bits, the max\n // size for bitwise operations. When this happens, we make more room by\n // converting the right part of the id to a string and storing it in an overflow\n // variable. We use a base 32 string representation, because 32 is the largest\n // power of 2 that is supported by toString(). We want the base to be large so\n // that the resulting ids are compact, and we want the base to be a power of 2\n // because every log2(base) bits corresponds to a single character, i.e. every\n // log2(32) = 5 bits. That means we can lop bits off the end 5 at a time without\n // affecting the final result.\n\n\n var emptyTreeContext = {\n id: 1,\n overflow: ''\n };\n\n function getTreeId(context) {\n var overflow = context.overflow;\n var idWithLeadingBit = context.id;\n var id = idWithLeadingBit & ~getLeadingBit(idWithLeadingBit);\n return id.toString(32) + overflow;\n }\n\n function pushTreeContext(baseContext, totalChildren, index) {\n var baseIdWithLeadingBit = baseContext.id;\n var baseOverflow = baseContext.overflow; // The leftmost 1 marks the end of the sequence, non-inclusive. It's not part\n // of the id; we use it to account for leading 0s.\n\n var baseLength = getBitLength(baseIdWithLeadingBit) - 1;\n var baseId = baseIdWithLeadingBit & ~(1 << baseLength);\n var slot = index + 1;\n var length = getBitLength(totalChildren) + baseLength; // 30 is the max length we can store without overflowing, taking into\n // consideration the leading 1 we use to mark the end of the sequence.\n\n if (length > 30) {\n // We overflowed the bitwise-safe range. Fall back to slower algorithm.\n // This branch assumes the length of the base id is greater than 5; it won't\n // work for smaller ids, because you need 5 bits per character.\n //\n // We encode the id in multiple steps: first the base id, then the\n // remaining digits.\n //\n // Each 5 bit sequence corresponds to a single base 32 character. So for\n // example, if the current id is 23 bits long, we can convert 20 of those\n // bits into a string of 4 characters, with 3 bits left over.\n //\n // First calculate how many bits in the base id represent a complete\n // sequence of characters.\n var numberOfOverflowBits = baseLength - baseLength % 5; // Then create a bitmask that selects only those bits.\n\n var newOverflowBits = (1 << numberOfOverflowBits) - 1; // Select the bits, and convert them to a base 32 string.\n\n var newOverflow = (baseId & newOverflowBits).toString(32); // Now we can remove those bits from the base id.\n\n var restOfBaseId = baseId >> numberOfOverflowBits;\n var restOfBaseLength = baseLength - numberOfOverflowBits; // Finally, encode the rest of the bits using the normal algorithm. Because\n // we made more room, this time it won't overflow.\n\n var restOfLength = getBitLength(totalChildren) + restOfBaseLength;\n var restOfNewBits = slot << restOfBaseLength;\n var id = restOfNewBits | restOfBaseId;\n var overflow = newOverflow + baseOverflow;\n return {\n id: 1 << restOfLength | id,\n overflow: overflow\n };\n } else {\n // Normal path\n var newBits = slot << baseLength;\n\n var _id = newBits | baseId;\n\n var _overflow = baseOverflow;\n return {\n id: 1 << length | _id,\n overflow: _overflow\n };\n }\n }\n\n function getBitLength(number) {\n return 32 - clz32(number);\n }\n\n function getLeadingBit(id) {\n return 1 << getBitLength(id) - 1;\n } // TODO: Math.clz32 is supported in Node 12+. Maybe we can drop the fallback.\n\n\n var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback; // Count leading zeros.\n // Based on:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32\n\n var log = Math.log;\n var LN2 = Math.LN2;\n\n function clz32Fallback(x) {\n var asUint = x >>> 0;\n\n if (asUint === 0) {\n return 32;\n }\n\n return 31 - (log(asUint) / LN2 | 0) | 0;\n }\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n\n\n function is(x, y) {\n return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare\n ;\n }\n\n var objectIs = typeof Object.is === 'function' ? Object.is : is;\n var currentlyRenderingComponent = null;\n var currentlyRenderingTask = null;\n var firstWorkInProgressHook = null;\n var workInProgressHook = null; // Whether the work-in-progress hook is a re-rendered hook\n\n var isReRender = false; // Whether an update was scheduled during the currently executing render pass.\n\n var didScheduleRenderPhaseUpdate = false; // Counts the number of useId hooks in this component\n\n var localIdCounter = 0; // Lazily created map of render-phase updates\n\n var renderPhaseUpdates = null; // Counter to prevent infinite loops.\n\n var numberOfReRenders = 0;\n var RE_RENDER_LIMIT = 25;\n var isInHookUserCodeInDev = false; // In DEV, this is the name of the currently executing primitive hook\n\n var currentHookNameInDev;\n\n function resolveCurrentlyRenderingComponent() {\n if (currentlyRenderingComponent === null) {\n throw new Error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\\n' + '2. You might be breaking the Rules of Hooks\\n' + '3. You might have more than one copy of React in the same app\\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');\n }\n\n {\n if (isInHookUserCodeInDev) {\n error('Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://reactjs.org/link/rules-of-hooks');\n }\n }\n return currentlyRenderingComponent;\n }\n\n function areHookInputsEqual(nextDeps, prevDeps) {\n if (prevDeps === null) {\n {\n error('%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);\n }\n return false;\n }\n\n {\n // Don't bother comparing lengths in prod because these arrays should be\n // passed inline.\n if (nextDeps.length !== prevDeps.length) {\n error('The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\\n\\n' + 'Previous: %s\\n' + 'Incoming: %s', currentHookNameInDev, \"[\" + nextDeps.join(', ') + \"]\", \"[\" + prevDeps.join(', ') + \"]\");\n }\n }\n\n for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {\n if (objectIs(nextDeps[i], prevDeps[i])) {\n continue;\n }\n\n return false;\n }\n\n return true;\n }\n\n function createHook() {\n if (numberOfReRenders > 0) {\n throw new Error('Rendered more hooks than during the previous render');\n }\n\n return {\n memoizedState: null,\n queue: null,\n next: null\n };\n }\n\n function createWorkInProgressHook() {\n if (workInProgressHook === null) {\n // This is the first hook in the list\n if (firstWorkInProgressHook === null) {\n isReRender = false;\n firstWorkInProgressHook = workInProgressHook = createHook();\n } else {\n // There's already a work-in-progress. Reuse it.\n isReRender = true;\n workInProgressHook = firstWorkInProgressHook;\n }\n } else {\n if (workInProgressHook.next === null) {\n isReRender = false; // Append to the end of the list\n\n workInProgressHook = workInProgressHook.next = createHook();\n } else {\n // There's already a work-in-progress. Reuse it.\n isReRender = true;\n workInProgressHook = workInProgressHook.next;\n }\n }\n\n return workInProgressHook;\n }\n\n function prepareToUseHooks(task, componentIdentity) {\n currentlyRenderingComponent = componentIdentity;\n currentlyRenderingTask = task;\n {\n isInHookUserCodeInDev = false;\n } // The following should have already been reset\n // didScheduleRenderPhaseUpdate = false;\n // localIdCounter = 0;\n // firstWorkInProgressHook = null;\n // numberOfReRenders = 0;\n // renderPhaseUpdates = null;\n // workInProgressHook = null;\n\n localIdCounter = 0;\n }\n\n function finishHooks(Component, props, children, refOrContext) {\n // This must be called after every function component to prevent hooks from\n // being used in classes.\n while (didScheduleRenderPhaseUpdate) {\n // Updates were scheduled during the render phase. They are stored in\n // the `renderPhaseUpdates` map. Call the component again, reusing the\n // work-in-progress hooks and applying the additional updates on top. Keep\n // restarting until no more updates are scheduled.\n didScheduleRenderPhaseUpdate = false;\n localIdCounter = 0;\n numberOfReRenders += 1; // Start over from the beginning of the list\n\n workInProgressHook = null;\n children = Component(props, refOrContext);\n }\n\n resetHooksState();\n return children;\n }\n\n function checkDidRenderIdHook() {\n // This should be called immediately after every finishHooks call.\n // Conceptually, it's part of the return value of finishHooks; it's only a\n // separate function to avoid using an array tuple.\n var didRenderIdHook = localIdCounter !== 0;\n return didRenderIdHook;\n } // Reset the internal hooks state if an error occurs while rendering a component\n\n\n function resetHooksState() {\n {\n isInHookUserCodeInDev = false;\n }\n currentlyRenderingComponent = null;\n currentlyRenderingTask = null;\n didScheduleRenderPhaseUpdate = false;\n firstWorkInProgressHook = null;\n numberOfReRenders = 0;\n renderPhaseUpdates = null;\n workInProgressHook = null;\n }\n\n function readContext$1(context) {\n {\n if (isInHookUserCodeInDev) {\n error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');\n }\n }\n return readContext(context);\n }\n\n function useContext(context) {\n {\n currentHookNameInDev = 'useContext';\n }\n resolveCurrentlyRenderingComponent();\n return readContext(context);\n }\n\n function basicStateReducer(state, action) {\n // $FlowFixMe: Flow doesn't like mixed types\n return typeof action === 'function' ? action(state) : action;\n }\n\n function useState(initialState) {\n {\n currentHookNameInDev = 'useState';\n }\n return useReducer(basicStateReducer, // useReducer has a special case to support lazy useState initializers\n initialState);\n }\n\n function useReducer(reducer, initialArg, init) {\n {\n if (reducer !== basicStateReducer) {\n currentHookNameInDev = 'useReducer';\n }\n }\n currentlyRenderingComponent = resolveCurrentlyRenderingComponent();\n workInProgressHook = createWorkInProgressHook();\n\n if (isReRender) {\n // This is a re-render. Apply the new render phase updates to the previous\n // current hook.\n var queue = workInProgressHook.queue;\n var dispatch = queue.dispatch;\n\n if (renderPhaseUpdates !== null) {\n // Render phase updates are stored in a map of queue -> linked list\n var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);\n\n if (firstRenderPhaseUpdate !== undefined) {\n renderPhaseUpdates.delete(queue);\n var newState = workInProgressHook.memoizedState;\n var update = firstRenderPhaseUpdate;\n\n do {\n // Process this render phase update. We don't have to check the\n // priority because it will always be the same as the current\n // render's.\n var action = update.action;\n {\n isInHookUserCodeInDev = true;\n }\n newState = reducer(newState, action);\n {\n isInHookUserCodeInDev = false;\n }\n update = update.next;\n } while (update !== null);\n\n workInProgressHook.memoizedState = newState;\n return [newState, dispatch];\n }\n }\n\n return [workInProgressHook.memoizedState, dispatch];\n } else {\n {\n isInHookUserCodeInDev = true;\n }\n var initialState;\n\n if (reducer === basicStateReducer) {\n // Special case for `useState`.\n initialState = typeof initialArg === 'function' ? initialArg() : initialArg;\n } else {\n initialState = init !== undefined ? init(initialArg) : initialArg;\n }\n\n {\n isInHookUserCodeInDev = false;\n }\n workInProgressHook.memoizedState = initialState;\n\n var _queue = workInProgressHook.queue = {\n last: null,\n dispatch: null\n };\n\n var _dispatch = _queue.dispatch = dispatchAction.bind(null, currentlyRenderingComponent, _queue);\n\n return [workInProgressHook.memoizedState, _dispatch];\n }\n }\n\n function useMemo(nextCreate, deps) {\n currentlyRenderingComponent = resolveCurrentlyRenderingComponent();\n workInProgressHook = createWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n\n if (workInProgressHook !== null) {\n var prevState = workInProgressHook.memoizedState;\n\n if (prevState !== null) {\n if (nextDeps !== null) {\n var prevDeps = prevState[1];\n\n if (areHookInputsEqual(nextDeps, prevDeps)) {\n return prevState[0];\n }\n }\n }\n }\n\n {\n isInHookUserCodeInDev = true;\n }\n var nextValue = nextCreate();\n {\n isInHookUserCodeInDev = false;\n }\n workInProgressHook.memoizedState = [nextValue, nextDeps];\n return nextValue;\n }\n\n function useRef(initialValue) {\n currentlyRenderingComponent = resolveCurrentlyRenderingComponent();\n workInProgressHook = createWorkInProgressHook();\n var previousRef = workInProgressHook.memoizedState;\n\n if (previousRef === null) {\n var ref = {\n current: initialValue\n };\n {\n Object.seal(ref);\n }\n workInProgressHook.memoizedState = ref;\n return ref;\n } else {\n return previousRef;\n }\n }\n\n function useLayoutEffect(create, inputs) {\n {\n currentHookNameInDev = 'useLayoutEffect';\n error('useLayoutEffect does nothing on the server, because its effect cannot ' + \"be encoded into the server renderer's output format. This will lead \" + 'to a mismatch between the initial, non-hydrated UI and the intended ' + 'UI. To avoid this, useLayoutEffect should only be used in ' + 'components that render exclusively on the client. ' + 'See https://reactjs.org/link/uselayouteffect-ssr for common fixes.');\n }\n }\n\n function dispatchAction(componentIdentity, queue, action) {\n if (numberOfReRenders >= RE_RENDER_LIMIT) {\n throw new Error('Too many re-renders. React limits the number of renders to prevent ' + 'an infinite loop.');\n }\n\n if (componentIdentity === currentlyRenderingComponent) {\n // This is a render phase update. Stash it in a lazily-created map of\n // queue -> linked list of updates. After this render pass, we'll restart\n // and apply the stashed updates on top of the work-in-progress hook.\n didScheduleRenderPhaseUpdate = true;\n var update = {\n action: action,\n next: null\n };\n\n if (renderPhaseUpdates === null) {\n renderPhaseUpdates = new Map();\n }\n\n var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);\n\n if (firstRenderPhaseUpdate === undefined) {\n renderPhaseUpdates.set(queue, update);\n } else {\n // Append the update to the end of the list.\n var lastRenderPhaseUpdate = firstRenderPhaseUpdate;\n\n while (lastRenderPhaseUpdate.next !== null) {\n lastRenderPhaseUpdate = lastRenderPhaseUpdate.next;\n }\n\n lastRenderPhaseUpdate.next = update;\n }\n }\n }\n\n function useCallback(callback, deps) {\n return useMemo(function () {\n return callback;\n }, deps);\n } // TODO Decide on how to implement this hook for server rendering.\n // If a mutation occurs during render, consider triggering a Suspense boundary\n // and falling back to client rendering.\n\n\n function useMutableSource(source, getSnapshot, subscribe) {\n resolveCurrentlyRenderingComponent();\n return getSnapshot(source._source);\n }\n\n function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {\n if (getServerSnapshot === undefined) {\n throw new Error('Missing getServerSnapshot, which is required for ' + 'server-rendered content. Will revert to client rendering.');\n }\n\n return getServerSnapshot();\n }\n\n function useDeferredValue(value) {\n resolveCurrentlyRenderingComponent();\n return value;\n }\n\n function unsupportedStartTransition() {\n throw new Error('startTransition cannot be called during server rendering.');\n }\n\n function useTransition() {\n resolveCurrentlyRenderingComponent();\n return [false, unsupportedStartTransition];\n }\n\n function useId() {\n var task = currentlyRenderingTask;\n var treeId = getTreeId(task.treeContext);\n var responseState = currentResponseState;\n\n if (responseState === null) {\n throw new Error('Invalid hook call. Hooks can only be called inside of the body of a function component.');\n }\n\n var localId = localIdCounter++;\n return makeId(responseState, treeId, localId);\n }\n\n function noop() {}\n\n var Dispatcher = {\n readContext: readContext$1,\n useContext: useContext,\n useMemo: useMemo,\n useReducer: useReducer,\n useRef: useRef,\n useState: useState,\n useInsertionEffect: noop,\n useLayoutEffect: useLayoutEffect,\n useCallback: useCallback,\n // useImperativeHandle is not run in the server environment\n useImperativeHandle: noop,\n // Effects are not run in the server environment.\n useEffect: noop,\n // Debugging effect\n useDebugValue: noop,\n useDeferredValue: useDeferredValue,\n useTransition: useTransition,\n useId: useId,\n // Subscriptions are not setup in a server environment.\n useMutableSource: useMutableSource,\n useSyncExternalStore: useSyncExternalStore\n };\n var currentResponseState = null;\n\n function setCurrentResponseState(responseState) {\n currentResponseState = responseState;\n }\n\n function getStackByComponentStackNode(componentStack) {\n try {\n var info = '';\n var node = componentStack;\n\n do {\n switch (node.tag) {\n case 0:\n info += describeBuiltInComponentFrame(node.type, null, null);\n break;\n\n case 1:\n info += describeFunctionComponentFrame(node.type, null, null);\n break;\n\n case 2:\n info += describeClassComponentFrame(node.type, null, null);\n break;\n }\n\n node = node.parent;\n } while (node);\n\n return info;\n } catch (x) {\n return '\\nError generating stack: ' + x.message + '\\n' + x.stack;\n }\n }\n\n var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;\n var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n var PENDING = 0;\n var COMPLETED = 1;\n var FLUSHED = 2;\n var ABORTED = 3;\n var ERRORED = 4;\n var OPEN = 0;\n var CLOSING = 1;\n var CLOSED = 2; // This is a default heuristic for how to split up the HTML content into progressive\n // loading. Our goal is to be able to display additional new content about every 500ms.\n // Faster than that is unnecessary and should be throttled on the client. It also\n // adds unnecessary overhead to do more splits. We don't know if it's a higher or lower\n // end device but higher end suffer less from the overhead than lower end does from\n // not getting small enough pieces. We error on the side of low end.\n // We base this on low end 3G speeds which is about 500kbits per second. We assume\n // that there can be a reasonable drop off from max bandwidth which leaves you with\n // as little as 80%. We can receive half of that each 500ms - at best. In practice,\n // a little bandwidth is lost to processing and contention - e.g. CSS and images that\n // are downloaded along with the main content. So we estimate about half of that to be\n // the lower end throughput. In other words, we expect that you can at least show\n // about 12.5kb of content per 500ms. Not counting starting latency for the first\n // paint.\n // 500 * 1024 / 8 * .8 * 0.5 / 2\n\n var DEFAULT_PROGRESSIVE_CHUNK_SIZE = 12800;\n\n function defaultErrorHandler(error) {\n console['error'](error); // Don't transform to our wrapper\n\n return null;\n }\n\n function noop$1() {}\n\n function createRequest(children, responseState, rootFormatContext, progressiveChunkSize, onError, onAllReady, onShellReady, onShellError, onFatalError) {\n var pingedTasks = [];\n var abortSet = new Set();\n var request = {\n destination: null,\n responseState: responseState,\n progressiveChunkSize: progressiveChunkSize === undefined ? DEFAULT_PROGRESSIVE_CHUNK_SIZE : progressiveChunkSize,\n status: OPEN,\n fatalError: null,\n nextSegmentId: 0,\n allPendingTasks: 0,\n pendingRootTasks: 0,\n completedRootSegment: null,\n abortableTasks: abortSet,\n pingedTasks: pingedTasks,\n clientRenderedBoundaries: [],\n completedBoundaries: [],\n partialBoundaries: [],\n onError: onError === undefined ? defaultErrorHandler : onError,\n onAllReady: onAllReady === undefined ? noop$1 : onAllReady,\n onShellReady: onShellReady === undefined ? noop$1 : onShellReady,\n onShellError: onShellError === undefined ? noop$1 : onShellError,\n onFatalError: onFatalError === undefined ? noop$1 : onFatalError\n }; // This segment represents the root fallback.\n\n var rootSegment = createPendingSegment(request, 0, null, rootFormatContext, // Root segments are never embedded in Text on either edge\n false, false); // There is no parent so conceptually, we're unblocked to flush this segment.\n\n rootSegment.parentFlushed = true;\n var rootTask = createTask(request, children, null, rootSegment, abortSet, emptyContextObject, rootContextSnapshot, emptyTreeContext);\n pingedTasks.push(rootTask);\n return request;\n }\n\n function pingTask(request, task) {\n var pingedTasks = request.pingedTasks;\n pingedTasks.push(task);\n\n if (pingedTasks.length === 1) {\n scheduleWork(function () {\n return performWork(request);\n });\n }\n }\n\n function createSuspenseBoundary(request, fallbackAbortableTasks) {\n return {\n id: UNINITIALIZED_SUSPENSE_BOUNDARY_ID,\n rootSegmentID: -1,\n parentFlushed: false,\n pendingTasks: 0,\n forceClientRender: false,\n completedSegments: [],\n byteSize: 0,\n fallbackAbortableTasks: fallbackAbortableTasks,\n errorDigest: null\n };\n }\n\n function createTask(request, node, blockedBoundary, blockedSegment, abortSet, legacyContext, context, treeContext) {\n request.allPendingTasks++;\n\n if (blockedBoundary === null) {\n request.pendingRootTasks++;\n } else {\n blockedBoundary.pendingTasks++;\n }\n\n var task = {\n node: node,\n ping: function ping() {\n return pingTask(request, task);\n },\n blockedBoundary: blockedBoundary,\n blockedSegment: blockedSegment,\n abortSet: abortSet,\n legacyContext: legacyContext,\n context: context,\n treeContext: treeContext\n };\n {\n task.componentStack = null;\n }\n abortSet.add(task);\n return task;\n }\n\n function createPendingSegment(request, index, boundary, formatContext, lastPushedText, textEmbedded) {\n return {\n status: PENDING,\n id: -1,\n // lazily assigned later\n index: index,\n parentFlushed: false,\n chunks: [],\n children: [],\n formatContext: formatContext,\n boundary: boundary,\n lastPushedText: lastPushedText,\n textEmbedded: textEmbedded\n };\n } // DEV-only global reference to the currently executing task\n\n\n var currentTaskInDEV = null;\n\n function getCurrentStackInDEV() {\n {\n if (currentTaskInDEV === null || currentTaskInDEV.componentStack === null) {\n return '';\n }\n\n return getStackByComponentStackNode(currentTaskInDEV.componentStack);\n }\n }\n\n function pushBuiltInComponentStackInDEV(task, type) {\n {\n task.componentStack = {\n tag: 0,\n parent: task.componentStack,\n type: type\n };\n }\n }\n\n function pushFunctionComponentStackInDEV(task, type) {\n {\n task.componentStack = {\n tag: 1,\n parent: task.componentStack,\n type: type\n };\n }\n }\n\n function pushClassComponentStackInDEV(task, type) {\n {\n task.componentStack = {\n tag: 2,\n parent: task.componentStack,\n type: type\n };\n }\n }\n\n function popComponentStackInDEV(task) {\n {\n if (task.componentStack === null) {\n error('Unexpectedly popped too many stack frames. This is a bug in React.');\n } else {\n task.componentStack = task.componentStack.parent;\n }\n }\n } // stash the component stack of an unwinding error until it is processed\n\n\n var lastBoundaryErrorComponentStackDev = null;\n\n function captureBoundaryErrorDetailsDev(boundary, error) {\n {\n var errorMessage;\n\n if (typeof error === 'string') {\n errorMessage = error;\n } else if (error && typeof error.message === 'string') {\n errorMessage = error.message;\n } else {\n // eslint-disable-next-line react-internal/safe-string-coercion\n errorMessage = String(error);\n }\n\n var errorComponentStack = lastBoundaryErrorComponentStackDev || getCurrentStackInDEV();\n lastBoundaryErrorComponentStackDev = null;\n boundary.errorMessage = errorMessage;\n boundary.errorComponentStack = errorComponentStack;\n }\n }\n\n function logRecoverableError(request, error) {\n // If this callback errors, we intentionally let that error bubble up to become a fatal error\n // so that someone fixes the error reporting instead of hiding it.\n var errorDigest = request.onError(error);\n\n if (errorDigest != null && typeof errorDigest !== 'string') {\n // eslint-disable-next-line react-internal/prod-error-codes\n throw new Error(\"onError returned something with a type other than \\\"string\\\". onError should return a string and may return null or undefined but must not return anything else. It received something of type \\\"\" + _typeof(errorDigest) + \"\\\" instead\");\n }\n\n return errorDigest;\n }\n\n function fatalError(request, error) {\n // This is called outside error handling code such as if the root errors outside\n // a suspense boundary or if the root suspense boundary's fallback errors.\n // It's also called if React itself or its host configs errors.\n var onShellError = request.onShellError;\n onShellError(error);\n var onFatalError = request.onFatalError;\n onFatalError(error);\n\n if (request.destination !== null) {\n request.status = CLOSED;\n closeWithError(request.destination, error);\n } else {\n request.status = CLOSING;\n request.fatalError = error;\n }\n }\n\n function renderSuspenseBoundary(request, task, props) {\n pushBuiltInComponentStackInDEV(task, 'Suspense');\n var parentBoundary = task.blockedBoundary;\n var parentSegment = task.blockedSegment; // Each time we enter a suspense boundary, we split out into a new segment for\n // the fallback so that we can later replace that segment with the content.\n // This also lets us split out the main content even if it doesn't suspend,\n // in case it ends up generating a large subtree of content.\n\n var fallback = props.fallback;\n var content = props.children;\n var fallbackAbortSet = new Set();\n var newBoundary = createSuspenseBoundary(request, fallbackAbortSet);\n var insertionIndex = parentSegment.chunks.length; // The children of the boundary segment is actually the fallback.\n\n var boundarySegment = createPendingSegment(request, insertionIndex, newBoundary, parentSegment.formatContext, // boundaries never require text embedding at their edges because comment nodes bound them\n false, false);\n parentSegment.children.push(boundarySegment); // The parentSegment has a child Segment at this index so we reset the lastPushedText marker on the parent\n\n parentSegment.lastPushedText = false; // This segment is the actual child content. We can start rendering that immediately.\n\n var contentRootSegment = createPendingSegment(request, 0, null, parentSegment.formatContext, // boundaries never require text embedding at their edges because comment nodes bound them\n false, false); // We mark the root segment as having its parent flushed. It's not really flushed but there is\n // no parent segment so there's nothing to wait on.\n\n contentRootSegment.parentFlushed = true; // Currently this is running synchronously. We could instead schedule this to pingedTasks.\n // I suspect that there might be some efficiency benefits from not creating the suspended task\n // and instead just using the stack if possible.\n // TODO: Call this directly instead of messing with saving and restoring contexts.\n // We can reuse the current context and task to render the content immediately without\n // context switching. We just need to temporarily switch which boundary and which segment\n // we're writing to. If something suspends, it'll spawn new suspended task with that context.\n\n task.blockedBoundary = newBoundary;\n task.blockedSegment = contentRootSegment;\n\n try {\n // We use the safe form because we don't handle suspending here. Only error handling.\n renderNode(request, task, content);\n pushSegmentFinale$1(contentRootSegment.chunks, request.responseState, contentRootSegment.lastPushedText, contentRootSegment.textEmbedded);\n contentRootSegment.status = COMPLETED;\n queueCompletedSegment(newBoundary, contentRootSegment);\n\n if (newBoundary.pendingTasks === 0) {\n // This must have been the last segment we were waiting on. This boundary is now complete.\n // Therefore we won't need the fallback. We early return so that we don't have to create\n // the fallback.\n popComponentStackInDEV(task);\n return;\n }\n } catch (error) {\n contentRootSegment.status = ERRORED;\n newBoundary.forceClientRender = true;\n newBoundary.errorDigest = logRecoverableError(request, error);\n {\n captureBoundaryErrorDetailsDev(newBoundary, error);\n } // We don't need to decrement any task numbers because we didn't spawn any new task.\n // We don't need to schedule any task because we know the parent has written yet.\n // We do need to fallthrough to create the fallback though.\n } finally {\n task.blockedBoundary = parentBoundary;\n task.blockedSegment = parentSegment;\n } // We create suspended task for the fallback because we don't want to actually work\n // on it yet in case we finish the main content, so we queue for later.\n\n\n var suspendedFallbackTask = createTask(request, fallback, parentBoundary, boundarySegment, fallbackAbortSet, task.legacyContext, task.context, task.treeContext);\n {\n suspendedFallbackTask.componentStack = task.componentStack;\n } // TODO: This should be queued at a separate lower priority queue so that we only work\n // on preparing fallbacks if we don't have any more main content to task on.\n\n request.pingedTasks.push(suspendedFallbackTask);\n popComponentStackInDEV(task);\n }\n\n function renderHostElement(request, task, type, props) {\n pushBuiltInComponentStackInDEV(task, type);\n var segment = task.blockedSegment;\n var children = pushStartInstance(segment.chunks, type, props, request.responseState, segment.formatContext);\n segment.lastPushedText = false;\n var prevContext = segment.formatContext;\n segment.formatContext = getChildFormatContext(prevContext, type, props); // We use the non-destructive form because if something suspends, we still\n // need to pop back up and finish this subtree of HTML.\n\n renderNode(request, task, children); // We expect that errors will fatal the whole task and that we don't need\n // the correct context. Therefore this is not in a finally.\n\n segment.formatContext = prevContext;\n pushEndInstance(segment.chunks, type);\n segment.lastPushedText = false;\n popComponentStackInDEV(task);\n }\n\n function shouldConstruct$1(Component) {\n return Component.prototype && Component.prototype.isReactComponent;\n }\n\n function renderWithHooks(request, task, Component, props, secondArg) {\n var componentIdentity = {};\n prepareToUseHooks(task, componentIdentity);\n var result = Component(props, secondArg);\n return finishHooks(Component, props, result, secondArg);\n }\n\n function finishClassComponent(request, task, instance, Component, props) {\n var nextChildren = instance.render();\n {\n if (instance.props !== props) {\n if (!didWarnAboutReassigningProps) {\n error('It looks like %s is reassigning its own `this.props` while rendering. ' + 'This is not supported and can lead to confusing bugs.', getComponentNameFromType(Component) || 'a component');\n }\n\n didWarnAboutReassigningProps = true;\n }\n }\n {\n var childContextTypes = Component.childContextTypes;\n\n if (childContextTypes !== null && childContextTypes !== undefined) {\n var previousContext = task.legacyContext;\n var mergedContext = processChildContext(instance, Component, previousContext, childContextTypes);\n task.legacyContext = mergedContext;\n renderNodeDestructive(request, task, nextChildren);\n task.legacyContext = previousContext;\n return;\n }\n }\n renderNodeDestructive(request, task, nextChildren);\n }\n\n function renderClassComponent(request, task, Component, props) {\n pushClassComponentStackInDEV(task, Component);\n var maskedContext = getMaskedContext(Component, task.legacyContext);\n var instance = constructClassInstance(Component, props, maskedContext);\n mountClassInstance(instance, Component, props, maskedContext);\n finishClassComponent(request, task, instance, Component, props);\n popComponentStackInDEV(task);\n }\n\n var didWarnAboutBadClass = {};\n var didWarnAboutModulePatternComponent = {};\n var didWarnAboutContextTypeOnFunctionComponent = {};\n var didWarnAboutGetDerivedStateOnFunctionComponent = {};\n var didWarnAboutReassigningProps = false;\n var didWarnAboutDefaultPropsOnFunctionComponent = {};\n var didWarnAboutGenerators = false;\n var didWarnAboutMaps = false;\n var hasWarnedAboutUsingContextAsConsumer = false; // This would typically be a function component but we still support module pattern\n // components for some reason.\n\n function renderIndeterminateComponent(request, task, Component, props) {\n var legacyContext;\n {\n legacyContext = getMaskedContext(Component, task.legacyContext);\n }\n pushFunctionComponentStackInDEV(task, Component);\n {\n if (Component.prototype && typeof Component.prototype.render === 'function') {\n var componentName = getComponentNameFromType(Component) || 'Unknown';\n\n if (!didWarnAboutBadClass[componentName]) {\n error(\"The <%s /> component appears to have a render method, but doesn't extend React.Component. \" + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName);\n didWarnAboutBadClass[componentName] = true;\n }\n }\n }\n var value = renderWithHooks(request, task, Component, props, legacyContext);\n var hasId = checkDidRenderIdHook();\n {\n // Support for module components is deprecated and is removed behind a flag.\n // Whether or not it would crash later, we want to show a good message in DEV first.\n if (_typeof(value) === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {\n var _componentName = getComponentNameFromType(Component) || 'Unknown';\n\n if (!didWarnAboutModulePatternComponent[_componentName]) {\n error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + \"If you can't use a class try assigning the prototype on the function as a workaround. \" + \"`%s.prototype = React.Component.prototype`. Don't use an arrow function since it \" + 'cannot be called with `new` by React.', _componentName, _componentName, _componentName);\n didWarnAboutModulePatternComponent[_componentName] = true;\n }\n }\n }\n\n if ( // Run these checks in production only if the flag is off.\n // Eventually we'll delete this branch altogether.\n _typeof(value) === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {\n {\n var _componentName2 = getComponentNameFromType(Component) || 'Unknown';\n\n if (!didWarnAboutModulePatternComponent[_componentName2]) {\n error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + \"If you can't use a class try assigning the prototype on the function as a workaround. \" + \"`%s.prototype = React.Component.prototype`. Don't use an arrow function since it \" + 'cannot be called with `new` by React.', _componentName2, _componentName2, _componentName2);\n didWarnAboutModulePatternComponent[_componentName2] = true;\n }\n }\n mountClassInstance(value, Component, props, legacyContext);\n finishClassComponent(request, task, value, Component, props);\n } else {\n {\n validateFunctionComponentInDev(Component);\n } // We're now successfully past this task, and we don't have to pop back to\n // the previous task every again, so we can use the destructive recursive form.\n\n if (hasId) {\n // This component materialized an id. We treat this as its own level, with\n // a single \"child\" slot.\n var prevTreeContext = task.treeContext;\n var totalChildren = 1;\n var index = 0;\n task.treeContext = pushTreeContext(prevTreeContext, totalChildren, index);\n\n try {\n renderNodeDestructive(request, task, value);\n } finally {\n task.treeContext = prevTreeContext;\n }\n } else {\n renderNodeDestructive(request, task, value);\n }\n }\n\n popComponentStackInDEV(task);\n }\n\n function validateFunctionComponentInDev(Component) {\n {\n if (Component) {\n if (Component.childContextTypes) {\n error('%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component');\n }\n }\n\n if (Component.defaultProps !== undefined) {\n var componentName = getComponentNameFromType(Component) || 'Unknown';\n\n if (!didWarnAboutDefaultPropsOnFunctionComponent[componentName]) {\n error('%s: Support for defaultProps will be removed from function components ' + 'in a future major release. Use JavaScript default parameters instead.', componentName);\n didWarnAboutDefaultPropsOnFunctionComponent[componentName] = true;\n }\n }\n\n if (typeof Component.getDerivedStateFromProps === 'function') {\n var _componentName3 = getComponentNameFromType(Component) || 'Unknown';\n\n if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) {\n error('%s: Function components do not support getDerivedStateFromProps.', _componentName3);\n didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true;\n }\n }\n\n if (_typeof(Component.contextType) === 'object' && Component.contextType !== null) {\n var _componentName4 = getComponentNameFromType(Component) || 'Unknown';\n\n if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) {\n error('%s: Function components do not support contextType.', _componentName4);\n didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true;\n }\n }\n }\n }\n\n function resolveDefaultProps(Component, baseProps) {\n if (Component && Component.defaultProps) {\n // Resolve default props. Taken from ReactElement\n var props = assign({}, baseProps);\n var defaultProps = Component.defaultProps;\n\n for (var propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n\n return props;\n }\n\n return baseProps;\n }\n\n function renderForwardRef(request, task, type, props, ref) {\n pushFunctionComponentStackInDEV(task, type.render);\n var children = renderWithHooks(request, task, type.render, props, ref);\n var hasId = checkDidRenderIdHook();\n\n if (hasId) {\n // This component materialized an id. We treat this as its own level, with\n // a single \"child\" slot.\n var prevTreeContext = task.treeContext;\n var totalChildren = 1;\n var index = 0;\n task.treeContext = pushTreeContext(prevTreeContext, totalChildren, index);\n\n try {\n renderNodeDestructive(request, task, children);\n } finally {\n task.treeContext = prevTreeContext;\n }\n } else {\n renderNodeDestructive(request, task, children);\n }\n\n popComponentStackInDEV(task);\n }\n\n function renderMemo(request, task, type, props, ref) {\n var innerType = type.type;\n var resolvedProps = resolveDefaultProps(innerType, props);\n renderElement(request, task, innerType, resolvedProps, ref);\n }\n\n function renderContextConsumer(request, task, context, props) {\n // The logic below for Context differs depending on PROD or DEV mode. In\n // DEV mode, we create a separate object for Context.Consumer that acts\n // like a proxy to Context. This proxy object adds unnecessary code in PROD\n // so we use the old behaviour (Context.Consumer references Context) to\n // reduce size and overhead. The separate object references context via\n // a property called \"_context\", which also gives us the ability to check\n // in DEV mode if this property exists or not and warn if it does not.\n {\n if (context._context === undefined) {\n // This may be because it's a Context (rather than a Consumer).\n // Or it may be because it's older React where they're the same thing.\n // We only want to warn if we're sure it's a new React.\n if (context !== context.Consumer) {\n if (!hasWarnedAboutUsingContextAsConsumer) {\n hasWarnedAboutUsingContextAsConsumer = true;\n error('Rendering directly is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?');\n }\n }\n } else {\n context = context._context;\n }\n }\n var render = props.children;\n {\n if (typeof render !== 'function') {\n error('A context consumer was rendered with multiple children, or a child ' + \"that isn't a function. A context consumer expects a single child \" + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.');\n }\n }\n var newValue = readContext(context);\n var newChildren = render(newValue);\n renderNodeDestructive(request, task, newChildren);\n }\n\n function renderContextProvider(request, task, type, props) {\n var context = type._context;\n var value = props.value;\n var children = props.children;\n var prevSnapshot;\n {\n prevSnapshot = task.context;\n }\n task.context = pushProvider(context, value);\n renderNodeDestructive(request, task, children);\n task.context = popProvider(context);\n {\n if (prevSnapshot !== task.context) {\n error('Popping the context provider did not return back to the original snapshot. This is a bug in React.');\n }\n }\n }\n\n function renderLazyComponent(request, task, lazyComponent, props, ref) {\n pushBuiltInComponentStackInDEV(task, 'Lazy');\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n var Component = init(payload);\n var resolvedProps = resolveDefaultProps(Component, props);\n renderElement(request, task, Component, resolvedProps, ref);\n popComponentStackInDEV(task);\n }\n\n function renderElement(request, task, type, props, ref) {\n if (typeof type === 'function') {\n if (shouldConstruct$1(type)) {\n renderClassComponent(request, task, type, props);\n return;\n } else {\n renderIndeterminateComponent(request, task, type, props);\n return;\n }\n }\n\n if (typeof type === 'string') {\n renderHostElement(request, task, type, props);\n return;\n }\n\n switch (type) {\n // TODO: LegacyHidden acts the same as a fragment. This only works\n // because we currently assume that every instance of LegacyHidden is\n // accompanied by a host component wrapper. In the hidden mode, the host\n // component is given a `hidden` attribute, which ensures that the\n // initial HTML is not visible. To support the use of LegacyHidden as a\n // true fragment, without an extra DOM node, we would have to hide the\n // initial HTML in some other way.\n // TODO: Add REACT_OFFSCREEN_TYPE here too with the same capability.\n case REACT_LEGACY_HIDDEN_TYPE:\n case REACT_DEBUG_TRACING_MODE_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_FRAGMENT_TYPE:\n {\n renderNodeDestructive(request, task, props.children);\n return;\n }\n\n case REACT_SUSPENSE_LIST_TYPE:\n {\n pushBuiltInComponentStackInDEV(task, 'SuspenseList'); // TODO: SuspenseList should control the boundaries.\n\n renderNodeDestructive(request, task, props.children);\n popComponentStackInDEV(task);\n return;\n }\n\n case REACT_SCOPE_TYPE:\n {\n throw new Error('ReactDOMServer does not yet support scope components.');\n }\n // eslint-disable-next-line-no-fallthrough\n\n case REACT_SUSPENSE_TYPE:\n {\n {\n renderSuspenseBoundary(request, task, props);\n }\n return;\n }\n }\n\n if (_typeof(type) === 'object' && type !== null) {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n {\n renderForwardRef(request, task, type, props, ref);\n return;\n }\n\n case REACT_MEMO_TYPE:\n {\n renderMemo(request, task, type, props, ref);\n return;\n }\n\n case REACT_PROVIDER_TYPE:\n {\n renderContextProvider(request, task, type, props);\n return;\n }\n\n case REACT_CONTEXT_TYPE:\n {\n renderContextConsumer(request, task, type, props);\n return;\n }\n\n case REACT_LAZY_TYPE:\n {\n renderLazyComponent(request, task, type, props);\n return;\n }\n }\n }\n\n var info = '';\n {\n if (type === undefined || _typeof(type) === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and \" + 'named imports.';\n }\n }\n throw new Error('Element type is invalid: expected a string (for built-in ' + 'components) or a class/function (for composite components) ' + (\"but got: \" + (type == null ? type : _typeof(type)) + \".\" + info));\n }\n\n function validateIterable(iterable, iteratorFn) {\n {\n // We don't support rendering Generators because it's a mutation.\n // See https://github.com/facebook/react/issues/12995\n if (typeof Symbol === 'function' && // $FlowFixMe Flow doesn't know about toStringTag\n iterable[Symbol.toStringTag] === 'Generator') {\n if (!didWarnAboutGenerators) {\n error('Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.');\n }\n\n didWarnAboutGenerators = true;\n } // Warn about using Maps as children\n\n\n if (iterable.entries === iteratorFn) {\n if (!didWarnAboutMaps) {\n error('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');\n }\n\n didWarnAboutMaps = true;\n }\n }\n }\n\n function renderNodeDestructive(request, task, node) {\n {\n // In Dev we wrap renderNodeDestructiveImpl in a try / catch so we can capture\n // a component stack at the right place in the tree. We don't do this in renderNode\n // becuase it is not called at every layer of the tree and we may lose frames\n try {\n return renderNodeDestructiveImpl(request, task, node);\n } catch (x) {\n if (_typeof(x) === 'object' && x !== null && typeof x.then === 'function') ;else {\n // This is an error, stash the component stack if it is null.\n lastBoundaryErrorComponentStackDev = lastBoundaryErrorComponentStackDev !== null ? lastBoundaryErrorComponentStackDev : getCurrentStackInDEV();\n } // rethrow so normal suspense logic can handle thrown value accordingly\n\n throw x;\n }\n }\n } // This function by it self renders a node and consumes the task by mutating it\n // to update the current execution state.\n\n\n function renderNodeDestructiveImpl(request, task, node) {\n // Stash the node we're working on. We'll pick up from this task in case\n // something suspends.\n task.node = node; // Handle object types\n\n if (_typeof(node) === 'object' && node !== null) {\n switch (node.$$typeof) {\n case REACT_ELEMENT_TYPE:\n {\n var element = node;\n var type = element.type;\n var props = element.props;\n var ref = element.ref;\n renderElement(request, task, type, props, ref);\n return;\n }\n\n case REACT_PORTAL_TYPE:\n throw new Error('Portals are not currently supported by the server renderer. ' + 'Render them conditionally so that they only appear on the client render.');\n // eslint-disable-next-line-no-fallthrough\n\n case REACT_LAZY_TYPE:\n {\n var lazyNode = node;\n var payload = lazyNode._payload;\n var init = lazyNode._init;\n var resolvedNode;\n {\n try {\n resolvedNode = init(payload);\n } catch (x) {\n if (_typeof(x) === 'object' && x !== null && typeof x.then === 'function') {\n // this Lazy initializer is suspending. push a temporary frame onto the stack so it can be\n // popped off in spawnNewSuspendedTask. This aligns stack behavior between Lazy in element position\n // vs Component position. We do not want the frame for Errors so we exclusively do this in\n // the wakeable branch\n pushBuiltInComponentStackInDEV(task, 'Lazy');\n }\n\n throw x;\n }\n }\n renderNodeDestructive(request, task, resolvedNode);\n return;\n }\n }\n\n if (isArray(node)) {\n renderChildrenArray(request, task, node);\n return;\n }\n\n var iteratorFn = getIteratorFn(node);\n\n if (iteratorFn) {\n {\n validateIterable(node, iteratorFn);\n }\n var iterator = iteratorFn.call(node);\n\n if (iterator) {\n // We need to know how many total children are in this set, so that we\n // can allocate enough id slots to acommodate them. So we must exhaust\n // the iterator before we start recursively rendering the children.\n // TODO: This is not great but I think it's inherent to the id\n // generation algorithm.\n var step = iterator.next(); // If there are not entries, we need to push an empty so we start by checking that.\n\n if (!step.done) {\n var children = [];\n\n do {\n children.push(step.value);\n step = iterator.next();\n } while (!step.done);\n\n renderChildrenArray(request, task, children);\n return;\n }\n\n return;\n }\n }\n\n var childString = Object.prototype.toString.call(node);\n throw new Error(\"Objects are not valid as a React child (found: \" + (childString === '[object Object]' ? 'object with keys {' + Object.keys(node).join(', ') + '}' : childString) + \"). \" + 'If you meant to render a collection of children, use an array ' + 'instead.');\n }\n\n if (typeof node === 'string') {\n var segment = task.blockedSegment;\n segment.lastPushedText = pushTextInstance$1(task.blockedSegment.chunks, node, request.responseState, segment.lastPushedText);\n return;\n }\n\n if (typeof node === 'number') {\n var _segment = task.blockedSegment;\n _segment.lastPushedText = pushTextInstance$1(task.blockedSegment.chunks, '' + node, request.responseState, _segment.lastPushedText);\n return;\n }\n\n {\n if (typeof node === 'function') {\n error('Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of from render. ' + 'Or maybe you meant to call this function rather than return it.');\n }\n }\n }\n\n function renderChildrenArray(request, task, children) {\n var totalChildren = children.length;\n\n for (var i = 0; i < totalChildren; i++) {\n var prevTreeContext = task.treeContext;\n task.treeContext = pushTreeContext(prevTreeContext, totalChildren, i);\n\n try {\n // We need to use the non-destructive form so that we can safely pop back\n // up and render the sibling if something suspends.\n renderNode(request, task, children[i]);\n } finally {\n task.treeContext = prevTreeContext;\n }\n }\n }\n\n function spawnNewSuspendedTask(request, task, x) {\n // Something suspended, we'll need to create a new segment and resolve it later.\n var segment = task.blockedSegment;\n var insertionIndex = segment.chunks.length;\n var newSegment = createPendingSegment(request, insertionIndex, null, segment.formatContext, // Adopt the parent segment's leading text embed\n segment.lastPushedText, // Assume we are text embedded at the trailing edge\n true);\n segment.children.push(newSegment); // Reset lastPushedText for current Segment since the new Segment \"consumed\" it\n\n segment.lastPushedText = false;\n var newTask = createTask(request, task.node, task.blockedBoundary, newSegment, task.abortSet, task.legacyContext, task.context, task.treeContext);\n {\n if (task.componentStack !== null) {\n // We pop one task off the stack because the node that suspended will be tried again,\n // which will add it back onto the stack.\n newTask.componentStack = task.componentStack.parent;\n }\n }\n var ping = newTask.ping;\n x.then(ping, ping);\n } // This is a non-destructive form of rendering a node. If it suspends it spawns\n // a new task and restores the context of this task to what it was before.\n\n\n function renderNode(request, task, node) {\n // TODO: Store segment.children.length here and reset it in case something\n // suspended partially through writing something.\n // Snapshot the current context in case something throws to interrupt the\n // process.\n var previousFormatContext = task.blockedSegment.formatContext;\n var previousLegacyContext = task.legacyContext;\n var previousContext = task.context;\n var previousComponentStack = null;\n {\n previousComponentStack = task.componentStack;\n }\n\n try {\n return renderNodeDestructive(request, task, node);\n } catch (x) {\n resetHooksState();\n\n if (_typeof(x) === 'object' && x !== null && typeof x.then === 'function') {\n spawnNewSuspendedTask(request, task, x); // Restore the context. We assume that this will be restored by the inner\n // functions in case nothing throws so we don't use \"finally\" here.\n\n task.blockedSegment.formatContext = previousFormatContext;\n task.legacyContext = previousLegacyContext;\n task.context = previousContext; // Restore all active ReactContexts to what they were before.\n\n switchContext(previousContext);\n {\n task.componentStack = previousComponentStack;\n }\n return;\n } else {\n // Restore the context. We assume that this will be restored by the inner\n // functions in case nothing throws so we don't use \"finally\" here.\n task.blockedSegment.formatContext = previousFormatContext;\n task.legacyContext = previousLegacyContext;\n task.context = previousContext; // Restore all active ReactContexts to what they were before.\n\n switchContext(previousContext);\n {\n task.componentStack = previousComponentStack;\n } // We assume that we don't need the correct context.\n // Let's terminate the rest of the tree and don't render any siblings.\n\n throw x;\n }\n }\n }\n\n function erroredTask(request, boundary, segment, error) {\n // Report the error to a global handler.\n var errorDigest = logRecoverableError(request, error);\n\n if (boundary === null) {\n fatalError(request, error);\n } else {\n boundary.pendingTasks--;\n\n if (!boundary.forceClientRender) {\n boundary.forceClientRender = true;\n boundary.errorDigest = errorDigest;\n {\n captureBoundaryErrorDetailsDev(boundary, error);\n } // Regardless of what happens next, this boundary won't be displayed,\n // so we can flush it, if the parent already flushed.\n\n if (boundary.parentFlushed) {\n // We don't have a preference where in the queue this goes since it's likely\n // to error on the client anyway. However, intentionally client-rendered\n // boundaries should be flushed earlier so that they can start on the client.\n // We reuse the same queue for errors.\n request.clientRenderedBoundaries.push(boundary);\n }\n }\n }\n\n request.allPendingTasks--;\n\n if (request.allPendingTasks === 0) {\n var onAllReady = request.onAllReady;\n onAllReady();\n }\n }\n\n function abortTaskSoft(task) {\n // This aborts task without aborting the parent boundary that it blocks.\n // It's used for when we didn't need this task to complete the tree.\n // If task was needed, then it should use abortTask instead.\n var request = this;\n var boundary = task.blockedBoundary;\n var segment = task.blockedSegment;\n segment.status = ABORTED;\n finishedTask(request, boundary, segment);\n }\n\n function abortTask(task, request, reason) {\n // This aborts the task and aborts the parent that it blocks, putting it into\n // client rendered mode.\n var boundary = task.blockedBoundary;\n var segment = task.blockedSegment;\n segment.status = ABORTED;\n\n if (boundary === null) {\n request.allPendingTasks--; // We didn't complete the root so we have nothing to show. We can close\n // the request;\n\n if (request.status !== CLOSED) {\n request.status = CLOSED;\n\n if (request.destination !== null) {\n close(request.destination);\n }\n }\n } else {\n boundary.pendingTasks--;\n\n if (!boundary.forceClientRender) {\n boundary.forceClientRender = true;\n\n var _error = reason === undefined ? new Error('The render was aborted by the server without a reason.') : reason;\n\n boundary.errorDigest = request.onError(_error);\n {\n var errorPrefix = 'The server did not finish this Suspense boundary: ';\n\n if (_error && typeof _error.message === 'string') {\n _error = errorPrefix + _error.message;\n } else {\n // eslint-disable-next-line react-internal/safe-string-coercion\n _error = errorPrefix + String(_error);\n }\n\n var previousTaskInDev = currentTaskInDEV;\n currentTaskInDEV = task;\n\n try {\n captureBoundaryErrorDetailsDev(boundary, _error);\n } finally {\n currentTaskInDEV = previousTaskInDev;\n }\n }\n\n if (boundary.parentFlushed) {\n request.clientRenderedBoundaries.push(boundary);\n }\n } // If this boundary was still pending then we haven't already cancelled its fallbacks.\n // We'll need to abort the fallbacks, which will also error that parent boundary.\n\n\n boundary.fallbackAbortableTasks.forEach(function (fallbackTask) {\n return abortTask(fallbackTask, request, reason);\n });\n boundary.fallbackAbortableTasks.clear();\n request.allPendingTasks--;\n\n if (request.allPendingTasks === 0) {\n var onAllReady = request.onAllReady;\n onAllReady();\n }\n }\n }\n\n function queueCompletedSegment(boundary, segment) {\n if (segment.chunks.length === 0 && segment.children.length === 1 && segment.children[0].boundary === null) {\n // This is an empty segment. There's nothing to write, so we can instead transfer the ID\n // to the child. That way any existing references point to the child.\n var childSegment = segment.children[0];\n childSegment.id = segment.id;\n childSegment.parentFlushed = true;\n\n if (childSegment.status === COMPLETED) {\n queueCompletedSegment(boundary, childSegment);\n }\n } else {\n var completedSegments = boundary.completedSegments;\n completedSegments.push(segment);\n }\n }\n\n function finishedTask(request, boundary, segment) {\n if (boundary === null) {\n if (segment.parentFlushed) {\n if (request.completedRootSegment !== null) {\n throw new Error('There can only be one root segment. This is a bug in React.');\n }\n\n request.completedRootSegment = segment;\n }\n\n request.pendingRootTasks--;\n\n if (request.pendingRootTasks === 0) {\n // We have completed the shell so the shell can't error anymore.\n request.onShellError = noop$1;\n var onShellReady = request.onShellReady;\n onShellReady();\n }\n } else {\n boundary.pendingTasks--;\n if (boundary.forceClientRender) ;else if (boundary.pendingTasks === 0) {\n // This must have been the last segment we were waiting on. This boundary is now complete.\n if (segment.parentFlushed) {\n // Our parent segment already flushed, so we need to schedule this segment to be emitted.\n // If it is a segment that was aborted, we'll write other content instead so we don't need\n // to emit it.\n if (segment.status === COMPLETED) {\n queueCompletedSegment(boundary, segment);\n }\n }\n\n if (boundary.parentFlushed) {\n // The segment might be part of a segment that didn't flush yet, but if the boundary's\n // parent flushed, we need to schedule the boundary to be emitted.\n request.completedBoundaries.push(boundary);\n } // We can now cancel any pending task on the fallback since we won't need to show it anymore.\n // This needs to happen after we read the parentFlushed flags because aborting can finish\n // work which can trigger user code, which can start flushing, which can change those flags.\n\n\n boundary.fallbackAbortableTasks.forEach(abortTaskSoft, request);\n boundary.fallbackAbortableTasks.clear();\n } else {\n if (segment.parentFlushed) {\n // Our parent already flushed, so we need to schedule this segment to be emitted.\n // If it is a segment that was aborted, we'll write other content instead so we don't need\n // to emit it.\n if (segment.status === COMPLETED) {\n queueCompletedSegment(boundary, segment);\n var completedSegments = boundary.completedSegments;\n\n if (completedSegments.length === 1) {\n // This is the first time since we last flushed that we completed anything.\n // We can schedule this boundary to emit its partially completed segments early\n // in case the parent has already been flushed.\n if (boundary.parentFlushed) {\n request.partialBoundaries.push(boundary);\n }\n }\n }\n }\n }\n }\n\n request.allPendingTasks--;\n\n if (request.allPendingTasks === 0) {\n // This needs to be called at the very end so that we can synchronously write the result\n // in the callback if needed.\n var onAllReady = request.onAllReady;\n onAllReady();\n }\n }\n\n function retryTask(request, task) {\n var segment = task.blockedSegment;\n\n if (segment.status !== PENDING) {\n // We completed this by other means before we had a chance to retry it.\n return;\n } // We restore the context to what it was when we suspended.\n // We don't restore it after we leave because it's likely that we'll end up\n // needing a very similar context soon again.\n\n\n switchContext(task.context);\n var prevTaskInDEV = null;\n {\n prevTaskInDEV = currentTaskInDEV;\n currentTaskInDEV = task;\n }\n\n try {\n // We call the destructive form that mutates this task. That way if something\n // suspends again, we can reuse the same task instead of spawning a new one.\n renderNodeDestructive(request, task, task.node);\n pushSegmentFinale$1(segment.chunks, request.responseState, segment.lastPushedText, segment.textEmbedded);\n task.abortSet.delete(task);\n segment.status = COMPLETED;\n finishedTask(request, task.blockedBoundary, segment);\n } catch (x) {\n resetHooksState();\n\n if (_typeof(x) === 'object' && x !== null && typeof x.then === 'function') {\n // Something suspended again, let's pick it back up later.\n var ping = task.ping;\n x.then(ping, ping);\n } else {\n task.abortSet.delete(task);\n segment.status = ERRORED;\n erroredTask(request, task.blockedBoundary, segment, x);\n }\n } finally {\n {\n currentTaskInDEV = prevTaskInDEV;\n }\n }\n }\n\n function performWork(request) {\n if (request.status === CLOSED) {\n return;\n }\n\n var prevContext = getActiveContext();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = Dispatcher;\n var prevGetCurrentStackImpl;\n {\n prevGetCurrentStackImpl = ReactDebugCurrentFrame$1.getCurrentStack;\n ReactDebugCurrentFrame$1.getCurrentStack = getCurrentStackInDEV;\n }\n var prevResponseState = currentResponseState;\n setCurrentResponseState(request.responseState);\n\n try {\n var pingedTasks = request.pingedTasks;\n var i;\n\n for (i = 0; i < pingedTasks.length; i++) {\n var task = pingedTasks[i];\n retryTask(request, task);\n }\n\n pingedTasks.splice(0, i);\n\n if (request.destination !== null) {\n flushCompletedQueues(request, request.destination);\n }\n } catch (error) {\n logRecoverableError(request, error);\n fatalError(request, error);\n } finally {\n setCurrentResponseState(prevResponseState);\n ReactCurrentDispatcher$1.current = prevDispatcher;\n {\n ReactDebugCurrentFrame$1.getCurrentStack = prevGetCurrentStackImpl;\n }\n\n if (prevDispatcher === Dispatcher) {\n // This means that we were in a reentrant work loop. This could happen\n // in a renderer that supports synchronous work like renderToString,\n // when it's called from within another renderer.\n // Normally we don't bother switching the contexts to their root/default\n // values when leaving because we'll likely need the same or similar\n // context again. However, when we're inside a synchronous loop like this\n // we'll to restore the context to what it was before returning.\n switchContext(prevContext);\n }\n }\n }\n\n function flushSubtree(request, destination, segment) {\n segment.parentFlushed = true;\n\n switch (segment.status) {\n case PENDING:\n {\n // We're emitting a placeholder for this segment to be filled in later.\n // Therefore we'll need to assign it an ID - to refer to it by.\n var segmentID = segment.id = request.nextSegmentId++; // When this segment finally completes it won't be embedded in text since it will flush separately\n\n segment.lastPushedText = false;\n segment.textEmbedded = false;\n return writePlaceholder(destination, request.responseState, segmentID);\n }\n\n case COMPLETED:\n {\n segment.status = FLUSHED;\n var r = true;\n var chunks = segment.chunks;\n var chunkIdx = 0;\n var children = segment.children;\n\n for (var childIdx = 0; childIdx < children.length; childIdx++) {\n var nextChild = children[childIdx]; // Write all the chunks up until the next child.\n\n for (; chunkIdx < nextChild.index; chunkIdx++) {\n writeChunk(destination, chunks[chunkIdx]);\n }\n\n r = flushSegment(request, destination, nextChild);\n } // Finally just write all the remaining chunks\n\n\n for (; chunkIdx < chunks.length - 1; chunkIdx++) {\n writeChunk(destination, chunks[chunkIdx]);\n }\n\n if (chunkIdx < chunks.length) {\n r = writeChunkAndReturn(destination, chunks[chunkIdx]);\n }\n\n return r;\n }\n\n default:\n {\n throw new Error('Aborted, errored or already flushed boundaries should not be flushed again. This is a bug in React.');\n }\n }\n }\n\n function flushSegment(request, destination, segment) {\n var boundary = segment.boundary;\n\n if (boundary === null) {\n // Not a suspense boundary.\n return flushSubtree(request, destination, segment);\n }\n\n boundary.parentFlushed = true; // This segment is a Suspense boundary. We need to decide whether to\n // emit the content or the fallback now.\n\n if (boundary.forceClientRender) {\n // Emit a client rendered suspense boundary wrapper.\n // We never queue the inner boundary so we'll never emit its content or partial segments.\n writeStartClientRenderedSuspenseBoundary$1(destination, request.responseState, boundary.errorDigest, boundary.errorMessage, boundary.errorComponentStack); // Flush the fallback.\n\n flushSubtree(request, destination, segment);\n return writeEndClientRenderedSuspenseBoundary$1(destination, request.responseState);\n } else if (boundary.pendingTasks > 0) {\n // This boundary is still loading. Emit a pending suspense boundary wrapper.\n // Assign an ID to refer to the future content by.\n boundary.rootSegmentID = request.nextSegmentId++;\n\n if (boundary.completedSegments.length > 0) {\n // If this is at least partially complete, we can queue it to be partially emitted early.\n request.partialBoundaries.push(boundary);\n } /// This is the first time we should have referenced this ID.\n\n\n var id = boundary.id = assignSuspenseBoundaryID(request.responseState);\n writeStartPendingSuspenseBoundary(destination, request.responseState, id); // Flush the fallback.\n\n flushSubtree(request, destination, segment);\n return writeEndPendingSuspenseBoundary(destination, request.responseState);\n } else if (boundary.byteSize > request.progressiveChunkSize) {\n // This boundary is large and will be emitted separately so that we can progressively show\n // other content. We add it to the queue during the flush because we have to ensure that\n // the parent flushes first so that there's something to inject it into.\n // We also have to make sure that it's emitted into the queue in a deterministic slot.\n // I.e. we can't insert it here when it completes.\n // Assign an ID to refer to the future content by.\n boundary.rootSegmentID = request.nextSegmentId++;\n request.completedBoundaries.push(boundary); // Emit a pending rendered suspense boundary wrapper.\n\n writeStartPendingSuspenseBoundary(destination, request.responseState, boundary.id); // Flush the fallback.\n\n flushSubtree(request, destination, segment);\n return writeEndPendingSuspenseBoundary(destination, request.responseState);\n } else {\n // We can inline this boundary's content as a complete boundary.\n writeStartCompletedSuspenseBoundary$1(destination, request.responseState);\n var completedSegments = boundary.completedSegments;\n\n if (completedSegments.length !== 1) {\n throw new Error('A previously unvisited boundary must have exactly one root segment. This is a bug in React.');\n }\n\n var contentSegment = completedSegments[0];\n flushSegment(request, destination, contentSegment);\n return writeEndCompletedSuspenseBoundary$1(destination, request.responseState);\n }\n }\n\n function flushClientRenderedBoundary(request, destination, boundary) {\n return writeClientRenderBoundaryInstruction(destination, request.responseState, boundary.id, boundary.errorDigest, boundary.errorMessage, boundary.errorComponentStack);\n }\n\n function flushSegmentContainer(request, destination, segment) {\n writeStartSegment(destination, request.responseState, segment.formatContext, segment.id);\n flushSegment(request, destination, segment);\n return writeEndSegment(destination, segment.formatContext);\n }\n\n function flushCompletedBoundary(request, destination, boundary) {\n var completedSegments = boundary.completedSegments;\n var i = 0;\n\n for (; i < completedSegments.length; i++) {\n var segment = completedSegments[i];\n flushPartiallyCompletedSegment(request, destination, boundary, segment);\n }\n\n completedSegments.length = 0;\n return writeCompletedBoundaryInstruction(destination, request.responseState, boundary.id, boundary.rootSegmentID);\n }\n\n function flushPartialBoundary(request, destination, boundary) {\n var completedSegments = boundary.completedSegments;\n var i = 0;\n\n for (; i < completedSegments.length; i++) {\n var segment = completedSegments[i];\n\n if (!flushPartiallyCompletedSegment(request, destination, boundary, segment)) {\n i++;\n completedSegments.splice(0, i); // Only write as much as the buffer wants. Something higher priority\n // might want to write later.\n\n return false;\n }\n }\n\n completedSegments.splice(0, i);\n return true;\n }\n\n function flushPartiallyCompletedSegment(request, destination, boundary, segment) {\n if (segment.status === FLUSHED) {\n // We've already flushed this inline.\n return true;\n }\n\n var segmentID = segment.id;\n\n if (segmentID === -1) {\n // This segment wasn't previously referred to. This happens at the root of\n // a boundary. We make kind of a leap here and assume this is the root.\n var rootSegmentID = segment.id = boundary.rootSegmentID;\n\n if (rootSegmentID === -1) {\n throw new Error('A root segment ID must have been assigned by now. This is a bug in React.');\n }\n\n return flushSegmentContainer(request, destination, segment);\n } else {\n flushSegmentContainer(request, destination, segment);\n return writeCompletedSegmentInstruction(destination, request.responseState, segmentID);\n }\n }\n\n function flushCompletedQueues(request, destination) {\n try {\n // The structure of this is to go through each queue one by one and write\n // until the sink tells us to stop. When we should stop, we still finish writing\n // that item fully and then yield. At that point we remove the already completed\n // items up until the point we completed them.\n // TODO: Emit preloading.\n // TODO: It's kind of unfortunate to keep checking this array after we've already\n // emitted the root.\n var completedRootSegment = request.completedRootSegment;\n\n if (completedRootSegment !== null && request.pendingRootTasks === 0) {\n flushSegment(request, destination, completedRootSegment);\n request.completedRootSegment = null;\n writeCompletedRoot(destination, request.responseState);\n } // We emit client rendering instructions for already emitted boundaries first.\n // This is so that we can signal to the client to start client rendering them as\n // soon as possible.\n\n\n var clientRenderedBoundaries = request.clientRenderedBoundaries;\n var i;\n\n for (i = 0; i < clientRenderedBoundaries.length; i++) {\n var boundary = clientRenderedBoundaries[i];\n\n if (!flushClientRenderedBoundary(request, destination, boundary)) {\n request.destination = null;\n i++;\n clientRenderedBoundaries.splice(0, i);\n return;\n }\n }\n\n clientRenderedBoundaries.splice(0, i); // Next we emit any complete boundaries. It's better to favor boundaries\n // that are completely done since we can actually show them, than it is to emit\n // any individual segments from a partially complete boundary.\n\n var completedBoundaries = request.completedBoundaries;\n\n for (i = 0; i < completedBoundaries.length; i++) {\n var _boundary = completedBoundaries[i];\n\n if (!flushCompletedBoundary(request, destination, _boundary)) {\n request.destination = null;\n i++;\n completedBoundaries.splice(0, i);\n return;\n }\n }\n\n completedBoundaries.splice(0, i); // Allow anything written so far to flush to the underlying sink before\n // we continue with lower priorities.\n\n completeWriting(destination);\n beginWriting(destination); // TODO: Here we'll emit data used by hydration.\n // Next we emit any segments of any boundaries that are partially complete\n // but not deeply complete.\n\n var partialBoundaries = request.partialBoundaries;\n\n for (i = 0; i < partialBoundaries.length; i++) {\n var _boundary2 = partialBoundaries[i];\n\n if (!flushPartialBoundary(request, destination, _boundary2)) {\n request.destination = null;\n i++;\n partialBoundaries.splice(0, i);\n return;\n }\n }\n\n partialBoundaries.splice(0, i); // Next we check the completed boundaries again. This may have had\n // boundaries added to it in case they were too larged to be inlined.\n // New ones might be added in this loop.\n\n var largeBoundaries = request.completedBoundaries;\n\n for (i = 0; i < largeBoundaries.length; i++) {\n var _boundary3 = largeBoundaries[i];\n\n if (!flushCompletedBoundary(request, destination, _boundary3)) {\n request.destination = null;\n i++;\n largeBoundaries.splice(0, i);\n return;\n }\n }\n\n largeBoundaries.splice(0, i);\n } finally {\n if (request.allPendingTasks === 0 && request.pingedTasks.length === 0 && request.clientRenderedBoundaries.length === 0 && request.completedBoundaries.length === 0 // We don't need to check any partially completed segments because\n // either they have pending task or they're complete.\n ) {\n {\n if (request.abortableTasks.size !== 0) {\n error('There was still abortable task at the root when we closed. This is a bug in React.');\n }\n } // We're done.\n\n close(destination);\n }\n }\n }\n\n function startWork(request) {\n scheduleWork(function () {\n return performWork(request);\n });\n }\n\n function startFlowing(request, destination) {\n if (request.status === CLOSING) {\n request.status = CLOSED;\n closeWithError(destination, request.fatalError);\n return;\n }\n\n if (request.status === CLOSED) {\n return;\n }\n\n if (request.destination !== null) {\n // We're already flowing.\n return;\n }\n\n request.destination = destination;\n\n try {\n flushCompletedQueues(request, destination);\n } catch (error) {\n logRecoverableError(request, error);\n fatalError(request, error);\n }\n } // This is called to early terminate a request. It puts all pending boundaries in client rendered state.\n\n\n function abort(request, reason) {\n try {\n var abortableTasks = request.abortableTasks;\n abortableTasks.forEach(function (task) {\n return abortTask(task, request, reason);\n });\n abortableTasks.clear();\n\n if (request.destination !== null) {\n flushCompletedQueues(request, request.destination);\n }\n } catch (error) {\n logRecoverableError(request, error);\n fatalError(request, error);\n }\n }\n\n function onError() {// Non-fatal errors are ignored.\n }\n\n function renderToStringImpl(children, options, generateStaticMarkup, abortReason) {\n var didFatal = false;\n var fatalError = null;\n var result = '';\n var destination = {\n push: function push(chunk) {\n if (chunk !== null) {\n result += chunk;\n }\n\n return true;\n },\n destroy: function destroy(error) {\n didFatal = true;\n fatalError = error;\n }\n };\n var readyToStream = false;\n\n function onShellReady() {\n readyToStream = true;\n }\n\n var request = createRequest(children, createResponseState$1(generateStaticMarkup, options ? options.identifierPrefix : undefined), createRootFormatContext(), Infinity, onError, undefined, onShellReady, undefined, undefined);\n startWork(request); // If anything suspended and is still pending, we'll abort it before writing.\n // That way we write only client-rendered boundaries from the start.\n\n abort(request, abortReason);\n startFlowing(request, destination);\n\n if (didFatal) {\n throw fatalError;\n }\n\n if (!readyToStream) {\n // Note: This error message is the one we use on the client. It doesn't\n // really make sense here. But this is the legacy server renderer, anyway.\n // We're going to delete it soon.\n throw new Error('A component suspended while responding to synchronous input. This ' + 'will cause the UI to be replaced with a loading indicator. To fix, ' + 'updates that suspend should be wrapped with startTransition.');\n }\n\n return result;\n }\n\n function renderToString(children, options) {\n return renderToStringImpl(children, options, false, 'The server used \"renderToString\" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to \"renderToReadableStream\" which supports Suspense on the server');\n }\n\n function renderToStaticMarkup(children, options) {\n return renderToStringImpl(children, options, true, 'The server used \"renderToStaticMarkup\" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to \"renderToReadableStream\" which supports Suspense on the server');\n }\n\n function renderToNodeStream() {\n throw new Error('ReactDOMServer.renderToNodeStream(): The streaming API is not available ' + 'in the browser. Use ReactDOMServer.renderToString() instead.');\n }\n\n function renderToStaticNodeStream() {\n throw new Error('ReactDOMServer.renderToStaticNodeStream(): The streaming API is not available ' + 'in the browser. Use ReactDOMServer.renderToStaticMarkup() instead.');\n }\n\n exports.renderToNodeStream = renderToNodeStream;\n exports.renderToStaticMarkup = renderToStaticMarkup;\n exports.renderToStaticNodeStream = renderToStaticNodeStream;\n exports.renderToString = renderToString;\n exports.version = ReactVersion;\n })();\n}","/**\n * @license React\n * react-dom-server.browser.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\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'use strict';\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nif (process.env.NODE_ENV !== \"production\") {\n (function () {\n 'use strict';\n\n var React = require('react');\n\n var ReactVersion = '18.3.1';\n var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // by calls to these methods by a Babel plugin.\n //\n // In PROD (or in packages without access to React internals),\n // they are left as they are instead.\n\n function warn(format) {\n {\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 printWarning('warn', format, args);\n }\n }\n }\n\n function error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n }\n\n function printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n }\n\n function scheduleWork(callback) {\n callback();\n }\n\n var VIEW_SIZE = 512;\n var currentView = null;\n var writtenBytes = 0;\n\n function beginWriting(destination) {\n currentView = new Uint8Array(VIEW_SIZE);\n writtenBytes = 0;\n }\n\n function writeChunk(destination, chunk) {\n if (chunk.length === 0) {\n return;\n }\n\n if (chunk.length > VIEW_SIZE) {\n // this chunk may overflow a single view which implies it was not\n // one that is cached by the streaming renderer. We will enqueu\n // it directly and expect it is not re-used\n if (writtenBytes > 0) {\n destination.enqueue(new Uint8Array(currentView.buffer, 0, writtenBytes));\n currentView = new Uint8Array(VIEW_SIZE);\n writtenBytes = 0;\n }\n\n destination.enqueue(chunk);\n return;\n }\n\n var bytesToWrite = chunk;\n var allowableBytes = currentView.length - writtenBytes;\n\n if (allowableBytes < bytesToWrite.length) {\n // this chunk would overflow the current view. We enqueue a full view\n // and start a new view with the remaining chunk\n if (allowableBytes === 0) {\n // the current view is already full, send it\n destination.enqueue(currentView);\n } else {\n // fill up the current view and apply the remaining chunk bytes\n // to a new view.\n currentView.set(bytesToWrite.subarray(0, allowableBytes), writtenBytes); // writtenBytes += allowableBytes; // this can be skipped because we are going to immediately reset the view\n\n destination.enqueue(currentView);\n bytesToWrite = bytesToWrite.subarray(allowableBytes);\n }\n\n currentView = new Uint8Array(VIEW_SIZE);\n writtenBytes = 0;\n }\n\n currentView.set(bytesToWrite, writtenBytes);\n writtenBytes += bytesToWrite.length;\n }\n\n function writeChunkAndReturn(destination, chunk) {\n writeChunk(destination, chunk); // in web streams there is no backpressure so we can alwas write more\n\n return true;\n }\n\n function completeWriting(destination) {\n if (currentView && writtenBytes > 0) {\n destination.enqueue(new Uint8Array(currentView.buffer, 0, writtenBytes));\n currentView = null;\n writtenBytes = 0;\n }\n }\n\n function close(destination) {\n destination.close();\n }\n\n var textEncoder = new TextEncoder();\n\n function stringToChunk(content) {\n return textEncoder.encode(content);\n }\n\n function stringToPrecomputedChunk(content) {\n return textEncoder.encode(content);\n }\n\n function closeWithError(destination, error) {\n if (typeof destination.error === 'function') {\n // $FlowFixMe: This is an Error object or the destination accepts other types.\n destination.error(error);\n } else {\n // Earlier implementations doesn't support this method. In that environment you're\n // supposed to throw from a promise returned but we don't return a promise in our\n // approach. We could fork this implementation but this is environment is an edge\n // case to begin with. It's even less common to run this in an older environment.\n // Even then, this is not where errors are supposed to happen and they get reported\n // to a global callback in addition to this anyway. So it's fine just to close this.\n destination.close();\n }\n }\n /*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n // $FlowFixMe only called in DEV, so void return is not possible.\n\n\n function typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n } // $FlowFixMe only called in DEV, so void return is not possible.\n\n\n function willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n }\n\n function testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n }\n\n function checkAttributeStringCoercion(value, attributeName) {\n {\n if (willCoercionThrow(value)) {\n error('The provided `%s` attribute is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', attributeName, typeName(value));\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n }\n\n function checkCSSPropertyStringCoercion(value, propName) {\n {\n if (willCoercionThrow(value)) {\n error('The provided `%s` CSS property is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', propName, typeName(value));\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n }\n\n function checkHtmlStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided HTML markup uses a value of unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n }\n\n var hasOwnProperty = Object.prototype.hasOwnProperty; // A reserved attribute.\n // It is handled by React separately and shouldn't be written to the DOM.\n\n var RESERVED = 0; // A simple string attribute.\n // Attributes that aren't in the filter are presumed to have this type.\n\n var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called\n // \"enumerated\" attributes with \"true\" and \"false\" as possible values.\n // When true, it should be set to a \"true\" string.\n // When false, it should be set to a \"false\" string.\n\n var BOOLEANISH_STRING = 2; // A real boolean attribute.\n // When true, it should be present (set either to an empty string or its name).\n // When false, it should be omitted.\n\n var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value.\n // When true, it should be present (set either to an empty string or its name).\n // When false, it should be omitted.\n // For any other value, should be present with that value.\n\n var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.\n // When falsy, it should be removed.\n\n var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.\n // When falsy, it should be removed.\n\n var POSITIVE_NUMERIC = 6;\n /* eslint-disable max-len */\n\n var ATTRIBUTE_NAME_START_CHAR = \":A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\";\n /* eslint-enable max-len */\n\n var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + \"\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040\";\n var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');\n var illegalAttributeNameCache = {};\n var validatedAttributeNameCache = {};\n\n function isAttributeNameSafe(attributeName) {\n if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {\n return true;\n }\n\n if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {\n return false;\n }\n\n if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {\n validatedAttributeNameCache[attributeName] = true;\n return true;\n }\n\n illegalAttributeNameCache[attributeName] = true;\n {\n error('Invalid attribute name: `%s`', attributeName);\n }\n return false;\n }\n\n function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {\n if (propertyInfo !== null && propertyInfo.type === RESERVED) {\n return false;\n }\n\n switch (_typeof(value)) {\n case 'function': // $FlowIssue symbol is perfectly valid here\n\n case 'symbol':\n // eslint-disable-line\n return true;\n\n case 'boolean':\n {\n if (isCustomComponentTag) {\n return false;\n }\n\n if (propertyInfo !== null) {\n return !propertyInfo.acceptsBooleans;\n } else {\n var prefix = name.toLowerCase().slice(0, 5);\n return prefix !== 'data-' && prefix !== 'aria-';\n }\n }\n\n default:\n return false;\n }\n }\n\n function getPropertyInfo(name) {\n return properties.hasOwnProperty(name) ? properties[name] : null;\n }\n\n function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) {\n this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;\n this.attributeName = attributeName;\n this.attributeNamespace = attributeNamespace;\n this.mustUseProperty = mustUseProperty;\n this.propertyName = name;\n this.type = type;\n this.sanitizeURL = sanitizeURL;\n this.removeEmptyString = removeEmptyString;\n } // When adding attributes to this list, be sure to also add them to\n // the `possibleStandardNames` module to ensure casing and incorrect\n // name warnings.\n\n\n var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.\n\n var reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular\n // elements (not just inputs). Now that ReactDOMInput assigns to the\n // defaultValue property -- do we need this?\n 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'];\n reservedProps.forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n }); // A few React string attributes have a different name.\n // This is a mapping from React prop names to the attribute names.\n\n [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {\n var name = _ref[0],\n attributeName = _ref[1];\n properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n attributeName, // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n }); // These are \"enumerated\" HTML attributes that accept \"true\" and \"false\".\n // In React, we let users pass `true` and `false` even though technically\n // these aren't boolean attributes (they are coerced to strings).\n\n ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty\n name.toLowerCase(), // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n }); // These are \"enumerated\" SVG attributes that accept \"true\" and \"false\".\n // In React, we let users pass `true` and `false` even though technically\n // these aren't boolean attributes (they are coerced to strings).\n // Since these are SVG attributes, their attribute names are case-sensitive.\n\n ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n }); // These are HTML boolean attributes.\n\n ['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM\n // on the client side because the browsers are inconsistent. Instead we call focus().\n 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'disableRemotePlayback', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata\n 'itemScope'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty\n name.toLowerCase(), // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n }); // These are the few React props that we set as DOM properties\n // rather than attributes. These are all booleans.\n\n ['checked', // Note: `option.selected` is not updated if `select.multiple` is\n // disabled with `removeAttribute`. We have special logic for handling this.\n 'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list,\n // you'll need to set attributeName to name.toLowerCase()\n // instead in the assignment below.\n ].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n }); // These are HTML attributes that are \"overloaded booleans\": they behave like\n // booleans, but can also accept a string value.\n\n ['capture', 'download' // NOTE: if you add a camelCased prop to this list,\n // you'll need to set attributeName to name.toLowerCase()\n // instead in the assignment below.\n ].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n }); // These are HTML attributes that must be positive numbers.\n\n ['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list,\n // you'll need to set attributeName to name.toLowerCase()\n // instead in the assignment below.\n ].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n }); // These are HTML attributes that must be numbers.\n\n ['rowSpan', 'start'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty\n name.toLowerCase(), // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n });\n var CAMELIZE = /[\\-\\:]([a-z])/g;\n\n var capitalize = function capitalize(token) {\n return token[1].toUpperCase();\n }; // This is a list of all SVG attributes that need special casing, namespacing,\n // or boolean value assignment. Regular attributes that just accept strings\n // and have the same names are omitted, just like in the HTML attribute filter.\n // Some of these attributes can be hard to find. This list was created by\n // scraping the MDN documentation.\n\n\n ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' // NOTE: if you add a camelCased prop to this list,\n // you'll need to set attributeName to name.toLowerCase()\n // instead in the assignment below.\n ].forEach(function (attributeName) {\n var name = attributeName.replace(CAMELIZE, capitalize);\n properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n attributeName, null, // attributeNamespace\n false, // sanitizeURL\n false);\n }); // String SVG attributes with the xlink namespace.\n\n ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list,\n // you'll need to set attributeName to name.toLowerCase()\n // instead in the assignment below.\n ].forEach(function (attributeName) {\n var name = attributeName.replace(CAMELIZE, capitalize);\n properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n attributeName, 'http://www.w3.org/1999/xlink', false, // sanitizeURL\n false);\n }); // String SVG attributes with the xml namespace.\n\n ['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list,\n // you'll need to set attributeName to name.toLowerCase()\n // instead in the assignment below.\n ].forEach(function (attributeName) {\n var name = attributeName.replace(CAMELIZE, capitalize);\n properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n attributeName, 'http://www.w3.org/XML/1998/namespace', false, // sanitizeURL\n false);\n }); // These attribute exists both in HTML and SVG.\n // The attribute name is case-sensitive in SVG so we can't just use\n // the React name like we do for attributes that exist only in HTML.\n\n ['tabIndex', 'crossOrigin'].forEach(function (attributeName) {\n properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty\n attributeName.toLowerCase(), // attributeName\n null, // attributeNamespace\n false, // sanitizeURL\n false);\n }); // These attributes accept URLs. These must not allow javascript: URLS.\n // These will also need to accept Trusted Types object in the future.\n\n var xlinkHref = 'xlinkHref';\n properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty\n 'xlink:href', 'http://www.w3.org/1999/xlink', true, // sanitizeURL\n false);\n ['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {\n properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty\n attributeName.toLowerCase(), // attributeName\n null, // attributeNamespace\n true, // sanitizeURL\n true);\n });\n /**\n * CSS properties which accept numbers but are not in units of \"px\".\n */\n\n var isUnitlessNumber = {\n animationIterationCount: true,\n aspectRatio: true,\n borderImageOutset: true,\n borderImageSlice: true,\n borderImageWidth: true,\n boxFlex: true,\n boxFlexGroup: true,\n boxOrdinalGroup: true,\n columnCount: true,\n columns: true,\n flex: true,\n flexGrow: true,\n flexPositive: true,\n flexShrink: true,\n flexNegative: true,\n flexOrder: true,\n gridArea: true,\n gridRow: true,\n gridRowEnd: true,\n gridRowSpan: true,\n gridRowStart: true,\n gridColumn: true,\n gridColumnEnd: true,\n gridColumnSpan: true,\n gridColumnStart: true,\n fontWeight: true,\n lineClamp: true,\n lineHeight: true,\n opacity: true,\n order: true,\n orphans: true,\n tabSize: true,\n widows: true,\n zIndex: true,\n zoom: true,\n // SVG-related properties\n fillOpacity: true,\n floodOpacity: true,\n stopOpacity: true,\n strokeDasharray: true,\n strokeDashoffset: true,\n strokeMiterlimit: true,\n strokeOpacity: true,\n strokeWidth: true\n };\n /**\n * @param {string} prefix vendor-specific prefix, eg: Webkit\n * @param {string} key style name, eg: transitionDuration\n * @return {string} style name prefixed with `prefix`, properly camelCased, eg:\n * WebkitTransitionDuration\n */\n\n function prefixKey(prefix, key) {\n return prefix + key.charAt(0).toUpperCase() + key.substring(1);\n }\n /**\n * Support style names that may come passed in prefixed by adding permutations\n * of vendor prefixes.\n */\n\n\n var prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an\n // infinite loop, because it iterates over the newly added props too.\n\n Object.keys(isUnitlessNumber).forEach(function (prop) {\n prefixes.forEach(function (prefix) {\n isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];\n });\n });\n var hasReadOnlyValue = {\n button: true,\n checkbox: true,\n image: true,\n hidden: true,\n radio: true,\n reset: true,\n submit: true\n };\n\n function checkControlledValueProps(tagName, props) {\n {\n if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) {\n error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');\n }\n\n if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) {\n error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');\n }\n }\n }\n\n function isCustomComponent(tagName, props) {\n if (tagName.indexOf('-') === -1) {\n return typeof props.is === 'string';\n }\n\n switch (tagName) {\n // These are reserved SVG and MathML elements.\n // We don't mind this list too much because we expect it to never grow.\n // The alternative is to track the namespace in a few places which is convoluted.\n // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts\n case 'annotation-xml':\n case 'color-profile':\n case 'font-face':\n case 'font-face-src':\n case 'font-face-uri':\n case 'font-face-format':\n case 'font-face-name':\n case 'missing-glyph':\n return false;\n\n default:\n return true;\n }\n }\n\n var ariaProperties = {\n 'aria-current': 0,\n // state\n 'aria-description': 0,\n 'aria-details': 0,\n 'aria-disabled': 0,\n // state\n 'aria-hidden': 0,\n // state\n 'aria-invalid': 0,\n // state\n 'aria-keyshortcuts': 0,\n 'aria-label': 0,\n 'aria-roledescription': 0,\n // Widget Attributes\n 'aria-autocomplete': 0,\n 'aria-checked': 0,\n 'aria-expanded': 0,\n 'aria-haspopup': 0,\n 'aria-level': 0,\n 'aria-modal': 0,\n 'aria-multiline': 0,\n 'aria-multiselectable': 0,\n 'aria-orientation': 0,\n 'aria-placeholder': 0,\n 'aria-pressed': 0,\n 'aria-readonly': 0,\n 'aria-required': 0,\n 'aria-selected': 0,\n 'aria-sort': 0,\n 'aria-valuemax': 0,\n 'aria-valuemin': 0,\n 'aria-valuenow': 0,\n 'aria-valuetext': 0,\n // Live Region Attributes\n 'aria-atomic': 0,\n 'aria-busy': 0,\n 'aria-live': 0,\n 'aria-relevant': 0,\n // Drag-and-Drop Attributes\n 'aria-dropeffect': 0,\n 'aria-grabbed': 0,\n // Relationship Attributes\n 'aria-activedescendant': 0,\n 'aria-colcount': 0,\n 'aria-colindex': 0,\n 'aria-colspan': 0,\n 'aria-controls': 0,\n 'aria-describedby': 0,\n 'aria-errormessage': 0,\n 'aria-flowto': 0,\n 'aria-labelledby': 0,\n 'aria-owns': 0,\n 'aria-posinset': 0,\n 'aria-rowcount': 0,\n 'aria-rowindex': 0,\n 'aria-rowspan': 0,\n 'aria-setsize': 0\n };\n var warnedProperties = {};\n var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');\n var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');\n\n function validateProperty(tagName, name) {\n {\n if (hasOwnProperty.call(warnedProperties, name) && warnedProperties[name]) {\n return true;\n }\n\n if (rARIACamel.test(name)) {\n var ariaName = 'aria-' + name.slice(4).toLowerCase();\n var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM\n // DOM properties, then it is an invalid aria-* attribute.\n\n if (correctName == null) {\n error('Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);\n warnedProperties[name] = true;\n return true;\n } // aria-* attributes should be lowercase; suggest the lowercase version.\n\n\n if (name !== correctName) {\n error('Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);\n warnedProperties[name] = true;\n return true;\n }\n }\n\n if (rARIA.test(name)) {\n var lowerCasedName = name.toLowerCase();\n var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM\n // DOM properties, then it is an invalid aria-* attribute.\n\n if (standardName == null) {\n warnedProperties[name] = true;\n return false;\n } // aria-* attributes should be lowercase; suggest the lowercase version.\n\n\n if (name !== standardName) {\n error('Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);\n warnedProperties[name] = true;\n return true;\n }\n }\n }\n return true;\n }\n\n function warnInvalidARIAProps(type, props) {\n {\n var invalidProps = [];\n\n for (var key in props) {\n var isValid = validateProperty(type, key);\n\n if (!isValid) {\n invalidProps.push(key);\n }\n }\n\n var unknownPropString = invalidProps.map(function (prop) {\n return '`' + prop + '`';\n }).join(', ');\n\n if (invalidProps.length === 1) {\n error('Invalid aria prop %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type);\n } else if (invalidProps.length > 1) {\n error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type);\n }\n }\n }\n\n function validateProperties(type, props) {\n if (isCustomComponent(type, props)) {\n return;\n }\n\n warnInvalidARIAProps(type, props);\n }\n\n var didWarnValueNull = false;\n\n function validateProperties$1(type, props) {\n {\n if (type !== 'input' && type !== 'textarea' && type !== 'select') {\n return;\n }\n\n if (props != null && props.value === null && !didWarnValueNull) {\n didWarnValueNull = true;\n\n if (type === 'select' && props.multiple) {\n error('`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type);\n } else {\n error('`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);\n }\n }\n }\n } // When adding attributes to the HTML or SVG allowed attribute list, be sure to\n // also add them to this module to ensure casing and incorrect name\n // warnings.\n\n\n var possibleStandardNames = {\n // HTML\n accept: 'accept',\n acceptcharset: 'acceptCharset',\n 'accept-charset': 'acceptCharset',\n accesskey: 'accessKey',\n action: 'action',\n allowfullscreen: 'allowFullScreen',\n alt: 'alt',\n as: 'as',\n async: 'async',\n autocapitalize: 'autoCapitalize',\n autocomplete: 'autoComplete',\n autocorrect: 'autoCorrect',\n autofocus: 'autoFocus',\n autoplay: 'autoPlay',\n autosave: 'autoSave',\n capture: 'capture',\n cellpadding: 'cellPadding',\n cellspacing: 'cellSpacing',\n challenge: 'challenge',\n charset: 'charSet',\n checked: 'checked',\n children: 'children',\n cite: 'cite',\n class: 'className',\n classid: 'classID',\n classname: 'className',\n cols: 'cols',\n colspan: 'colSpan',\n content: 'content',\n contenteditable: 'contentEditable',\n contextmenu: 'contextMenu',\n controls: 'controls',\n controlslist: 'controlsList',\n coords: 'coords',\n crossorigin: 'crossOrigin',\n dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',\n data: 'data',\n datetime: 'dateTime',\n default: 'default',\n defaultchecked: 'defaultChecked',\n defaultvalue: 'defaultValue',\n defer: 'defer',\n dir: 'dir',\n disabled: 'disabled',\n disablepictureinpicture: 'disablePictureInPicture',\n disableremoteplayback: 'disableRemotePlayback',\n download: 'download',\n draggable: 'draggable',\n enctype: 'encType',\n enterkeyhint: 'enterKeyHint',\n for: 'htmlFor',\n form: 'form',\n formmethod: 'formMethod',\n formaction: 'formAction',\n formenctype: 'formEncType',\n formnovalidate: 'formNoValidate',\n formtarget: 'formTarget',\n frameborder: 'frameBorder',\n headers: 'headers',\n height: 'height',\n hidden: 'hidden',\n high: 'high',\n href: 'href',\n hreflang: 'hrefLang',\n htmlfor: 'htmlFor',\n httpequiv: 'httpEquiv',\n 'http-equiv': 'httpEquiv',\n icon: 'icon',\n id: 'id',\n imagesizes: 'imageSizes',\n imagesrcset: 'imageSrcSet',\n innerhtml: 'innerHTML',\n inputmode: 'inputMode',\n integrity: 'integrity',\n is: 'is',\n itemid: 'itemID',\n itemprop: 'itemProp',\n itemref: 'itemRef',\n itemscope: 'itemScope',\n itemtype: 'itemType',\n keyparams: 'keyParams',\n keytype: 'keyType',\n kind: 'kind',\n label: 'label',\n lang: 'lang',\n list: 'list',\n loop: 'loop',\n low: 'low',\n manifest: 'manifest',\n marginwidth: 'marginWidth',\n marginheight: 'marginHeight',\n max: 'max',\n maxlength: 'maxLength',\n media: 'media',\n mediagroup: 'mediaGroup',\n method: 'method',\n min: 'min',\n minlength: 'minLength',\n multiple: 'multiple',\n muted: 'muted',\n name: 'name',\n nomodule: 'noModule',\n nonce: 'nonce',\n novalidate: 'noValidate',\n open: 'open',\n optimum: 'optimum',\n pattern: 'pattern',\n placeholder: 'placeholder',\n playsinline: 'playsInline',\n poster: 'poster',\n preload: 'preload',\n profile: 'profile',\n radiogroup: 'radioGroup',\n readonly: 'readOnly',\n referrerpolicy: 'referrerPolicy',\n rel: 'rel',\n required: 'required',\n reversed: 'reversed',\n role: 'role',\n rows: 'rows',\n rowspan: 'rowSpan',\n sandbox: 'sandbox',\n scope: 'scope',\n scoped: 'scoped',\n scrolling: 'scrolling',\n seamless: 'seamless',\n selected: 'selected',\n shape: 'shape',\n size: 'size',\n sizes: 'sizes',\n span: 'span',\n spellcheck: 'spellCheck',\n src: 'src',\n srcdoc: 'srcDoc',\n srclang: 'srcLang',\n srcset: 'srcSet',\n start: 'start',\n step: 'step',\n style: 'style',\n summary: 'summary',\n tabindex: 'tabIndex',\n target: 'target',\n title: 'title',\n type: 'type',\n usemap: 'useMap',\n value: 'value',\n width: 'width',\n wmode: 'wmode',\n wrap: 'wrap',\n // SVG\n about: 'about',\n accentheight: 'accentHeight',\n 'accent-height': 'accentHeight',\n accumulate: 'accumulate',\n additive: 'additive',\n alignmentbaseline: 'alignmentBaseline',\n 'alignment-baseline': 'alignmentBaseline',\n allowreorder: 'allowReorder',\n alphabetic: 'alphabetic',\n amplitude: 'amplitude',\n arabicform: 'arabicForm',\n 'arabic-form': 'arabicForm',\n ascent: 'ascent',\n attributename: 'attributeName',\n attributetype: 'attributeType',\n autoreverse: 'autoReverse',\n azimuth: 'azimuth',\n basefrequency: 'baseFrequency',\n baselineshift: 'baselineShift',\n 'baseline-shift': 'baselineShift',\n baseprofile: 'baseProfile',\n bbox: 'bbox',\n begin: 'begin',\n bias: 'bias',\n by: 'by',\n calcmode: 'calcMode',\n capheight: 'capHeight',\n 'cap-height': 'capHeight',\n clip: 'clip',\n clippath: 'clipPath',\n 'clip-path': 'clipPath',\n clippathunits: 'clipPathUnits',\n cliprule: 'clipRule',\n 'clip-rule': 'clipRule',\n color: 'color',\n colorinterpolation: 'colorInterpolation',\n 'color-interpolation': 'colorInterpolation',\n colorinterpolationfilters: 'colorInterpolationFilters',\n 'color-interpolation-filters': 'colorInterpolationFilters',\n colorprofile: 'colorProfile',\n 'color-profile': 'colorProfile',\n colorrendering: 'colorRendering',\n 'color-rendering': 'colorRendering',\n contentscripttype: 'contentScriptType',\n contentstyletype: 'contentStyleType',\n cursor: 'cursor',\n cx: 'cx',\n cy: 'cy',\n d: 'd',\n datatype: 'datatype',\n decelerate: 'decelerate',\n descent: 'descent',\n diffuseconstant: 'diffuseConstant',\n direction: 'direction',\n display: 'display',\n divisor: 'divisor',\n dominantbaseline: 'dominantBaseline',\n 'dominant-baseline': 'dominantBaseline',\n dur: 'dur',\n dx: 'dx',\n dy: 'dy',\n edgemode: 'edgeMode',\n elevation: 'elevation',\n enablebackground: 'enableBackground',\n 'enable-background': 'enableBackground',\n end: 'end',\n exponent: 'exponent',\n externalresourcesrequired: 'externalResourcesRequired',\n fill: 'fill',\n fillopacity: 'fillOpacity',\n 'fill-opacity': 'fillOpacity',\n fillrule: 'fillRule',\n 'fill-rule': 'fillRule',\n filter: 'filter',\n filterres: 'filterRes',\n filterunits: 'filterUnits',\n floodopacity: 'floodOpacity',\n 'flood-opacity': 'floodOpacity',\n floodcolor: 'floodColor',\n 'flood-color': 'floodColor',\n focusable: 'focusable',\n fontfamily: 'fontFamily',\n 'font-family': 'fontFamily',\n fontsize: 'fontSize',\n 'font-size': 'fontSize',\n fontsizeadjust: 'fontSizeAdjust',\n 'font-size-adjust': 'fontSizeAdjust',\n fontstretch: 'fontStretch',\n 'font-stretch': 'fontStretch',\n fontstyle: 'fontStyle',\n 'font-style': 'fontStyle',\n fontvariant: 'fontVariant',\n 'font-variant': 'fontVariant',\n fontweight: 'fontWeight',\n 'font-weight': 'fontWeight',\n format: 'format',\n from: 'from',\n fx: 'fx',\n fy: 'fy',\n g1: 'g1',\n g2: 'g2',\n glyphname: 'glyphName',\n 'glyph-name': 'glyphName',\n glyphorientationhorizontal: 'glyphOrientationHorizontal',\n 'glyph-orientation-horizontal': 'glyphOrientationHorizontal',\n glyphorientationvertical: 'glyphOrientationVertical',\n 'glyph-orientation-vertical': 'glyphOrientationVertical',\n glyphref: 'glyphRef',\n gradienttransform: 'gradientTransform',\n gradientunits: 'gradientUnits',\n hanging: 'hanging',\n horizadvx: 'horizAdvX',\n 'horiz-adv-x': 'horizAdvX',\n horizoriginx: 'horizOriginX',\n 'horiz-origin-x': 'horizOriginX',\n ideographic: 'ideographic',\n imagerendering: 'imageRendering',\n 'image-rendering': 'imageRendering',\n in2: 'in2',\n in: 'in',\n inlist: 'inlist',\n intercept: 'intercept',\n k1: 'k1',\n k2: 'k2',\n k3: 'k3',\n k4: 'k4',\n k: 'k',\n kernelmatrix: 'kernelMatrix',\n kernelunitlength: 'kernelUnitLength',\n kerning: 'kerning',\n keypoints: 'keyPoints',\n keysplines: 'keySplines',\n keytimes: 'keyTimes',\n lengthadjust: 'lengthAdjust',\n letterspacing: 'letterSpacing',\n 'letter-spacing': 'letterSpacing',\n lightingcolor: 'lightingColor',\n 'lighting-color': 'lightingColor',\n limitingconeangle: 'limitingConeAngle',\n local: 'local',\n markerend: 'markerEnd',\n 'marker-end': 'markerEnd',\n markerheight: 'markerHeight',\n markermid: 'markerMid',\n 'marker-mid': 'markerMid',\n markerstart: 'markerStart',\n 'marker-start': 'markerStart',\n markerunits: 'markerUnits',\n markerwidth: 'markerWidth',\n mask: 'mask',\n maskcontentunits: 'maskContentUnits',\n maskunits: 'maskUnits',\n mathematical: 'mathematical',\n mode: 'mode',\n numoctaves: 'numOctaves',\n offset: 'offset',\n opacity: 'opacity',\n operator: 'operator',\n order: 'order',\n orient: 'orient',\n orientation: 'orientation',\n origin: 'origin',\n overflow: 'overflow',\n overlineposition: 'overlinePosition',\n 'overline-position': 'overlinePosition',\n overlinethickness: 'overlineThickness',\n 'overline-thickness': 'overlineThickness',\n paintorder: 'paintOrder',\n 'paint-order': 'paintOrder',\n panose1: 'panose1',\n 'panose-1': 'panose1',\n pathlength: 'pathLength',\n patterncontentunits: 'patternContentUnits',\n patterntransform: 'patternTransform',\n patternunits: 'patternUnits',\n pointerevents: 'pointerEvents',\n 'pointer-events': 'pointerEvents',\n points: 'points',\n pointsatx: 'pointsAtX',\n pointsaty: 'pointsAtY',\n pointsatz: 'pointsAtZ',\n prefix: 'prefix',\n preservealpha: 'preserveAlpha',\n preserveaspectratio: 'preserveAspectRatio',\n primitiveunits: 'primitiveUnits',\n property: 'property',\n r: 'r',\n radius: 'radius',\n refx: 'refX',\n refy: 'refY',\n renderingintent: 'renderingIntent',\n 'rendering-intent': 'renderingIntent',\n repeatcount: 'repeatCount',\n repeatdur: 'repeatDur',\n requiredextensions: 'requiredExtensions',\n requiredfeatures: 'requiredFeatures',\n resource: 'resource',\n restart: 'restart',\n result: 'result',\n results: 'results',\n rotate: 'rotate',\n rx: 'rx',\n ry: 'ry',\n scale: 'scale',\n security: 'security',\n seed: 'seed',\n shaperendering: 'shapeRendering',\n 'shape-rendering': 'shapeRendering',\n slope: 'slope',\n spacing: 'spacing',\n specularconstant: 'specularConstant',\n specularexponent: 'specularExponent',\n speed: 'speed',\n spreadmethod: 'spreadMethod',\n startoffset: 'startOffset',\n stddeviation: 'stdDeviation',\n stemh: 'stemh',\n stemv: 'stemv',\n stitchtiles: 'stitchTiles',\n stopcolor: 'stopColor',\n 'stop-color': 'stopColor',\n stopopacity: 'stopOpacity',\n 'stop-opacity': 'stopOpacity',\n strikethroughposition: 'strikethroughPosition',\n 'strikethrough-position': 'strikethroughPosition',\n strikethroughthickness: 'strikethroughThickness',\n 'strikethrough-thickness': 'strikethroughThickness',\n string: 'string',\n stroke: 'stroke',\n strokedasharray: 'strokeDasharray',\n 'stroke-dasharray': 'strokeDasharray',\n strokedashoffset: 'strokeDashoffset',\n 'stroke-dashoffset': 'strokeDashoffset',\n strokelinecap: 'strokeLinecap',\n 'stroke-linecap': 'strokeLinecap',\n strokelinejoin: 'strokeLinejoin',\n 'stroke-linejoin': 'strokeLinejoin',\n strokemiterlimit: 'strokeMiterlimit',\n 'stroke-miterlimit': 'strokeMiterlimit',\n strokewidth: 'strokeWidth',\n 'stroke-width': 'strokeWidth',\n strokeopacity: 'strokeOpacity',\n 'stroke-opacity': 'strokeOpacity',\n suppresscontenteditablewarning: 'suppressContentEditableWarning',\n suppresshydrationwarning: 'suppressHydrationWarning',\n surfacescale: 'surfaceScale',\n systemlanguage: 'systemLanguage',\n tablevalues: 'tableValues',\n targetx: 'targetX',\n targety: 'targetY',\n textanchor: 'textAnchor',\n 'text-anchor': 'textAnchor',\n textdecoration: 'textDecoration',\n 'text-decoration': 'textDecoration',\n textlength: 'textLength',\n textrendering: 'textRendering',\n 'text-rendering': 'textRendering',\n to: 'to',\n transform: 'transform',\n typeof: 'typeof',\n u1: 'u1',\n u2: 'u2',\n underlineposition: 'underlinePosition',\n 'underline-position': 'underlinePosition',\n underlinethickness: 'underlineThickness',\n 'underline-thickness': 'underlineThickness',\n unicode: 'unicode',\n unicodebidi: 'unicodeBidi',\n 'unicode-bidi': 'unicodeBidi',\n unicoderange: 'unicodeRange',\n 'unicode-range': 'unicodeRange',\n unitsperem: 'unitsPerEm',\n 'units-per-em': 'unitsPerEm',\n unselectable: 'unselectable',\n valphabetic: 'vAlphabetic',\n 'v-alphabetic': 'vAlphabetic',\n values: 'values',\n vectoreffect: 'vectorEffect',\n 'vector-effect': 'vectorEffect',\n version: 'version',\n vertadvy: 'vertAdvY',\n 'vert-adv-y': 'vertAdvY',\n vertoriginx: 'vertOriginX',\n 'vert-origin-x': 'vertOriginX',\n vertoriginy: 'vertOriginY',\n 'vert-origin-y': 'vertOriginY',\n vhanging: 'vHanging',\n 'v-hanging': 'vHanging',\n videographic: 'vIdeographic',\n 'v-ideographic': 'vIdeographic',\n viewbox: 'viewBox',\n viewtarget: 'viewTarget',\n visibility: 'visibility',\n vmathematical: 'vMathematical',\n 'v-mathematical': 'vMathematical',\n vocab: 'vocab',\n widths: 'widths',\n wordspacing: 'wordSpacing',\n 'word-spacing': 'wordSpacing',\n writingmode: 'writingMode',\n 'writing-mode': 'writingMode',\n x1: 'x1',\n x2: 'x2',\n x: 'x',\n xchannelselector: 'xChannelSelector',\n xheight: 'xHeight',\n 'x-height': 'xHeight',\n xlinkactuate: 'xlinkActuate',\n 'xlink:actuate': 'xlinkActuate',\n xlinkarcrole: 'xlinkArcrole',\n 'xlink:arcrole': 'xlinkArcrole',\n xlinkhref: 'xlinkHref',\n 'xlink:href': 'xlinkHref',\n xlinkrole: 'xlinkRole',\n 'xlink:role': 'xlinkRole',\n xlinkshow: 'xlinkShow',\n 'xlink:show': 'xlinkShow',\n xlinktitle: 'xlinkTitle',\n 'xlink:title': 'xlinkTitle',\n xlinktype: 'xlinkType',\n 'xlink:type': 'xlinkType',\n xmlbase: 'xmlBase',\n 'xml:base': 'xmlBase',\n xmllang: 'xmlLang',\n 'xml:lang': 'xmlLang',\n xmlns: 'xmlns',\n 'xml:space': 'xmlSpace',\n xmlnsxlink: 'xmlnsXlink',\n 'xmlns:xlink': 'xmlnsXlink',\n xmlspace: 'xmlSpace',\n y1: 'y1',\n y2: 'y2',\n y: 'y',\n ychannelselector: 'yChannelSelector',\n z: 'z',\n zoomandpan: 'zoomAndPan'\n };\n\n var validateProperty$1 = function validateProperty$1() {};\n\n {\n var warnedProperties$1 = {};\n var EVENT_NAME_REGEX = /^on./;\n var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;\n var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');\n var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');\n\n validateProperty$1 = function validateProperty$1(tagName, name, value, eventRegistry) {\n if (hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {\n return true;\n }\n\n var lowerCasedName = name.toLowerCase();\n\n if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {\n error('React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');\n warnedProperties$1[name] = true;\n return true;\n } // We can't rely on the event system being injected on the server.\n\n\n if (eventRegistry != null) {\n var registrationNameDependencies = eventRegistry.registrationNameDependencies,\n possibleRegistrationNames = eventRegistry.possibleRegistrationNames;\n\n if (registrationNameDependencies.hasOwnProperty(name)) {\n return true;\n }\n\n var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;\n\n if (registrationName != null) {\n error('Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (EVENT_NAME_REGEX.test(name)) {\n error('Unknown event handler property `%s`. It will be ignored.', name);\n warnedProperties$1[name] = true;\n return true;\n }\n } else if (EVENT_NAME_REGEX.test(name)) {\n // If no event plugins have been injected, we are in a server environment.\n // So we can't tell if the event name is correct for sure, but we can filter\n // out known bad ones like `onclick`. We can't suggest a specific replacement though.\n if (INVALID_EVENT_NAME_REGEX.test(name)) {\n error('Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);\n }\n\n warnedProperties$1[name] = true;\n return true;\n } // Let the ARIA attribute hook validate ARIA attributes\n\n\n if (rARIA$1.test(name) || rARIACamel$1.test(name)) {\n return true;\n }\n\n if (lowerCasedName === 'innerhtml') {\n error('Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (lowerCasedName === 'aria') {\n error('The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {\n error('Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', _typeof(value));\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (typeof value === 'number' && isNaN(value)) {\n error('Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);\n warnedProperties$1[name] = true;\n return true;\n }\n\n var propertyInfo = getPropertyInfo(name);\n var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; // Known attributes should match the casing specified in the property config.\n\n if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {\n var standardName = possibleStandardNames[lowerCasedName];\n\n if (standardName !== name) {\n error('Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);\n warnedProperties$1[name] = true;\n return true;\n }\n } else if (!isReserved && name !== lowerCasedName) {\n // Unknown attributes should have lowercase casing since that's how they\n // will be cased anyway with server rendering.\n error('React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {\n if (value) {\n error('Received `%s` for a non-boolean attribute `%s`.\\n\\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s=\"%s\" or %s={value.toString()}.', value, name, name, value, name);\n } else {\n error('Received `%s` for a non-boolean attribute `%s`.\\n\\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s=\"%s\" or %s={value.toString()}.\\n\\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);\n }\n\n warnedProperties$1[name] = true;\n return true;\n } // Now that we've validated casing, do not validate\n // data types for reserved props\n\n\n if (isReserved) {\n return true;\n } // Warn when a known attribute is a bad type\n\n\n if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {\n warnedProperties$1[name] = true;\n return false;\n } // Warn when passing the strings 'false' or 'true' into a boolean prop\n\n\n if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {\n error('Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string \"false\".', name, value);\n warnedProperties$1[name] = true;\n return true;\n }\n\n return true;\n };\n }\n\n var warnUnknownProperties = function warnUnknownProperties(type, props, eventRegistry) {\n {\n var unknownProps = [];\n\n for (var key in props) {\n var isValid = validateProperty$1(type, key, props[key], eventRegistry);\n\n if (!isValid) {\n unknownProps.push(key);\n }\n }\n\n var unknownPropString = unknownProps.map(function (prop) {\n return '`' + prop + '`';\n }).join(', ');\n\n if (unknownProps.length === 1) {\n error('Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type);\n } else if (unknownProps.length > 1) {\n error('Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type);\n }\n }\n };\n\n function validateProperties$2(type, props, eventRegistry) {\n if (isCustomComponent(type, props)) {\n return;\n }\n\n warnUnknownProperties(type, props, eventRegistry);\n }\n\n var warnValidStyle = function warnValidStyle() {};\n\n {\n // 'msTransform' is correct, but the other prefixes should be capitalized\n var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;\n var msPattern = /^-ms-/;\n var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon\n\n var badStyleValueWithSemicolonPattern = /;\\s*$/;\n var warnedStyleNames = {};\n var warnedStyleValues = {};\n var warnedForNaNValue = false;\n var warnedForInfinityValue = false;\n\n var camelize = function camelize(string) {\n return string.replace(hyphenPattern, function (_, character) {\n return character.toUpperCase();\n });\n };\n\n var warnHyphenatedStyleName = function warnHyphenatedStyleName(name) {\n if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n return;\n }\n\n warnedStyleNames[name] = true;\n error('Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests\n // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix\n // is converted to lowercase `ms`.\n camelize(name.replace(msPattern, 'ms-')));\n };\n\n var warnBadVendoredStyleName = function warnBadVendoredStyleName(name) {\n if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n return;\n }\n\n warnedStyleNames[name] = true;\n error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));\n };\n\n var warnStyleValueWithSemicolon = function warnStyleValueWithSemicolon(name, value) {\n if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {\n return;\n }\n\n warnedStyleValues[value] = true;\n error(\"Style property values shouldn't contain a semicolon. \" + 'Try \"%s: %s\" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));\n };\n\n var warnStyleValueIsNaN = function warnStyleValueIsNaN(name, value) {\n if (warnedForNaNValue) {\n return;\n }\n\n warnedForNaNValue = true;\n error('`NaN` is an invalid value for the `%s` css style property.', name);\n };\n\n var warnStyleValueIsInfinity = function warnStyleValueIsInfinity(name, value) {\n if (warnedForInfinityValue) {\n return;\n }\n\n warnedForInfinityValue = true;\n error('`Infinity` is an invalid value for the `%s` css style property.', name);\n };\n\n warnValidStyle = function warnValidStyle(name, value) {\n if (name.indexOf('-') > -1) {\n warnHyphenatedStyleName(name);\n } else if (badVendoredStyleNamePattern.test(name)) {\n warnBadVendoredStyleName(name);\n } else if (badStyleValueWithSemicolonPattern.test(value)) {\n warnStyleValueWithSemicolon(name, value);\n }\n\n if (typeof value === 'number') {\n if (isNaN(value)) {\n warnStyleValueIsNaN(name, value);\n } else if (!isFinite(value)) {\n warnStyleValueIsInfinity(name, value);\n }\n }\n };\n }\n var warnValidStyle$1 = warnValidStyle; // code copied and modified from escape-html\n\n var matchHtmlRegExp = /[\"'&<>]/;\n /**\n * Escapes special characters and HTML entities in a given html string.\n *\n * @param {string} string HTML string to escape for later insertion\n * @return {string}\n * @public\n */\n\n function escapeHtml(string) {\n {\n checkHtmlStringCoercion(string);\n }\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34:\n // \"\n escape = '"';\n break;\n\n case 38:\n // &\n escape = '&';\n break;\n\n case 39:\n // '\n escape = '''; // modified from escape-html; used to be '''\n\n break;\n\n case 60:\n // <\n escape = '<';\n break;\n\n case 62:\n // >\n escape = '>';\n break;\n\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index ? html + str.substring(lastIndex, index) : html;\n } // end code copied and modified from escape-html\n\n /**\n * Escapes text to prevent scripting attacks.\n *\n * @param {*} text Text value to escape.\n * @return {string} An escaped string.\n */\n\n\n function escapeTextForBrowser(text) {\n if (typeof text === 'boolean' || typeof text === 'number') {\n // this shortcircuit helps perf for types that we know will never have\n // special characters, especially given that this function is used often\n // for numeric dom ids.\n return '' + text;\n }\n\n return escapeHtml(text);\n }\n\n var uppercasePattern = /([A-Z])/g;\n var msPattern$1 = /^ms-/;\n /**\n * Hyphenates a camelcased CSS property name, for example:\n *\n * > hyphenateStyleName('backgroundColor')\n * < \"background-color\"\n * > hyphenateStyleName('MozTransition')\n * < \"-moz-transition\"\n * > hyphenateStyleName('msTransition')\n * < \"-ms-transition\"\n *\n * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix\n * is converted to `-ms-`.\n */\n\n function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern$1, '-ms-');\n } // and any newline or tab are filtered out as if they're not part of the URL.\n // https://url.spec.whatwg.org/#url-parsing\n // Tab or newline are defined as \\r\\n\\t:\n // https://infra.spec.whatwg.org/#ascii-tab-or-newline\n // A C0 control is a code point in the range \\u0000 NULL to \\u001F\n // INFORMATION SEPARATOR ONE, inclusive:\n // https://infra.spec.whatwg.org/#c0-control-or-space\n\n /* eslint-disable max-len */\n\n\n var isJavaScriptProtocol = /^[\\u0000-\\u001F ]*j[\\r\\n\\t]*a[\\r\\n\\t]*v[\\r\\n\\t]*a[\\r\\n\\t]*s[\\r\\n\\t]*c[\\r\\n\\t]*r[\\r\\n\\t]*i[\\r\\n\\t]*p[\\r\\n\\t]*t[\\r\\n\\t]*\\:/i;\n var didWarn = false;\n\n function sanitizeURL(url) {\n {\n if (!didWarn && isJavaScriptProtocol.test(url)) {\n didWarn = true;\n error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));\n }\n }\n }\n\n var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\n function isArray(a) {\n return isArrayImpl(a);\n }\n\n var startInlineScript = stringToPrecomputedChunk('');\n var startScriptSrc = stringToPrecomputedChunk('');\n /**\n * This escaping function is designed to work with bootstrapScriptContent only.\n * because we know we are escaping the entire script. We can avoid for instance\n * escaping html comment string sequences that are valid javascript as well because\n * if there are no sebsequent ');\n\n function writeCompletedSegmentInstruction(destination, responseState, contentSegmentID) {\n writeChunk(destination, responseState.startInlineScript);\n\n if (!responseState.sentCompleteSegmentFunction) {\n // The first time we write this, we'll need to include the full implementation.\n responseState.sentCompleteSegmentFunction = true;\n writeChunk(destination, completeSegmentScript1Full);\n } else {\n // Future calls can just reuse the same function.\n writeChunk(destination, completeSegmentScript1Partial);\n }\n\n writeChunk(destination, responseState.segmentPrefix);\n var formattedID = stringToChunk(contentSegmentID.toString(16));\n writeChunk(destination, formattedID);\n writeChunk(destination, completeSegmentScript2);\n writeChunk(destination, responseState.placeholderPrefix);\n writeChunk(destination, formattedID);\n return writeChunkAndReturn(destination, completeSegmentScript3);\n }\n\n var completeBoundaryScript1Full = stringToPrecomputedChunk(completeBoundaryFunction + ';$RC(\"');\n var completeBoundaryScript1Partial = stringToPrecomputedChunk('$RC(\"');\n var completeBoundaryScript2 = stringToPrecomputedChunk('\",\"');\n var completeBoundaryScript3 = stringToPrecomputedChunk('\")');\n\n function writeCompletedBoundaryInstruction(destination, responseState, boundaryID, contentSegmentID) {\n writeChunk(destination, responseState.startInlineScript);\n\n if (!responseState.sentCompleteBoundaryFunction) {\n // The first time we write this, we'll need to include the full implementation.\n responseState.sentCompleteBoundaryFunction = true;\n writeChunk(destination, completeBoundaryScript1Full);\n } else {\n // Future calls can just reuse the same function.\n writeChunk(destination, completeBoundaryScript1Partial);\n }\n\n if (boundaryID === null) {\n throw new Error('An ID must have been assigned before we can complete the boundary.');\n }\n\n var formattedContentID = stringToChunk(contentSegmentID.toString(16));\n writeChunk(destination, boundaryID);\n writeChunk(destination, completeBoundaryScript2);\n writeChunk(destination, responseState.segmentPrefix);\n writeChunk(destination, formattedContentID);\n return writeChunkAndReturn(destination, completeBoundaryScript3);\n }\n\n var clientRenderScript1Full = stringToPrecomputedChunk(clientRenderFunction + ';$RX(\"');\n var clientRenderScript1Partial = stringToPrecomputedChunk('$RX(\"');\n var clientRenderScript1A = stringToPrecomputedChunk('\"');\n var clientRenderScript2 = stringToPrecomputedChunk(')');\n var clientRenderErrorScriptArgInterstitial = stringToPrecomputedChunk(',');\n\n function writeClientRenderBoundaryInstruction(destination, responseState, boundaryID, errorDigest, errorMessage, errorComponentStack) {\n writeChunk(destination, responseState.startInlineScript);\n\n if (!responseState.sentClientRenderFunction) {\n // The first time we write this, we'll need to include the full implementation.\n responseState.sentClientRenderFunction = true;\n writeChunk(destination, clientRenderScript1Full);\n } else {\n // Future calls can just reuse the same function.\n writeChunk(destination, clientRenderScript1Partial);\n }\n\n if (boundaryID === null) {\n throw new Error('An ID must have been assigned before we can complete the boundary.');\n }\n\n writeChunk(destination, boundaryID);\n writeChunk(destination, clientRenderScript1A);\n\n if (errorDigest || errorMessage || errorComponentStack) {\n writeChunk(destination, clientRenderErrorScriptArgInterstitial);\n writeChunk(destination, stringToChunk(escapeJSStringsForInstructionScripts(errorDigest || '')));\n }\n\n if (errorMessage || errorComponentStack) {\n writeChunk(destination, clientRenderErrorScriptArgInterstitial);\n writeChunk(destination, stringToChunk(escapeJSStringsForInstructionScripts(errorMessage || '')));\n }\n\n if (errorComponentStack) {\n writeChunk(destination, clientRenderErrorScriptArgInterstitial);\n writeChunk(destination, stringToChunk(escapeJSStringsForInstructionScripts(errorComponentStack)));\n }\n\n return writeChunkAndReturn(destination, clientRenderScript2);\n }\n\n var regexForJSStringsInScripts = /[<\\u2028\\u2029]/g;\n\n function escapeJSStringsForInstructionScripts(input) {\n var escaped = JSON.stringify(input);\n return escaped.replace(regexForJSStringsInScripts, function (match) {\n switch (match) {\n // santizing breaking out of strings and script tags\n case '<':\n return \"\\\\u003c\";\n\n case \"\\u2028\":\n return \"\\\\u2028\";\n\n case \"\\u2029\":\n return \"\\\\u2029\";\n\n default:\n {\n // eslint-disable-next-line react-internal/prod-error-codes\n throw new Error('escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React');\n }\n }\n });\n }\n\n var assign = Object.assign; // ATTENTION\n // When adding new symbols to this file,\n // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n // The Symbol used to tag the ReactElement-like types.\n\n var REACT_ELEMENT_TYPE = Symbol.for('react.element');\n var REACT_PORTAL_TYPE = Symbol.for('react.portal');\n var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\n var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\n var REACT_PROFILER_TYPE = Symbol.for('react.profiler');\n var REACT_PROVIDER_TYPE = Symbol.for('react.provider');\n var REACT_CONTEXT_TYPE = Symbol.for('react.context');\n var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\n var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\n var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\n var REACT_MEMO_TYPE = Symbol.for('react.memo');\n var REACT_LAZY_TYPE = Symbol.for('react.lazy');\n var REACT_SCOPE_TYPE = Symbol.for('react.scope');\n var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode');\n var REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden');\n var REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED = Symbol.for('react.default_value');\n var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator';\n\n function getIteratorFn(maybeIterable) {\n if (maybeIterable === null || _typeof(maybeIterable) !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n }\n\n function getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n } // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\n function getContextName(type) {\n return type.displayName || 'Context';\n } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\n function getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n }\n\n if (_typeof(type) === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n } // Helpers to patch console.logs to avoid logging during side-effect free\n // replaying on render function. This currently only patches the object\n // lazily which won't cover if the log function was extracted eagerly.\n // We could also eagerly patch the method.\n\n\n var disabledDepth = 0;\n var prevLog;\n var prevInfo;\n var prevWarn;\n var prevError;\n var prevGroup;\n var prevGroupCollapsed;\n var prevGroupEnd;\n\n function disabledLog() {}\n\n disabledLog.__reactDisabledLog = true;\n\n function disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n }\n\n function reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n }\n\n var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\n var prefix;\n\n function describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n }\n\n var reentry = false;\n var componentFrameCache;\n {\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n }\n\n function describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if (!fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function Fake() {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function set() {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if ((typeof Reflect === \"undefined\" ? \"undefined\" : _typeof(Reflect)) === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n return syntheticFrame;\n }\n\n function describeClassComponentFrame(ctor, source, ownerFn) {\n {\n return describeNativeComponentFrame(ctor, true);\n }\n }\n\n function describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n }\n\n function shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n }\n\n function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (_typeof(type) === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n }\n\n var loggedTypeFailures = {};\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\n function setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n }\n\n function checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + _typeof(typeSpecs[typeSpecName]) + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, _typeof(error$1));\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n error('Failed %s type: %s', location, error$1.message);\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n }\n\n var warnedAboutMissingGetChildContext;\n {\n warnedAboutMissingGetChildContext = {};\n }\n var emptyContextObject = {};\n {\n Object.freeze(emptyContextObject);\n }\n\n function getMaskedContext(type, unmaskedContext) {\n {\n var contextTypes = type.contextTypes;\n\n if (!contextTypes) {\n return emptyContextObject;\n }\n\n var context = {};\n\n for (var key in contextTypes) {\n context[key] = unmaskedContext[key];\n }\n\n {\n var name = getComponentNameFromType(type) || 'Unknown';\n checkPropTypes(contextTypes, context, 'context', name);\n }\n return context;\n }\n }\n\n function processChildContext(instance, type, parentContext, childContextTypes) {\n {\n // TODO (bvaughn) Replace this behavior with an invariant() in the future.\n // It has only been added in Fiber to match the (unintentional) behavior in Stack.\n if (typeof instance.getChildContext !== 'function') {\n {\n var componentName = getComponentNameFromType(type) || 'Unknown';\n\n if (!warnedAboutMissingGetChildContext[componentName]) {\n warnedAboutMissingGetChildContext[componentName] = true;\n error('%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName);\n }\n }\n return parentContext;\n }\n\n var childContext = instance.getChildContext();\n\n for (var contextKey in childContext) {\n if (!(contextKey in childContextTypes)) {\n throw new Error((getComponentNameFromType(type) || 'Unknown') + \".getChildContext(): key \\\"\" + contextKey + \"\\\" is not defined in childContextTypes.\");\n }\n }\n\n {\n var name = getComponentNameFromType(type) || 'Unknown';\n checkPropTypes(childContextTypes, childContext, 'child context', name);\n }\n return assign({}, parentContext, childContext);\n }\n }\n\n var rendererSigil;\n {\n // Use this to detect multiple renderers using the same context\n rendererSigil = {};\n } // Used to store the parent path of all context overrides in a shared linked list.\n // Forming a reverse tree.\n\n var rootContextSnapshot = null; // We assume that this runtime owns the \"current\" field on all ReactContext instances.\n // This global (actually thread local) state represents what state all those \"current\",\n // fields are currently in.\n\n var currentActiveSnapshot = null;\n\n function popNode(prev) {\n {\n prev.context._currentValue = prev.parentValue;\n }\n }\n\n function pushNode(next) {\n {\n next.context._currentValue = next.value;\n }\n }\n\n function popToNearestCommonAncestor(prev, next) {\n if (prev === next) ;else {\n popNode(prev);\n var parentPrev = prev.parent;\n var parentNext = next.parent;\n\n if (parentPrev === null) {\n if (parentNext !== null) {\n throw new Error('The stacks must reach the root at the same time. This is a bug in React.');\n }\n } else {\n if (parentNext === null) {\n throw new Error('The stacks must reach the root at the same time. This is a bug in React.');\n }\n\n popToNearestCommonAncestor(parentPrev, parentNext);\n } // On the way back, we push the new ones that weren't common.\n\n\n pushNode(next);\n }\n }\n\n function popAllPrevious(prev) {\n popNode(prev);\n var parentPrev = prev.parent;\n\n if (parentPrev !== null) {\n popAllPrevious(parentPrev);\n }\n }\n\n function pushAllNext(next) {\n var parentNext = next.parent;\n\n if (parentNext !== null) {\n pushAllNext(parentNext);\n }\n\n pushNode(next);\n }\n\n function popPreviousToCommonLevel(prev, next) {\n popNode(prev);\n var parentPrev = prev.parent;\n\n if (parentPrev === null) {\n throw new Error('The depth must equal at least at zero before reaching the root. This is a bug in React.');\n }\n\n if (parentPrev.depth === next.depth) {\n // We found the same level. Now we just need to find a shared ancestor.\n popToNearestCommonAncestor(parentPrev, next);\n } else {\n // We must still be deeper.\n popPreviousToCommonLevel(parentPrev, next);\n }\n }\n\n function popNextToCommonLevel(prev, next) {\n var parentNext = next.parent;\n\n if (parentNext === null) {\n throw new Error('The depth must equal at least at zero before reaching the root. This is a bug in React.');\n }\n\n if (prev.depth === parentNext.depth) {\n // We found the same level. Now we just need to find a shared ancestor.\n popToNearestCommonAncestor(prev, parentNext);\n } else {\n // We must still be deeper.\n popNextToCommonLevel(prev, parentNext);\n }\n\n pushNode(next);\n } // Perform context switching to the new snapshot.\n // To make it cheap to read many contexts, while not suspending, we make the switch eagerly by\n // updating all the context's current values. That way reads, always just read the current value.\n // At the cost of updating contexts even if they're never read by this subtree.\n\n\n function switchContext(newSnapshot) {\n // The basic algorithm we need to do is to pop back any contexts that are no longer on the stack.\n // We also need to update any new contexts that are now on the stack with the deepest value.\n // The easiest way to update new contexts is to just reapply them in reverse order from the\n // perspective of the backpointers. To avoid allocating a lot when switching, we use the stack\n // for that. Therefore this algorithm is recursive.\n // 1) First we pop which ever snapshot tree was deepest. Popping old contexts as we go.\n // 2) Then we find the nearest common ancestor from there. Popping old contexts as we go.\n // 3) Then we reapply new contexts on the way back up the stack.\n var prev = currentActiveSnapshot;\n var next = newSnapshot;\n\n if (prev !== next) {\n if (prev === null) {\n // $FlowFixMe: This has to be non-null since it's not equal to prev.\n pushAllNext(next);\n } else if (next === null) {\n popAllPrevious(prev);\n } else if (prev.depth === next.depth) {\n popToNearestCommonAncestor(prev, next);\n } else if (prev.depth > next.depth) {\n popPreviousToCommonLevel(prev, next);\n } else {\n popNextToCommonLevel(prev, next);\n }\n\n currentActiveSnapshot = next;\n }\n }\n\n function pushProvider(context, nextValue) {\n var prevValue;\n {\n prevValue = context._currentValue;\n context._currentValue = nextValue;\n {\n if (context._currentRenderer !== undefined && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) {\n error('Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.');\n }\n\n context._currentRenderer = rendererSigil;\n }\n }\n var prevNode = currentActiveSnapshot;\n var newNode = {\n parent: prevNode,\n depth: prevNode === null ? 0 : prevNode.depth + 1,\n context: context,\n parentValue: prevValue,\n value: nextValue\n };\n currentActiveSnapshot = newNode;\n return newNode;\n }\n\n function popProvider(context) {\n var prevSnapshot = currentActiveSnapshot;\n\n if (prevSnapshot === null) {\n throw new Error('Tried to pop a Context at the root of the app. This is a bug in React.');\n }\n\n {\n if (prevSnapshot.context !== context) {\n error('The parent context is not the expected context. This is probably a bug in React.');\n }\n }\n {\n var value = prevSnapshot.parentValue;\n\n if (value === REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED) {\n prevSnapshot.context._currentValue = prevSnapshot.context._defaultValue;\n } else {\n prevSnapshot.context._currentValue = value;\n }\n\n {\n if (context._currentRenderer !== undefined && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) {\n error('Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.');\n }\n\n context._currentRenderer = rendererSigil;\n }\n }\n return currentActiveSnapshot = prevSnapshot.parent;\n }\n\n function getActiveContext() {\n return currentActiveSnapshot;\n }\n\n function readContext(context) {\n var value = context._currentValue;\n return value;\n }\n /**\n * `ReactInstanceMap` maintains a mapping from a public facing stateful\n * instance (key) and the internal representation (value). This allows public\n * methods to accept the user facing instance as an argument and map them back\n * to internal methods.\n *\n * Note that this module is currently shared and assumed to be stateless.\n * If this becomes an actual Map, that will break.\n */\n\n\n function get(key) {\n return key._reactInternals;\n }\n\n function set(key, value) {\n key._reactInternals = value;\n }\n\n var didWarnAboutNoopUpdateForComponent = {};\n var didWarnAboutDeprecatedWillMount = {};\n var didWarnAboutUninitializedState;\n var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;\n var didWarnAboutLegacyLifecyclesAndDerivedState;\n var didWarnAboutUndefinedDerivedState;\n var warnOnUndefinedDerivedState;\n var warnOnInvalidCallback;\n var didWarnAboutDirectlyAssigningPropsToState;\n var didWarnAboutContextTypeAndContextTypes;\n var didWarnAboutInvalidateContextType;\n {\n didWarnAboutUninitializedState = new Set();\n didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();\n didWarnAboutLegacyLifecyclesAndDerivedState = new Set();\n didWarnAboutDirectlyAssigningPropsToState = new Set();\n didWarnAboutUndefinedDerivedState = new Set();\n didWarnAboutContextTypeAndContextTypes = new Set();\n didWarnAboutInvalidateContextType = new Set();\n var didWarnOnInvalidCallback = new Set();\n\n warnOnInvalidCallback = function warnOnInvalidCallback(callback, callerName) {\n if (callback === null || typeof callback === 'function') {\n return;\n }\n\n var key = callerName + '_' + callback;\n\n if (!didWarnOnInvalidCallback.has(key)) {\n didWarnOnInvalidCallback.add(key);\n error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);\n }\n };\n\n warnOnUndefinedDerivedState = function warnOnUndefinedDerivedState(type, partialState) {\n if (partialState === undefined) {\n var componentName = getComponentNameFromType(type) || 'Component';\n\n if (!didWarnAboutUndefinedDerivedState.has(componentName)) {\n didWarnAboutUndefinedDerivedState.add(componentName);\n error('%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName);\n }\n }\n };\n }\n\n function warnNoop(publicInstance, callerName) {\n {\n var _constructor = publicInstance.constructor;\n var componentName = _constructor && getComponentNameFromType(_constructor) || 'ReactClass';\n var warningKey = componentName + '.' + callerName;\n\n if (didWarnAboutNoopUpdateForComponent[warningKey]) {\n return;\n }\n\n error('%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMount() on the server. ' + 'This is a no-op.\\n\\nPlease check the code for the %s component.', callerName, callerName, componentName);\n didWarnAboutNoopUpdateForComponent[warningKey] = true;\n }\n }\n\n var classComponentUpdater = {\n isMounted: function isMounted(inst) {\n return false;\n },\n enqueueSetState: function enqueueSetState(inst, payload, callback) {\n var internals = get(inst);\n\n if (internals.queue === null) {\n warnNoop(inst, 'setState');\n } else {\n internals.queue.push(payload);\n {\n if (callback !== undefined && callback !== null) {\n warnOnInvalidCallback(callback, 'setState');\n }\n }\n }\n },\n enqueueReplaceState: function enqueueReplaceState(inst, payload, callback) {\n var internals = get(inst);\n internals.replace = true;\n internals.queue = [payload];\n {\n if (callback !== undefined && callback !== null) {\n warnOnInvalidCallback(callback, 'setState');\n }\n }\n },\n enqueueForceUpdate: function enqueueForceUpdate(inst, callback) {\n var internals = get(inst);\n\n if (internals.queue === null) {\n warnNoop(inst, 'forceUpdate');\n } else {\n {\n if (callback !== undefined && callback !== null) {\n warnOnInvalidCallback(callback, 'setState');\n }\n }\n }\n }\n };\n\n function applyDerivedStateFromProps(instance, ctor, getDerivedStateFromProps, prevState, nextProps) {\n var partialState = getDerivedStateFromProps(nextProps, prevState);\n {\n warnOnUndefinedDerivedState(ctor, partialState);\n } // Merge the partial state and the previous state.\n\n var newState = partialState === null || partialState === undefined ? prevState : assign({}, prevState, partialState);\n return newState;\n }\n\n function constructClassInstance(ctor, props, maskedLegacyContext) {\n var context = emptyContextObject;\n var contextType = ctor.contextType;\n {\n if ('contextType' in ctor) {\n var isValid = // Allow null for conditional declaration\n contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a \n\n if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {\n didWarnAboutInvalidateContextType.add(ctor);\n var addendum = '';\n\n if (contextType === undefined) {\n addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.';\n } else if (_typeof(contextType) !== 'object') {\n addendum = ' However, it is set to a ' + _typeof(contextType) + '.';\n } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {\n addendum = ' Did you accidentally pass the Context.Provider instead?';\n } else if (contextType._context !== undefined) {\n // \n addendum = ' Did you accidentally pass the Context.Consumer instead?';\n } else {\n addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';\n }\n\n error('%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentNameFromType(ctor) || 'Component', addendum);\n }\n }\n }\n\n if (_typeof(contextType) === 'object' && contextType !== null) {\n context = readContext(contextType);\n } else {\n context = maskedLegacyContext;\n }\n\n var instance = new ctor(props, context);\n {\n if (typeof ctor.getDerivedStateFromProps === 'function' && (instance.state === null || instance.state === undefined)) {\n var componentName = getComponentNameFromType(ctor) || 'Component';\n\n if (!didWarnAboutUninitializedState.has(componentName)) {\n didWarnAboutUninitializedState.add(componentName);\n error('`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName);\n }\n } // If new component APIs are defined, \"unsafe\" lifecycles won't be called.\n // Warn about these lifecycles if they are present.\n // Don't warn about react-lifecycles-compat polyfilled methods though.\n\n\n if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') {\n var foundWillMountName = null;\n var foundWillReceivePropsName = null;\n var foundWillUpdateName = null;\n\n if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) {\n foundWillMountName = 'componentWillMount';\n } else if (typeof instance.UNSAFE_componentWillMount === 'function') {\n foundWillMountName = 'UNSAFE_componentWillMount';\n }\n\n if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {\n foundWillReceivePropsName = 'componentWillReceiveProps';\n } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';\n }\n\n if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {\n foundWillUpdateName = 'componentWillUpdate';\n } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') {\n foundWillUpdateName = 'UNSAFE_componentWillUpdate';\n }\n\n if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {\n var _componentName = getComponentNameFromType(ctor) || 'Component';\n\n var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';\n\n if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {\n didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);\n error('Unsafe legacy lifecycles will not be called for components using new component APIs.\\n\\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\\n\\n' + 'The above lifecycles should be removed. Learn more about this warning here:\\n' + 'https://reactjs.org/link/unsafe-component-lifecycles', _componentName, newApiName, foundWillMountName !== null ? \"\\n \" + foundWillMountName : '', foundWillReceivePropsName !== null ? \"\\n \" + foundWillReceivePropsName : '', foundWillUpdateName !== null ? \"\\n \" + foundWillUpdateName : '');\n }\n }\n }\n }\n return instance;\n }\n\n function checkClassInstance(instance, ctor, newProps) {\n {\n var name = getComponentNameFromType(ctor) || 'Component';\n var renderPresent = instance.render;\n\n if (!renderPresent) {\n if (ctor.prototype && typeof ctor.prototype.render === 'function') {\n error('%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name);\n } else {\n error('%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name);\n }\n }\n\n if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) {\n error('getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name);\n }\n\n if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name);\n }\n\n if (instance.propTypes) {\n error('propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name);\n }\n\n if (instance.contextType) {\n error('contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name);\n }\n\n {\n if (instance.contextTypes) {\n error('contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name);\n }\n\n if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {\n didWarnAboutContextTypeAndContextTypes.add(ctor);\n error('%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name);\n }\n }\n\n if (typeof instance.componentShouldUpdate === 'function') {\n error('%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name);\n }\n\n if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') {\n error('%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentNameFromType(ctor) || 'A pure component');\n }\n\n if (typeof instance.componentDidUnmount === 'function') {\n error('%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name);\n }\n\n if (typeof instance.componentDidReceiveProps === 'function') {\n error('%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name);\n }\n\n if (typeof instance.componentWillRecieveProps === 'function') {\n error('%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name);\n }\n\n if (typeof instance.UNSAFE_componentWillRecieveProps === 'function') {\n error('%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name);\n }\n\n var hasMutatedProps = instance.props !== newProps;\n\n if (instance.props !== undefined && hasMutatedProps) {\n error('%s(...): When calling super() in `%s`, make sure to pass ' + \"up the same props that your component's constructor was passed.\", name, name);\n }\n\n if (instance.defaultProps) {\n error('Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name);\n }\n\n if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {\n didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);\n error('%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentNameFromType(ctor));\n }\n\n if (typeof instance.getDerivedStateFromProps === 'function') {\n error('%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name);\n }\n\n if (typeof instance.getDerivedStateFromError === 'function') {\n error('%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name);\n }\n\n if (typeof ctor.getSnapshotBeforeUpdate === 'function') {\n error('%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name);\n }\n\n var _state = instance.state;\n\n if (_state && (_typeof(_state) !== 'object' || isArray(_state))) {\n error('%s.state: must be set to an object or null', name);\n }\n\n if (typeof instance.getChildContext === 'function' && _typeof(ctor.childContextTypes) !== 'object') {\n error('%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name);\n }\n }\n }\n\n function callComponentWillMount(type, instance) {\n var oldState = instance.state;\n\n if (typeof instance.componentWillMount === 'function') {\n {\n if (instance.componentWillMount.__suppressDeprecationWarning !== true) {\n var componentName = getComponentNameFromType(type) || 'Unknown';\n\n if (!didWarnAboutDeprecatedWillMount[componentName]) {\n warn( // keep this warning in sync with ReactStrictModeWarning.js\n 'componentWillMount has been renamed, and is not recommended for use. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\\n\\n' + '* Move code from componentWillMount to componentDidMount (preferred in most cases) ' + 'or the constructor.\\n' + '\\nPlease update the following components: %s', componentName);\n didWarnAboutDeprecatedWillMount[componentName] = true;\n }\n }\n }\n instance.componentWillMount();\n }\n\n if (typeof instance.UNSAFE_componentWillMount === 'function') {\n instance.UNSAFE_componentWillMount();\n }\n\n if (oldState !== instance.state) {\n {\n error('%s.componentWillMount(): Assigning directly to this.state is ' + \"deprecated (except inside a component's \" + 'constructor). Use setState instead.', getComponentNameFromType(type) || 'Component');\n }\n classComponentUpdater.enqueueReplaceState(instance, instance.state, null);\n }\n }\n\n function processUpdateQueue(internalInstance, inst, props, maskedLegacyContext) {\n if (internalInstance.queue !== null && internalInstance.queue.length > 0) {\n var oldQueue = internalInstance.queue;\n var oldReplace = internalInstance.replace;\n internalInstance.queue = null;\n internalInstance.replace = false;\n\n if (oldReplace && oldQueue.length === 1) {\n inst.state = oldQueue[0];\n } else {\n var nextState = oldReplace ? oldQueue[0] : inst.state;\n var dontMutate = true;\n\n for (var i = oldReplace ? 1 : 0; i < oldQueue.length; i++) {\n var partial = oldQueue[i];\n var partialState = typeof partial === 'function' ? partial.call(inst, nextState, props, maskedLegacyContext) : partial;\n\n if (partialState != null) {\n if (dontMutate) {\n dontMutate = false;\n nextState = assign({}, nextState, partialState);\n } else {\n assign(nextState, partialState);\n }\n }\n }\n\n inst.state = nextState;\n }\n } else {\n internalInstance.queue = null;\n }\n } // Invokes the mount life-cycles on a previously never rendered instance.\n\n\n function mountClassInstance(instance, ctor, newProps, maskedLegacyContext) {\n {\n checkClassInstance(instance, ctor, newProps);\n }\n var initialState = instance.state !== undefined ? instance.state : null;\n instance.updater = classComponentUpdater;\n instance.props = newProps;\n instance.state = initialState; // We don't bother initializing the refs object on the server, since we're not going to resolve them anyway.\n // The internal instance will be used to manage updates that happen during this mount.\n\n var internalInstance = {\n queue: [],\n replace: false\n };\n set(instance, internalInstance);\n var contextType = ctor.contextType;\n\n if (_typeof(contextType) === 'object' && contextType !== null) {\n instance.context = readContext(contextType);\n } else {\n instance.context = maskedLegacyContext;\n }\n\n {\n if (instance.state === newProps) {\n var componentName = getComponentNameFromType(ctor) || 'Component';\n\n if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {\n didWarnAboutDirectlyAssigningPropsToState.add(componentName);\n error('%s: It is not recommended to assign props directly to state ' + \"because updates to props won't be reflected in state. \" + 'In most cases, it is better to use props directly.', componentName);\n }\n }\n }\n var getDerivedStateFromProps = ctor.getDerivedStateFromProps;\n\n if (typeof getDerivedStateFromProps === 'function') {\n instance.state = applyDerivedStateFromProps(instance, ctor, getDerivedStateFromProps, initialState, newProps);\n } // In order to support react-lifecycles-compat polyfilled components,\n // Unsafe lifecycles should not be invoked for components using the new APIs.\n\n\n if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {\n callComponentWillMount(ctor, instance); // If we had additional state updates during this life-cycle, let's\n // process them now.\n\n processUpdateQueue(internalInstance, instance, newProps, maskedLegacyContext);\n }\n } // Ids are base 32 strings whose binary representation corresponds to the\n // position of a node in a tree.\n // Every time the tree forks into multiple children, we add additional bits to\n // the left of the sequence that represent the position of the child within the\n // current level of children.\n //\n // 00101 00010001011010101\n // ╰─┬─╯ ╰───────┬───────╯\n // Fork 5 of 20 Parent id\n //\n // The leading 0s are important. In the above example, you only need 3 bits to\n // represent slot 5. However, you need 5 bits to represent all the forks at\n // the current level, so we must account for the empty bits at the end.\n //\n // For this same reason, slots are 1-indexed instead of 0-indexed. Otherwise,\n // the zeroth id at a level would be indistinguishable from its parent.\n //\n // If a node has only one child, and does not materialize an id (i.e. does not\n // contain a useId hook), then we don't need to allocate any space in the\n // sequence. It's treated as a transparent indirection. For example, these two\n // trees produce the same ids:\n //\n // <> <>\n // \n // \n // \n // \n // \n //\n // However, we cannot skip any node that materializes an id. Otherwise, a parent\n // id that does not fork would be indistinguishable from its child id. For\n // example, this tree does not fork, but the parent and child must have\n // different ids.\n //\n // \n // \n // \n //\n // To handle this scenario, every time we materialize an id, we allocate a\n // new level with a single slot. You can think of this as a fork with only one\n // prong, or an array of children with length 1.\n //\n // It's possible for the size of the sequence to exceed 32 bits, the max\n // size for bitwise operations. When this happens, we make more room by\n // converting the right part of the id to a string and storing it in an overflow\n // variable. We use a base 32 string representation, because 32 is the largest\n // power of 2 that is supported by toString(). We want the base to be large so\n // that the resulting ids are compact, and we want the base to be a power of 2\n // because every log2(base) bits corresponds to a single character, i.e. every\n // log2(32) = 5 bits. That means we can lop bits off the end 5 at a time without\n // affecting the final result.\n\n\n var emptyTreeContext = {\n id: 1,\n overflow: ''\n };\n\n function getTreeId(context) {\n var overflow = context.overflow;\n var idWithLeadingBit = context.id;\n var id = idWithLeadingBit & ~getLeadingBit(idWithLeadingBit);\n return id.toString(32) + overflow;\n }\n\n function pushTreeContext(baseContext, totalChildren, index) {\n var baseIdWithLeadingBit = baseContext.id;\n var baseOverflow = baseContext.overflow; // The leftmost 1 marks the end of the sequence, non-inclusive. It's not part\n // of the id; we use it to account for leading 0s.\n\n var baseLength = getBitLength(baseIdWithLeadingBit) - 1;\n var baseId = baseIdWithLeadingBit & ~(1 << baseLength);\n var slot = index + 1;\n var length = getBitLength(totalChildren) + baseLength; // 30 is the max length we can store without overflowing, taking into\n // consideration the leading 1 we use to mark the end of the sequence.\n\n if (length > 30) {\n // We overflowed the bitwise-safe range. Fall back to slower algorithm.\n // This branch assumes the length of the base id is greater than 5; it won't\n // work for smaller ids, because you need 5 bits per character.\n //\n // We encode the id in multiple steps: first the base id, then the\n // remaining digits.\n //\n // Each 5 bit sequence corresponds to a single base 32 character. So for\n // example, if the current id is 23 bits long, we can convert 20 of those\n // bits into a string of 4 characters, with 3 bits left over.\n //\n // First calculate how many bits in the base id represent a complete\n // sequence of characters.\n var numberOfOverflowBits = baseLength - baseLength % 5; // Then create a bitmask that selects only those bits.\n\n var newOverflowBits = (1 << numberOfOverflowBits) - 1; // Select the bits, and convert them to a base 32 string.\n\n var newOverflow = (baseId & newOverflowBits).toString(32); // Now we can remove those bits from the base id.\n\n var restOfBaseId = baseId >> numberOfOverflowBits;\n var restOfBaseLength = baseLength - numberOfOverflowBits; // Finally, encode the rest of the bits using the normal algorithm. Because\n // we made more room, this time it won't overflow.\n\n var restOfLength = getBitLength(totalChildren) + restOfBaseLength;\n var restOfNewBits = slot << restOfBaseLength;\n var id = restOfNewBits | restOfBaseId;\n var overflow = newOverflow + baseOverflow;\n return {\n id: 1 << restOfLength | id,\n overflow: overflow\n };\n } else {\n // Normal path\n var newBits = slot << baseLength;\n\n var _id = newBits | baseId;\n\n var _overflow = baseOverflow;\n return {\n id: 1 << length | _id,\n overflow: _overflow\n };\n }\n }\n\n function getBitLength(number) {\n return 32 - clz32(number);\n }\n\n function getLeadingBit(id) {\n return 1 << getBitLength(id) - 1;\n } // TODO: Math.clz32 is supported in Node 12+. Maybe we can drop the fallback.\n\n\n var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback; // Count leading zeros.\n // Based on:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32\n\n var log = Math.log;\n var LN2 = Math.LN2;\n\n function clz32Fallback(x) {\n var asUint = x >>> 0;\n\n if (asUint === 0) {\n return 32;\n }\n\n return 31 - (log(asUint) / LN2 | 0) | 0;\n }\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n\n\n function is(x, y) {\n return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare\n ;\n }\n\n var objectIs = typeof Object.is === 'function' ? Object.is : is;\n var currentlyRenderingComponent = null;\n var currentlyRenderingTask = null;\n var firstWorkInProgressHook = null;\n var workInProgressHook = null; // Whether the work-in-progress hook is a re-rendered hook\n\n var isReRender = false; // Whether an update was scheduled during the currently executing render pass.\n\n var didScheduleRenderPhaseUpdate = false; // Counts the number of useId hooks in this component\n\n var localIdCounter = 0; // Lazily created map of render-phase updates\n\n var renderPhaseUpdates = null; // Counter to prevent infinite loops.\n\n var numberOfReRenders = 0;\n var RE_RENDER_LIMIT = 25;\n var isInHookUserCodeInDev = false; // In DEV, this is the name of the currently executing primitive hook\n\n var currentHookNameInDev;\n\n function resolveCurrentlyRenderingComponent() {\n if (currentlyRenderingComponent === null) {\n throw new Error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\\n' + '2. You might be breaking the Rules of Hooks\\n' + '3. You might have more than one copy of React in the same app\\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');\n }\n\n {\n if (isInHookUserCodeInDev) {\n error('Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://reactjs.org/link/rules-of-hooks');\n }\n }\n return currentlyRenderingComponent;\n }\n\n function areHookInputsEqual(nextDeps, prevDeps) {\n if (prevDeps === null) {\n {\n error('%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);\n }\n return false;\n }\n\n {\n // Don't bother comparing lengths in prod because these arrays should be\n // passed inline.\n if (nextDeps.length !== prevDeps.length) {\n error('The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\\n\\n' + 'Previous: %s\\n' + 'Incoming: %s', currentHookNameInDev, \"[\" + nextDeps.join(', ') + \"]\", \"[\" + prevDeps.join(', ') + \"]\");\n }\n }\n\n for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {\n if (objectIs(nextDeps[i], prevDeps[i])) {\n continue;\n }\n\n return false;\n }\n\n return true;\n }\n\n function createHook() {\n if (numberOfReRenders > 0) {\n throw new Error('Rendered more hooks than during the previous render');\n }\n\n return {\n memoizedState: null,\n queue: null,\n next: null\n };\n }\n\n function createWorkInProgressHook() {\n if (workInProgressHook === null) {\n // This is the first hook in the list\n if (firstWorkInProgressHook === null) {\n isReRender = false;\n firstWorkInProgressHook = workInProgressHook = createHook();\n } else {\n // There's already a work-in-progress. Reuse it.\n isReRender = true;\n workInProgressHook = firstWorkInProgressHook;\n }\n } else {\n if (workInProgressHook.next === null) {\n isReRender = false; // Append to the end of the list\n\n workInProgressHook = workInProgressHook.next = createHook();\n } else {\n // There's already a work-in-progress. Reuse it.\n isReRender = true;\n workInProgressHook = workInProgressHook.next;\n }\n }\n\n return workInProgressHook;\n }\n\n function prepareToUseHooks(task, componentIdentity) {\n currentlyRenderingComponent = componentIdentity;\n currentlyRenderingTask = task;\n {\n isInHookUserCodeInDev = false;\n } // The following should have already been reset\n // didScheduleRenderPhaseUpdate = false;\n // localIdCounter = 0;\n // firstWorkInProgressHook = null;\n // numberOfReRenders = 0;\n // renderPhaseUpdates = null;\n // workInProgressHook = null;\n\n localIdCounter = 0;\n }\n\n function finishHooks(Component, props, children, refOrContext) {\n // This must be called after every function component to prevent hooks from\n // being used in classes.\n while (didScheduleRenderPhaseUpdate) {\n // Updates were scheduled during the render phase. They are stored in\n // the `renderPhaseUpdates` map. Call the component again, reusing the\n // work-in-progress hooks and applying the additional updates on top. Keep\n // restarting until no more updates are scheduled.\n didScheduleRenderPhaseUpdate = false;\n localIdCounter = 0;\n numberOfReRenders += 1; // Start over from the beginning of the list\n\n workInProgressHook = null;\n children = Component(props, refOrContext);\n }\n\n resetHooksState();\n return children;\n }\n\n function checkDidRenderIdHook() {\n // This should be called immediately after every finishHooks call.\n // Conceptually, it's part of the return value of finishHooks; it's only a\n // separate function to avoid using an array tuple.\n var didRenderIdHook = localIdCounter !== 0;\n return didRenderIdHook;\n } // Reset the internal hooks state if an error occurs while rendering a component\n\n\n function resetHooksState() {\n {\n isInHookUserCodeInDev = false;\n }\n currentlyRenderingComponent = null;\n currentlyRenderingTask = null;\n didScheduleRenderPhaseUpdate = false;\n firstWorkInProgressHook = null;\n numberOfReRenders = 0;\n renderPhaseUpdates = null;\n workInProgressHook = null;\n }\n\n function readContext$1(context) {\n {\n if (isInHookUserCodeInDev) {\n error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');\n }\n }\n return readContext(context);\n }\n\n function useContext(context) {\n {\n currentHookNameInDev = 'useContext';\n }\n resolveCurrentlyRenderingComponent();\n return readContext(context);\n }\n\n function basicStateReducer(state, action) {\n // $FlowFixMe: Flow doesn't like mixed types\n return typeof action === 'function' ? action(state) : action;\n }\n\n function useState(initialState) {\n {\n currentHookNameInDev = 'useState';\n }\n return useReducer(basicStateReducer, // useReducer has a special case to support lazy useState initializers\n initialState);\n }\n\n function useReducer(reducer, initialArg, init) {\n {\n if (reducer !== basicStateReducer) {\n currentHookNameInDev = 'useReducer';\n }\n }\n currentlyRenderingComponent = resolveCurrentlyRenderingComponent();\n workInProgressHook = createWorkInProgressHook();\n\n if (isReRender) {\n // This is a re-render. Apply the new render phase updates to the previous\n // current hook.\n var queue = workInProgressHook.queue;\n var dispatch = queue.dispatch;\n\n if (renderPhaseUpdates !== null) {\n // Render phase updates are stored in a map of queue -> linked list\n var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);\n\n if (firstRenderPhaseUpdate !== undefined) {\n renderPhaseUpdates.delete(queue);\n var newState = workInProgressHook.memoizedState;\n var update = firstRenderPhaseUpdate;\n\n do {\n // Process this render phase update. We don't have to check the\n // priority because it will always be the same as the current\n // render's.\n var action = update.action;\n {\n isInHookUserCodeInDev = true;\n }\n newState = reducer(newState, action);\n {\n isInHookUserCodeInDev = false;\n }\n update = update.next;\n } while (update !== null);\n\n workInProgressHook.memoizedState = newState;\n return [newState, dispatch];\n }\n }\n\n return [workInProgressHook.memoizedState, dispatch];\n } else {\n {\n isInHookUserCodeInDev = true;\n }\n var initialState;\n\n if (reducer === basicStateReducer) {\n // Special case for `useState`.\n initialState = typeof initialArg === 'function' ? initialArg() : initialArg;\n } else {\n initialState = init !== undefined ? init(initialArg) : initialArg;\n }\n\n {\n isInHookUserCodeInDev = false;\n }\n workInProgressHook.memoizedState = initialState;\n\n var _queue = workInProgressHook.queue = {\n last: null,\n dispatch: null\n };\n\n var _dispatch = _queue.dispatch = dispatchAction.bind(null, currentlyRenderingComponent, _queue);\n\n return [workInProgressHook.memoizedState, _dispatch];\n }\n }\n\n function useMemo(nextCreate, deps) {\n currentlyRenderingComponent = resolveCurrentlyRenderingComponent();\n workInProgressHook = createWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n\n if (workInProgressHook !== null) {\n var prevState = workInProgressHook.memoizedState;\n\n if (prevState !== null) {\n if (nextDeps !== null) {\n var prevDeps = prevState[1];\n\n if (areHookInputsEqual(nextDeps, prevDeps)) {\n return prevState[0];\n }\n }\n }\n }\n\n {\n isInHookUserCodeInDev = true;\n }\n var nextValue = nextCreate();\n {\n isInHookUserCodeInDev = false;\n }\n workInProgressHook.memoizedState = [nextValue, nextDeps];\n return nextValue;\n }\n\n function useRef(initialValue) {\n currentlyRenderingComponent = resolveCurrentlyRenderingComponent();\n workInProgressHook = createWorkInProgressHook();\n var previousRef = workInProgressHook.memoizedState;\n\n if (previousRef === null) {\n var ref = {\n current: initialValue\n };\n {\n Object.seal(ref);\n }\n workInProgressHook.memoizedState = ref;\n return ref;\n } else {\n return previousRef;\n }\n }\n\n function useLayoutEffect(create, inputs) {\n {\n currentHookNameInDev = 'useLayoutEffect';\n error('useLayoutEffect does nothing on the server, because its effect cannot ' + \"be encoded into the server renderer's output format. This will lead \" + 'to a mismatch between the initial, non-hydrated UI and the intended ' + 'UI. To avoid this, useLayoutEffect should only be used in ' + 'components that render exclusively on the client. ' + 'See https://reactjs.org/link/uselayouteffect-ssr for common fixes.');\n }\n }\n\n function dispatchAction(componentIdentity, queue, action) {\n if (numberOfReRenders >= RE_RENDER_LIMIT) {\n throw new Error('Too many re-renders. React limits the number of renders to prevent ' + 'an infinite loop.');\n }\n\n if (componentIdentity === currentlyRenderingComponent) {\n // This is a render phase update. Stash it in a lazily-created map of\n // queue -> linked list of updates. After this render pass, we'll restart\n // and apply the stashed updates on top of the work-in-progress hook.\n didScheduleRenderPhaseUpdate = true;\n var update = {\n action: action,\n next: null\n };\n\n if (renderPhaseUpdates === null) {\n renderPhaseUpdates = new Map();\n }\n\n var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);\n\n if (firstRenderPhaseUpdate === undefined) {\n renderPhaseUpdates.set(queue, update);\n } else {\n // Append the update to the end of the list.\n var lastRenderPhaseUpdate = firstRenderPhaseUpdate;\n\n while (lastRenderPhaseUpdate.next !== null) {\n lastRenderPhaseUpdate = lastRenderPhaseUpdate.next;\n }\n\n lastRenderPhaseUpdate.next = update;\n }\n }\n }\n\n function useCallback(callback, deps) {\n return useMemo(function () {\n return callback;\n }, deps);\n } // TODO Decide on how to implement this hook for server rendering.\n // If a mutation occurs during render, consider triggering a Suspense boundary\n // and falling back to client rendering.\n\n\n function useMutableSource(source, getSnapshot, subscribe) {\n resolveCurrentlyRenderingComponent();\n return getSnapshot(source._source);\n }\n\n function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {\n if (getServerSnapshot === undefined) {\n throw new Error('Missing getServerSnapshot, which is required for ' + 'server-rendered content. Will revert to client rendering.');\n }\n\n return getServerSnapshot();\n }\n\n function useDeferredValue(value) {\n resolveCurrentlyRenderingComponent();\n return value;\n }\n\n function unsupportedStartTransition() {\n throw new Error('startTransition cannot be called during server rendering.');\n }\n\n function useTransition() {\n resolveCurrentlyRenderingComponent();\n return [false, unsupportedStartTransition];\n }\n\n function useId() {\n var task = currentlyRenderingTask;\n var treeId = getTreeId(task.treeContext);\n var responseState = currentResponseState;\n\n if (responseState === null) {\n throw new Error('Invalid hook call. Hooks can only be called inside of the body of a function component.');\n }\n\n var localId = localIdCounter++;\n return makeId(responseState, treeId, localId);\n }\n\n function noop() {}\n\n var Dispatcher = {\n readContext: readContext$1,\n useContext: useContext,\n useMemo: useMemo,\n useReducer: useReducer,\n useRef: useRef,\n useState: useState,\n useInsertionEffect: noop,\n useLayoutEffect: useLayoutEffect,\n useCallback: useCallback,\n // useImperativeHandle is not run in the server environment\n useImperativeHandle: noop,\n // Effects are not run in the server environment.\n useEffect: noop,\n // Debugging effect\n useDebugValue: noop,\n useDeferredValue: useDeferredValue,\n useTransition: useTransition,\n useId: useId,\n // Subscriptions are not setup in a server environment.\n useMutableSource: useMutableSource,\n useSyncExternalStore: useSyncExternalStore\n };\n var currentResponseState = null;\n\n function setCurrentResponseState(responseState) {\n currentResponseState = responseState;\n }\n\n function getStackByComponentStackNode(componentStack) {\n try {\n var info = '';\n var node = componentStack;\n\n do {\n switch (node.tag) {\n case 0:\n info += describeBuiltInComponentFrame(node.type, null, null);\n break;\n\n case 1:\n info += describeFunctionComponentFrame(node.type, null, null);\n break;\n\n case 2:\n info += describeClassComponentFrame(node.type, null, null);\n break;\n }\n\n node = node.parent;\n } while (node);\n\n return info;\n } catch (x) {\n return '\\nError generating stack: ' + x.message + '\\n' + x.stack;\n }\n }\n\n var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;\n var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n var PENDING = 0;\n var COMPLETED = 1;\n var FLUSHED = 2;\n var ABORTED = 3;\n var ERRORED = 4;\n var OPEN = 0;\n var CLOSING = 1;\n var CLOSED = 2; // This is a default heuristic for how to split up the HTML content into progressive\n // loading. Our goal is to be able to display additional new content about every 500ms.\n // Faster than that is unnecessary and should be throttled on the client. It also\n // adds unnecessary overhead to do more splits. We don't know if it's a higher or lower\n // end device but higher end suffer less from the overhead than lower end does from\n // not getting small enough pieces. We error on the side of low end.\n // We base this on low end 3G speeds which is about 500kbits per second. We assume\n // that there can be a reasonable drop off from max bandwidth which leaves you with\n // as little as 80%. We can receive half of that each 500ms - at best. In practice,\n // a little bandwidth is lost to processing and contention - e.g. CSS and images that\n // are downloaded along with the main content. So we estimate about half of that to be\n // the lower end throughput. In other words, we expect that you can at least show\n // about 12.5kb of content per 500ms. Not counting starting latency for the first\n // paint.\n // 500 * 1024 / 8 * .8 * 0.5 / 2\n\n var DEFAULT_PROGRESSIVE_CHUNK_SIZE = 12800;\n\n function defaultErrorHandler(error) {\n console['error'](error); // Don't transform to our wrapper\n\n return null;\n }\n\n function noop$1() {}\n\n function createRequest(children, responseState, rootFormatContext, progressiveChunkSize, onError, onAllReady, onShellReady, onShellError, onFatalError) {\n var pingedTasks = [];\n var abortSet = new Set();\n var request = {\n destination: null,\n responseState: responseState,\n progressiveChunkSize: progressiveChunkSize === undefined ? DEFAULT_PROGRESSIVE_CHUNK_SIZE : progressiveChunkSize,\n status: OPEN,\n fatalError: null,\n nextSegmentId: 0,\n allPendingTasks: 0,\n pendingRootTasks: 0,\n completedRootSegment: null,\n abortableTasks: abortSet,\n pingedTasks: pingedTasks,\n clientRenderedBoundaries: [],\n completedBoundaries: [],\n partialBoundaries: [],\n onError: onError === undefined ? defaultErrorHandler : onError,\n onAllReady: onAllReady === undefined ? noop$1 : onAllReady,\n onShellReady: onShellReady === undefined ? noop$1 : onShellReady,\n onShellError: onShellError === undefined ? noop$1 : onShellError,\n onFatalError: onFatalError === undefined ? noop$1 : onFatalError\n }; // This segment represents the root fallback.\n\n var rootSegment = createPendingSegment(request, 0, null, rootFormatContext, // Root segments are never embedded in Text on either edge\n false, false); // There is no parent so conceptually, we're unblocked to flush this segment.\n\n rootSegment.parentFlushed = true;\n var rootTask = createTask(request, children, null, rootSegment, abortSet, emptyContextObject, rootContextSnapshot, emptyTreeContext);\n pingedTasks.push(rootTask);\n return request;\n }\n\n function pingTask(request, task) {\n var pingedTasks = request.pingedTasks;\n pingedTasks.push(task);\n\n if (pingedTasks.length === 1) {\n scheduleWork(function () {\n return performWork(request);\n });\n }\n }\n\n function createSuspenseBoundary(request, fallbackAbortableTasks) {\n return {\n id: UNINITIALIZED_SUSPENSE_BOUNDARY_ID,\n rootSegmentID: -1,\n parentFlushed: false,\n pendingTasks: 0,\n forceClientRender: false,\n completedSegments: [],\n byteSize: 0,\n fallbackAbortableTasks: fallbackAbortableTasks,\n errorDigest: null\n };\n }\n\n function createTask(request, node, blockedBoundary, blockedSegment, abortSet, legacyContext, context, treeContext) {\n request.allPendingTasks++;\n\n if (blockedBoundary === null) {\n request.pendingRootTasks++;\n } else {\n blockedBoundary.pendingTasks++;\n }\n\n var task = {\n node: node,\n ping: function ping() {\n return pingTask(request, task);\n },\n blockedBoundary: blockedBoundary,\n blockedSegment: blockedSegment,\n abortSet: abortSet,\n legacyContext: legacyContext,\n context: context,\n treeContext: treeContext\n };\n {\n task.componentStack = null;\n }\n abortSet.add(task);\n return task;\n }\n\n function createPendingSegment(request, index, boundary, formatContext, lastPushedText, textEmbedded) {\n return {\n status: PENDING,\n id: -1,\n // lazily assigned later\n index: index,\n parentFlushed: false,\n chunks: [],\n children: [],\n formatContext: formatContext,\n boundary: boundary,\n lastPushedText: lastPushedText,\n textEmbedded: textEmbedded\n };\n } // DEV-only global reference to the currently executing task\n\n\n var currentTaskInDEV = null;\n\n function getCurrentStackInDEV() {\n {\n if (currentTaskInDEV === null || currentTaskInDEV.componentStack === null) {\n return '';\n }\n\n return getStackByComponentStackNode(currentTaskInDEV.componentStack);\n }\n }\n\n function pushBuiltInComponentStackInDEV(task, type) {\n {\n task.componentStack = {\n tag: 0,\n parent: task.componentStack,\n type: type\n };\n }\n }\n\n function pushFunctionComponentStackInDEV(task, type) {\n {\n task.componentStack = {\n tag: 1,\n parent: task.componentStack,\n type: type\n };\n }\n }\n\n function pushClassComponentStackInDEV(task, type) {\n {\n task.componentStack = {\n tag: 2,\n parent: task.componentStack,\n type: type\n };\n }\n }\n\n function popComponentStackInDEV(task) {\n {\n if (task.componentStack === null) {\n error('Unexpectedly popped too many stack frames. This is a bug in React.');\n } else {\n task.componentStack = task.componentStack.parent;\n }\n }\n } // stash the component stack of an unwinding error until it is processed\n\n\n var lastBoundaryErrorComponentStackDev = null;\n\n function captureBoundaryErrorDetailsDev(boundary, error) {\n {\n var errorMessage;\n\n if (typeof error === 'string') {\n errorMessage = error;\n } else if (error && typeof error.message === 'string') {\n errorMessage = error.message;\n } else {\n // eslint-disable-next-line react-internal/safe-string-coercion\n errorMessage = String(error);\n }\n\n var errorComponentStack = lastBoundaryErrorComponentStackDev || getCurrentStackInDEV();\n lastBoundaryErrorComponentStackDev = null;\n boundary.errorMessage = errorMessage;\n boundary.errorComponentStack = errorComponentStack;\n }\n }\n\n function logRecoverableError(request, error) {\n // If this callback errors, we intentionally let that error bubble up to become a fatal error\n // so that someone fixes the error reporting instead of hiding it.\n var errorDigest = request.onError(error);\n\n if (errorDigest != null && typeof errorDigest !== 'string') {\n // eslint-disable-next-line react-internal/prod-error-codes\n throw new Error(\"onError returned something with a type other than \\\"string\\\". onError should return a string and may return null or undefined but must not return anything else. It received something of type \\\"\" + _typeof(errorDigest) + \"\\\" instead\");\n }\n\n return errorDigest;\n }\n\n function fatalError(request, error) {\n // This is called outside error handling code such as if the root errors outside\n // a suspense boundary or if the root suspense boundary's fallback errors.\n // It's also called if React itself or its host configs errors.\n var onShellError = request.onShellError;\n onShellError(error);\n var onFatalError = request.onFatalError;\n onFatalError(error);\n\n if (request.destination !== null) {\n request.status = CLOSED;\n closeWithError(request.destination, error);\n } else {\n request.status = CLOSING;\n request.fatalError = error;\n }\n }\n\n function renderSuspenseBoundary(request, task, props) {\n pushBuiltInComponentStackInDEV(task, 'Suspense');\n var parentBoundary = task.blockedBoundary;\n var parentSegment = task.blockedSegment; // Each time we enter a suspense boundary, we split out into a new segment for\n // the fallback so that we can later replace that segment with the content.\n // This also lets us split out the main content even if it doesn't suspend,\n // in case it ends up generating a large subtree of content.\n\n var fallback = props.fallback;\n var content = props.children;\n var fallbackAbortSet = new Set();\n var newBoundary = createSuspenseBoundary(request, fallbackAbortSet);\n var insertionIndex = parentSegment.chunks.length; // The children of the boundary segment is actually the fallback.\n\n var boundarySegment = createPendingSegment(request, insertionIndex, newBoundary, parentSegment.formatContext, // boundaries never require text embedding at their edges because comment nodes bound them\n false, false);\n parentSegment.children.push(boundarySegment); // The parentSegment has a child Segment at this index so we reset the lastPushedText marker on the parent\n\n parentSegment.lastPushedText = false; // This segment is the actual child content. We can start rendering that immediately.\n\n var contentRootSegment = createPendingSegment(request, 0, null, parentSegment.formatContext, // boundaries never require text embedding at their edges because comment nodes bound them\n false, false); // We mark the root segment as having its parent flushed. It's not really flushed but there is\n // no parent segment so there's nothing to wait on.\n\n contentRootSegment.parentFlushed = true; // Currently this is running synchronously. We could instead schedule this to pingedTasks.\n // I suspect that there might be some efficiency benefits from not creating the suspended task\n // and instead just using the stack if possible.\n // TODO: Call this directly instead of messing with saving and restoring contexts.\n // We can reuse the current context and task to render the content immediately without\n // context switching. We just need to temporarily switch which boundary and which segment\n // we're writing to. If something suspends, it'll spawn new suspended task with that context.\n\n task.blockedBoundary = newBoundary;\n task.blockedSegment = contentRootSegment;\n\n try {\n // We use the safe form because we don't handle suspending here. Only error handling.\n renderNode(request, task, content);\n pushSegmentFinale(contentRootSegment.chunks, request.responseState, contentRootSegment.lastPushedText, contentRootSegment.textEmbedded);\n contentRootSegment.status = COMPLETED;\n queueCompletedSegment(newBoundary, contentRootSegment);\n\n if (newBoundary.pendingTasks === 0) {\n // This must have been the last segment we were waiting on. This boundary is now complete.\n // Therefore we won't need the fallback. We early return so that we don't have to create\n // the fallback.\n popComponentStackInDEV(task);\n return;\n }\n } catch (error) {\n contentRootSegment.status = ERRORED;\n newBoundary.forceClientRender = true;\n newBoundary.errorDigest = logRecoverableError(request, error);\n {\n captureBoundaryErrorDetailsDev(newBoundary, error);\n } // We don't need to decrement any task numbers because we didn't spawn any new task.\n // We don't need to schedule any task because we know the parent has written yet.\n // We do need to fallthrough to create the fallback though.\n } finally {\n task.blockedBoundary = parentBoundary;\n task.blockedSegment = parentSegment;\n } // We create suspended task for the fallback because we don't want to actually work\n // on it yet in case we finish the main content, so we queue for later.\n\n\n var suspendedFallbackTask = createTask(request, fallback, parentBoundary, boundarySegment, fallbackAbortSet, task.legacyContext, task.context, task.treeContext);\n {\n suspendedFallbackTask.componentStack = task.componentStack;\n } // TODO: This should be queued at a separate lower priority queue so that we only work\n // on preparing fallbacks if we don't have any more main content to task on.\n\n request.pingedTasks.push(suspendedFallbackTask);\n popComponentStackInDEV(task);\n }\n\n function renderHostElement(request, task, type, props) {\n pushBuiltInComponentStackInDEV(task, type);\n var segment = task.blockedSegment;\n var children = pushStartInstance(segment.chunks, type, props, request.responseState, segment.formatContext);\n segment.lastPushedText = false;\n var prevContext = segment.formatContext;\n segment.formatContext = getChildFormatContext(prevContext, type, props); // We use the non-destructive form because if something suspends, we still\n // need to pop back up and finish this subtree of HTML.\n\n renderNode(request, task, children); // We expect that errors will fatal the whole task and that we don't need\n // the correct context. Therefore this is not in a finally.\n\n segment.formatContext = prevContext;\n pushEndInstance(segment.chunks, type);\n segment.lastPushedText = false;\n popComponentStackInDEV(task);\n }\n\n function shouldConstruct$1(Component) {\n return Component.prototype && Component.prototype.isReactComponent;\n }\n\n function renderWithHooks(request, task, Component, props, secondArg) {\n var componentIdentity = {};\n prepareToUseHooks(task, componentIdentity);\n var result = Component(props, secondArg);\n return finishHooks(Component, props, result, secondArg);\n }\n\n function finishClassComponent(request, task, instance, Component, props) {\n var nextChildren = instance.render();\n {\n if (instance.props !== props) {\n if (!didWarnAboutReassigningProps) {\n error('It looks like %s is reassigning its own `this.props` while rendering. ' + 'This is not supported and can lead to confusing bugs.', getComponentNameFromType(Component) || 'a component');\n }\n\n didWarnAboutReassigningProps = true;\n }\n }\n {\n var childContextTypes = Component.childContextTypes;\n\n if (childContextTypes !== null && childContextTypes !== undefined) {\n var previousContext = task.legacyContext;\n var mergedContext = processChildContext(instance, Component, previousContext, childContextTypes);\n task.legacyContext = mergedContext;\n renderNodeDestructive(request, task, nextChildren);\n task.legacyContext = previousContext;\n return;\n }\n }\n renderNodeDestructive(request, task, nextChildren);\n }\n\n function renderClassComponent(request, task, Component, props) {\n pushClassComponentStackInDEV(task, Component);\n var maskedContext = getMaskedContext(Component, task.legacyContext);\n var instance = constructClassInstance(Component, props, maskedContext);\n mountClassInstance(instance, Component, props, maskedContext);\n finishClassComponent(request, task, instance, Component, props);\n popComponentStackInDEV(task);\n }\n\n var didWarnAboutBadClass = {};\n var didWarnAboutModulePatternComponent = {};\n var didWarnAboutContextTypeOnFunctionComponent = {};\n var didWarnAboutGetDerivedStateOnFunctionComponent = {};\n var didWarnAboutReassigningProps = false;\n var didWarnAboutDefaultPropsOnFunctionComponent = {};\n var didWarnAboutGenerators = false;\n var didWarnAboutMaps = false;\n var hasWarnedAboutUsingContextAsConsumer = false; // This would typically be a function component but we still support module pattern\n // components for some reason.\n\n function renderIndeterminateComponent(request, task, Component, props) {\n var legacyContext;\n {\n legacyContext = getMaskedContext(Component, task.legacyContext);\n }\n pushFunctionComponentStackInDEV(task, Component);\n {\n if (Component.prototype && typeof Component.prototype.render === 'function') {\n var componentName = getComponentNameFromType(Component) || 'Unknown';\n\n if (!didWarnAboutBadClass[componentName]) {\n error(\"The <%s /> component appears to have a render method, but doesn't extend React.Component. \" + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName);\n didWarnAboutBadClass[componentName] = true;\n }\n }\n }\n var value = renderWithHooks(request, task, Component, props, legacyContext);\n var hasId = checkDidRenderIdHook();\n {\n // Support for module components is deprecated and is removed behind a flag.\n // Whether or not it would crash later, we want to show a good message in DEV first.\n if (_typeof(value) === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {\n var _componentName = getComponentNameFromType(Component) || 'Unknown';\n\n if (!didWarnAboutModulePatternComponent[_componentName]) {\n error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + \"If you can't use a class try assigning the prototype on the function as a workaround. \" + \"`%s.prototype = React.Component.prototype`. Don't use an arrow function since it \" + 'cannot be called with `new` by React.', _componentName, _componentName, _componentName);\n didWarnAboutModulePatternComponent[_componentName] = true;\n }\n }\n }\n\n if ( // Run these checks in production only if the flag is off.\n // Eventually we'll delete this branch altogether.\n _typeof(value) === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {\n {\n var _componentName2 = getComponentNameFromType(Component) || 'Unknown';\n\n if (!didWarnAboutModulePatternComponent[_componentName2]) {\n error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + \"If you can't use a class try assigning the prototype on the function as a workaround. \" + \"`%s.prototype = React.Component.prototype`. Don't use an arrow function since it \" + 'cannot be called with `new` by React.', _componentName2, _componentName2, _componentName2);\n didWarnAboutModulePatternComponent[_componentName2] = true;\n }\n }\n mountClassInstance(value, Component, props, legacyContext);\n finishClassComponent(request, task, value, Component, props);\n } else {\n {\n validateFunctionComponentInDev(Component);\n } // We're now successfully past this task, and we don't have to pop back to\n // the previous task every again, so we can use the destructive recursive form.\n\n if (hasId) {\n // This component materialized an id. We treat this as its own level, with\n // a single \"child\" slot.\n var prevTreeContext = task.treeContext;\n var totalChildren = 1;\n var index = 0;\n task.treeContext = pushTreeContext(prevTreeContext, totalChildren, index);\n\n try {\n renderNodeDestructive(request, task, value);\n } finally {\n task.treeContext = prevTreeContext;\n }\n } else {\n renderNodeDestructive(request, task, value);\n }\n }\n\n popComponentStackInDEV(task);\n }\n\n function validateFunctionComponentInDev(Component) {\n {\n if (Component) {\n if (Component.childContextTypes) {\n error('%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component');\n }\n }\n\n if (Component.defaultProps !== undefined) {\n var componentName = getComponentNameFromType(Component) || 'Unknown';\n\n if (!didWarnAboutDefaultPropsOnFunctionComponent[componentName]) {\n error('%s: Support for defaultProps will be removed from function components ' + 'in a future major release. Use JavaScript default parameters instead.', componentName);\n didWarnAboutDefaultPropsOnFunctionComponent[componentName] = true;\n }\n }\n\n if (typeof Component.getDerivedStateFromProps === 'function') {\n var _componentName3 = getComponentNameFromType(Component) || 'Unknown';\n\n if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) {\n error('%s: Function components do not support getDerivedStateFromProps.', _componentName3);\n didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true;\n }\n }\n\n if (_typeof(Component.contextType) === 'object' && Component.contextType !== null) {\n var _componentName4 = getComponentNameFromType(Component) || 'Unknown';\n\n if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) {\n error('%s: Function components do not support contextType.', _componentName4);\n didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true;\n }\n }\n }\n }\n\n function resolveDefaultProps(Component, baseProps) {\n if (Component && Component.defaultProps) {\n // Resolve default props. Taken from ReactElement\n var props = assign({}, baseProps);\n var defaultProps = Component.defaultProps;\n\n for (var propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n\n return props;\n }\n\n return baseProps;\n }\n\n function renderForwardRef(request, task, type, props, ref) {\n pushFunctionComponentStackInDEV(task, type.render);\n var children = renderWithHooks(request, task, type.render, props, ref);\n var hasId = checkDidRenderIdHook();\n\n if (hasId) {\n // This component materialized an id. We treat this as its own level, with\n // a single \"child\" slot.\n var prevTreeContext = task.treeContext;\n var totalChildren = 1;\n var index = 0;\n task.treeContext = pushTreeContext(prevTreeContext, totalChildren, index);\n\n try {\n renderNodeDestructive(request, task, children);\n } finally {\n task.treeContext = prevTreeContext;\n }\n } else {\n renderNodeDestructive(request, task, children);\n }\n\n popComponentStackInDEV(task);\n }\n\n function renderMemo(request, task, type, props, ref) {\n var innerType = type.type;\n var resolvedProps = resolveDefaultProps(innerType, props);\n renderElement(request, task, innerType, resolvedProps, ref);\n }\n\n function renderContextConsumer(request, task, context, props) {\n // The logic below for Context differs depending on PROD or DEV mode. In\n // DEV mode, we create a separate object for Context.Consumer that acts\n // like a proxy to Context. This proxy object adds unnecessary code in PROD\n // so we use the old behaviour (Context.Consumer references Context) to\n // reduce size and overhead. The separate object references context via\n // a property called \"_context\", which also gives us the ability to check\n // in DEV mode if this property exists or not and warn if it does not.\n {\n if (context._context === undefined) {\n // This may be because it's a Context (rather than a Consumer).\n // Or it may be because it's older React where they're the same thing.\n // We only want to warn if we're sure it's a new React.\n if (context !== context.Consumer) {\n if (!hasWarnedAboutUsingContextAsConsumer) {\n hasWarnedAboutUsingContextAsConsumer = true;\n error('Rendering directly is not supported and will be removed in ' + 'a future major release. Did you mean to render instead?');\n }\n }\n } else {\n context = context._context;\n }\n }\n var render = props.children;\n {\n if (typeof render !== 'function') {\n error('A context consumer was rendered with multiple children, or a child ' + \"that isn't a function. A context consumer expects a single child \" + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.');\n }\n }\n var newValue = readContext(context);\n var newChildren = render(newValue);\n renderNodeDestructive(request, task, newChildren);\n }\n\n function renderContextProvider(request, task, type, props) {\n var context = type._context;\n var value = props.value;\n var children = props.children;\n var prevSnapshot;\n {\n prevSnapshot = task.context;\n }\n task.context = pushProvider(context, value);\n renderNodeDestructive(request, task, children);\n task.context = popProvider(context);\n {\n if (prevSnapshot !== task.context) {\n error('Popping the context provider did not return back to the original snapshot. This is a bug in React.');\n }\n }\n }\n\n function renderLazyComponent(request, task, lazyComponent, props, ref) {\n pushBuiltInComponentStackInDEV(task, 'Lazy');\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n var Component = init(payload);\n var resolvedProps = resolveDefaultProps(Component, props);\n renderElement(request, task, Component, resolvedProps, ref);\n popComponentStackInDEV(task);\n }\n\n function renderElement(request, task, type, props, ref) {\n if (typeof type === 'function') {\n if (shouldConstruct$1(type)) {\n renderClassComponent(request, task, type, props);\n return;\n } else {\n renderIndeterminateComponent(request, task, type, props);\n return;\n }\n }\n\n if (typeof type === 'string') {\n renderHostElement(request, task, type, props);\n return;\n }\n\n switch (type) {\n // TODO: LegacyHidden acts the same as a fragment. This only works\n // because we currently assume that every instance of LegacyHidden is\n // accompanied by a host component wrapper. In the hidden mode, the host\n // component is given a `hidden` attribute, which ensures that the\n // initial HTML is not visible. To support the use of LegacyHidden as a\n // true fragment, without an extra DOM node, we would have to hide the\n // initial HTML in some other way.\n // TODO: Add REACT_OFFSCREEN_TYPE here too with the same capability.\n case REACT_LEGACY_HIDDEN_TYPE:\n case REACT_DEBUG_TRACING_MODE_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_FRAGMENT_TYPE:\n {\n renderNodeDestructive(request, task, props.children);\n return;\n }\n\n case REACT_SUSPENSE_LIST_TYPE:\n {\n pushBuiltInComponentStackInDEV(task, 'SuspenseList'); // TODO: SuspenseList should control the boundaries.\n\n renderNodeDestructive(request, task, props.children);\n popComponentStackInDEV(task);\n return;\n }\n\n case REACT_SCOPE_TYPE:\n {\n throw new Error('ReactDOMServer does not yet support scope components.');\n }\n // eslint-disable-next-line-no-fallthrough\n\n case REACT_SUSPENSE_TYPE:\n {\n {\n renderSuspenseBoundary(request, task, props);\n }\n return;\n }\n }\n\n if (_typeof(type) === 'object' && type !== null) {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n {\n renderForwardRef(request, task, type, props, ref);\n return;\n }\n\n case REACT_MEMO_TYPE:\n {\n renderMemo(request, task, type, props, ref);\n return;\n }\n\n case REACT_PROVIDER_TYPE:\n {\n renderContextProvider(request, task, type, props);\n return;\n }\n\n case REACT_CONTEXT_TYPE:\n {\n renderContextConsumer(request, task, type, props);\n return;\n }\n\n case REACT_LAZY_TYPE:\n {\n renderLazyComponent(request, task, type, props);\n return;\n }\n }\n }\n\n var info = '';\n {\n if (type === undefined || _typeof(type) === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and \" + 'named imports.';\n }\n }\n throw new Error('Element type is invalid: expected a string (for built-in ' + 'components) or a class/function (for composite components) ' + (\"but got: \" + (type == null ? type : _typeof(type)) + \".\" + info));\n }\n\n function validateIterable(iterable, iteratorFn) {\n {\n // We don't support rendering Generators because it's a mutation.\n // See https://github.com/facebook/react/issues/12995\n if (typeof Symbol === 'function' && // $FlowFixMe Flow doesn't know about toStringTag\n iterable[Symbol.toStringTag] === 'Generator') {\n if (!didWarnAboutGenerators) {\n error('Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.');\n }\n\n didWarnAboutGenerators = true;\n } // Warn about using Maps as children\n\n\n if (iterable.entries === iteratorFn) {\n if (!didWarnAboutMaps) {\n error('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');\n }\n\n didWarnAboutMaps = true;\n }\n }\n }\n\n function renderNodeDestructive(request, task, node) {\n {\n // In Dev we wrap renderNodeDestructiveImpl in a try / catch so we can capture\n // a component stack at the right place in the tree. We don't do this in renderNode\n // becuase it is not called at every layer of the tree and we may lose frames\n try {\n return renderNodeDestructiveImpl(request, task, node);\n } catch (x) {\n if (_typeof(x) === 'object' && x !== null && typeof x.then === 'function') ;else {\n // This is an error, stash the component stack if it is null.\n lastBoundaryErrorComponentStackDev = lastBoundaryErrorComponentStackDev !== null ? lastBoundaryErrorComponentStackDev : getCurrentStackInDEV();\n } // rethrow so normal suspense logic can handle thrown value accordingly\n\n throw x;\n }\n }\n } // This function by it self renders a node and consumes the task by mutating it\n // to update the current execution state.\n\n\n function renderNodeDestructiveImpl(request, task, node) {\n // Stash the node we're working on. We'll pick up from this task in case\n // something suspends.\n task.node = node; // Handle object types\n\n if (_typeof(node) === 'object' && node !== null) {\n switch (node.$$typeof) {\n case REACT_ELEMENT_TYPE:\n {\n var element = node;\n var type = element.type;\n var props = element.props;\n var ref = element.ref;\n renderElement(request, task, type, props, ref);\n return;\n }\n\n case REACT_PORTAL_TYPE:\n throw new Error('Portals are not currently supported by the server renderer. ' + 'Render them conditionally so that they only appear on the client render.');\n // eslint-disable-next-line-no-fallthrough\n\n case REACT_LAZY_TYPE:\n {\n var lazyNode = node;\n var payload = lazyNode._payload;\n var init = lazyNode._init;\n var resolvedNode;\n {\n try {\n resolvedNode = init(payload);\n } catch (x) {\n if (_typeof(x) === 'object' && x !== null && typeof x.then === 'function') {\n // this Lazy initializer is suspending. push a temporary frame onto the stack so it can be\n // popped off in spawnNewSuspendedTask. This aligns stack behavior between Lazy in element position\n // vs Component position. We do not want the frame for Errors so we exclusively do this in\n // the wakeable branch\n pushBuiltInComponentStackInDEV(task, 'Lazy');\n }\n\n throw x;\n }\n }\n renderNodeDestructive(request, task, resolvedNode);\n return;\n }\n }\n\n if (isArray(node)) {\n renderChildrenArray(request, task, node);\n return;\n }\n\n var iteratorFn = getIteratorFn(node);\n\n if (iteratorFn) {\n {\n validateIterable(node, iteratorFn);\n }\n var iterator = iteratorFn.call(node);\n\n if (iterator) {\n // We need to know how many total children are in this set, so that we\n // can allocate enough id slots to acommodate them. So we must exhaust\n // the iterator before we start recursively rendering the children.\n // TODO: This is not great but I think it's inherent to the id\n // generation algorithm.\n var step = iterator.next(); // If there are not entries, we need to push an empty so we start by checking that.\n\n if (!step.done) {\n var children = [];\n\n do {\n children.push(step.value);\n step = iterator.next();\n } while (!step.done);\n\n renderChildrenArray(request, task, children);\n return;\n }\n\n return;\n }\n }\n\n var childString = Object.prototype.toString.call(node);\n throw new Error(\"Objects are not valid as a React child (found: \" + (childString === '[object Object]' ? 'object with keys {' + Object.keys(node).join(', ') + '}' : childString) + \"). \" + 'If you meant to render a collection of children, use an array ' + 'instead.');\n }\n\n if (typeof node === 'string') {\n var segment = task.blockedSegment;\n segment.lastPushedText = pushTextInstance(task.blockedSegment.chunks, node, request.responseState, segment.lastPushedText);\n return;\n }\n\n if (typeof node === 'number') {\n var _segment = task.blockedSegment;\n _segment.lastPushedText = pushTextInstance(task.blockedSegment.chunks, '' + node, request.responseState, _segment.lastPushedText);\n return;\n }\n\n {\n if (typeof node === 'function') {\n error('Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of from render. ' + 'Or maybe you meant to call this function rather than return it.');\n }\n }\n }\n\n function renderChildrenArray(request, task, children) {\n var totalChildren = children.length;\n\n for (var i = 0; i < totalChildren; i++) {\n var prevTreeContext = task.treeContext;\n task.treeContext = pushTreeContext(prevTreeContext, totalChildren, i);\n\n try {\n // We need to use the non-destructive form so that we can safely pop back\n // up and render the sibling if something suspends.\n renderNode(request, task, children[i]);\n } finally {\n task.treeContext = prevTreeContext;\n }\n }\n }\n\n function spawnNewSuspendedTask(request, task, x) {\n // Something suspended, we'll need to create a new segment and resolve it later.\n var segment = task.blockedSegment;\n var insertionIndex = segment.chunks.length;\n var newSegment = createPendingSegment(request, insertionIndex, null, segment.formatContext, // Adopt the parent segment's leading text embed\n segment.lastPushedText, // Assume we are text embedded at the trailing edge\n true);\n segment.children.push(newSegment); // Reset lastPushedText for current Segment since the new Segment \"consumed\" it\n\n segment.lastPushedText = false;\n var newTask = createTask(request, task.node, task.blockedBoundary, newSegment, task.abortSet, task.legacyContext, task.context, task.treeContext);\n {\n if (task.componentStack !== null) {\n // We pop one task off the stack because the node that suspended will be tried again,\n // which will add it back onto the stack.\n newTask.componentStack = task.componentStack.parent;\n }\n }\n var ping = newTask.ping;\n x.then(ping, ping);\n } // This is a non-destructive form of rendering a node. If it suspends it spawns\n // a new task and restores the context of this task to what it was before.\n\n\n function renderNode(request, task, node) {\n // TODO: Store segment.children.length here and reset it in case something\n // suspended partially through writing something.\n // Snapshot the current context in case something throws to interrupt the\n // process.\n var previousFormatContext = task.blockedSegment.formatContext;\n var previousLegacyContext = task.legacyContext;\n var previousContext = task.context;\n var previousComponentStack = null;\n {\n previousComponentStack = task.componentStack;\n }\n\n try {\n return renderNodeDestructive(request, task, node);\n } catch (x) {\n resetHooksState();\n\n if (_typeof(x) === 'object' && x !== null && typeof x.then === 'function') {\n spawnNewSuspendedTask(request, task, x); // Restore the context. We assume that this will be restored by the inner\n // functions in case nothing throws so we don't use \"finally\" here.\n\n task.blockedSegment.formatContext = previousFormatContext;\n task.legacyContext = previousLegacyContext;\n task.context = previousContext; // Restore all active ReactContexts to what they were before.\n\n switchContext(previousContext);\n {\n task.componentStack = previousComponentStack;\n }\n return;\n } else {\n // Restore the context. We assume that this will be restored by the inner\n // functions in case nothing throws so we don't use \"finally\" here.\n task.blockedSegment.formatContext = previousFormatContext;\n task.legacyContext = previousLegacyContext;\n task.context = previousContext; // Restore all active ReactContexts to what they were before.\n\n switchContext(previousContext);\n {\n task.componentStack = previousComponentStack;\n } // We assume that we don't need the correct context.\n // Let's terminate the rest of the tree and don't render any siblings.\n\n throw x;\n }\n }\n }\n\n function erroredTask(request, boundary, segment, error) {\n // Report the error to a global handler.\n var errorDigest = logRecoverableError(request, error);\n\n if (boundary === null) {\n fatalError(request, error);\n } else {\n boundary.pendingTasks--;\n\n if (!boundary.forceClientRender) {\n boundary.forceClientRender = true;\n boundary.errorDigest = errorDigest;\n {\n captureBoundaryErrorDetailsDev(boundary, error);\n } // Regardless of what happens next, this boundary won't be displayed,\n // so we can flush it, if the parent already flushed.\n\n if (boundary.parentFlushed) {\n // We don't have a preference where in the queue this goes since it's likely\n // to error on the client anyway. However, intentionally client-rendered\n // boundaries should be flushed earlier so that they can start on the client.\n // We reuse the same queue for errors.\n request.clientRenderedBoundaries.push(boundary);\n }\n }\n }\n\n request.allPendingTasks--;\n\n if (request.allPendingTasks === 0) {\n var onAllReady = request.onAllReady;\n onAllReady();\n }\n }\n\n function abortTaskSoft(task) {\n // This aborts task without aborting the parent boundary that it blocks.\n // It's used for when we didn't need this task to complete the tree.\n // If task was needed, then it should use abortTask instead.\n var request = this;\n var boundary = task.blockedBoundary;\n var segment = task.blockedSegment;\n segment.status = ABORTED;\n finishedTask(request, boundary, segment);\n }\n\n function abortTask(task, request, reason) {\n // This aborts the task and aborts the parent that it blocks, putting it into\n // client rendered mode.\n var boundary = task.blockedBoundary;\n var segment = task.blockedSegment;\n segment.status = ABORTED;\n\n if (boundary === null) {\n request.allPendingTasks--; // We didn't complete the root so we have nothing to show. We can close\n // the request;\n\n if (request.status !== CLOSED) {\n request.status = CLOSED;\n\n if (request.destination !== null) {\n close(request.destination);\n }\n }\n } else {\n boundary.pendingTasks--;\n\n if (!boundary.forceClientRender) {\n boundary.forceClientRender = true;\n\n var _error = reason === undefined ? new Error('The render was aborted by the server without a reason.') : reason;\n\n boundary.errorDigest = request.onError(_error);\n {\n var errorPrefix = 'The server did not finish this Suspense boundary: ';\n\n if (_error && typeof _error.message === 'string') {\n _error = errorPrefix + _error.message;\n } else {\n // eslint-disable-next-line react-internal/safe-string-coercion\n _error = errorPrefix + String(_error);\n }\n\n var previousTaskInDev = currentTaskInDEV;\n currentTaskInDEV = task;\n\n try {\n captureBoundaryErrorDetailsDev(boundary, _error);\n } finally {\n currentTaskInDEV = previousTaskInDev;\n }\n }\n\n if (boundary.parentFlushed) {\n request.clientRenderedBoundaries.push(boundary);\n }\n } // If this boundary was still pending then we haven't already cancelled its fallbacks.\n // We'll need to abort the fallbacks, which will also error that parent boundary.\n\n\n boundary.fallbackAbortableTasks.forEach(function (fallbackTask) {\n return abortTask(fallbackTask, request, reason);\n });\n boundary.fallbackAbortableTasks.clear();\n request.allPendingTasks--;\n\n if (request.allPendingTasks === 0) {\n var onAllReady = request.onAllReady;\n onAllReady();\n }\n }\n }\n\n function queueCompletedSegment(boundary, segment) {\n if (segment.chunks.length === 0 && segment.children.length === 1 && segment.children[0].boundary === null) {\n // This is an empty segment. There's nothing to write, so we can instead transfer the ID\n // to the child. That way any existing references point to the child.\n var childSegment = segment.children[0];\n childSegment.id = segment.id;\n childSegment.parentFlushed = true;\n\n if (childSegment.status === COMPLETED) {\n queueCompletedSegment(boundary, childSegment);\n }\n } else {\n var completedSegments = boundary.completedSegments;\n completedSegments.push(segment);\n }\n }\n\n function finishedTask(request, boundary, segment) {\n if (boundary === null) {\n if (segment.parentFlushed) {\n if (request.completedRootSegment !== null) {\n throw new Error('There can only be one root segment. This is a bug in React.');\n }\n\n request.completedRootSegment = segment;\n }\n\n request.pendingRootTasks--;\n\n if (request.pendingRootTasks === 0) {\n // We have completed the shell so the shell can't error anymore.\n request.onShellError = noop$1;\n var onShellReady = request.onShellReady;\n onShellReady();\n }\n } else {\n boundary.pendingTasks--;\n if (boundary.forceClientRender) ;else if (boundary.pendingTasks === 0) {\n // This must have been the last segment we were waiting on. This boundary is now complete.\n if (segment.parentFlushed) {\n // Our parent segment already flushed, so we need to schedule this segment to be emitted.\n // If it is a segment that was aborted, we'll write other content instead so we don't need\n // to emit it.\n if (segment.status === COMPLETED) {\n queueCompletedSegment(boundary, segment);\n }\n }\n\n if (boundary.parentFlushed) {\n // The segment might be part of a segment that didn't flush yet, but if the boundary's\n // parent flushed, we need to schedule the boundary to be emitted.\n request.completedBoundaries.push(boundary);\n } // We can now cancel any pending task on the fallback since we won't need to show it anymore.\n // This needs to happen after we read the parentFlushed flags because aborting can finish\n // work which can trigger user code, which can start flushing, which can change those flags.\n\n\n boundary.fallbackAbortableTasks.forEach(abortTaskSoft, request);\n boundary.fallbackAbortableTasks.clear();\n } else {\n if (segment.parentFlushed) {\n // Our parent already flushed, so we need to schedule this segment to be emitted.\n // If it is a segment that was aborted, we'll write other content instead so we don't need\n // to emit it.\n if (segment.status === COMPLETED) {\n queueCompletedSegment(boundary, segment);\n var completedSegments = boundary.completedSegments;\n\n if (completedSegments.length === 1) {\n // This is the first time since we last flushed that we completed anything.\n // We can schedule this boundary to emit its partially completed segments early\n // in case the parent has already been flushed.\n if (boundary.parentFlushed) {\n request.partialBoundaries.push(boundary);\n }\n }\n }\n }\n }\n }\n\n request.allPendingTasks--;\n\n if (request.allPendingTasks === 0) {\n // This needs to be called at the very end so that we can synchronously write the result\n // in the callback if needed.\n var onAllReady = request.onAllReady;\n onAllReady();\n }\n }\n\n function retryTask(request, task) {\n var segment = task.blockedSegment;\n\n if (segment.status !== PENDING) {\n // We completed this by other means before we had a chance to retry it.\n return;\n } // We restore the context to what it was when we suspended.\n // We don't restore it after we leave because it's likely that we'll end up\n // needing a very similar context soon again.\n\n\n switchContext(task.context);\n var prevTaskInDEV = null;\n {\n prevTaskInDEV = currentTaskInDEV;\n currentTaskInDEV = task;\n }\n\n try {\n // We call the destructive form that mutates this task. That way if something\n // suspends again, we can reuse the same task instead of spawning a new one.\n renderNodeDestructive(request, task, task.node);\n pushSegmentFinale(segment.chunks, request.responseState, segment.lastPushedText, segment.textEmbedded);\n task.abortSet.delete(task);\n segment.status = COMPLETED;\n finishedTask(request, task.blockedBoundary, segment);\n } catch (x) {\n resetHooksState();\n\n if (_typeof(x) === 'object' && x !== null && typeof x.then === 'function') {\n // Something suspended again, let's pick it back up later.\n var ping = task.ping;\n x.then(ping, ping);\n } else {\n task.abortSet.delete(task);\n segment.status = ERRORED;\n erroredTask(request, task.blockedBoundary, segment, x);\n }\n } finally {\n {\n currentTaskInDEV = prevTaskInDEV;\n }\n }\n }\n\n function performWork(request) {\n if (request.status === CLOSED) {\n return;\n }\n\n var prevContext = getActiveContext();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = Dispatcher;\n var prevGetCurrentStackImpl;\n {\n prevGetCurrentStackImpl = ReactDebugCurrentFrame$1.getCurrentStack;\n ReactDebugCurrentFrame$1.getCurrentStack = getCurrentStackInDEV;\n }\n var prevResponseState = currentResponseState;\n setCurrentResponseState(request.responseState);\n\n try {\n var pingedTasks = request.pingedTasks;\n var i;\n\n for (i = 0; i < pingedTasks.length; i++) {\n var task = pingedTasks[i];\n retryTask(request, task);\n }\n\n pingedTasks.splice(0, i);\n\n if (request.destination !== null) {\n flushCompletedQueues(request, request.destination);\n }\n } catch (error) {\n logRecoverableError(request, error);\n fatalError(request, error);\n } finally {\n setCurrentResponseState(prevResponseState);\n ReactCurrentDispatcher$1.current = prevDispatcher;\n {\n ReactDebugCurrentFrame$1.getCurrentStack = prevGetCurrentStackImpl;\n }\n\n if (prevDispatcher === Dispatcher) {\n // This means that we were in a reentrant work loop. This could happen\n // in a renderer that supports synchronous work like renderToString,\n // when it's called from within another renderer.\n // Normally we don't bother switching the contexts to their root/default\n // values when leaving because we'll likely need the same or similar\n // context again. However, when we're inside a synchronous loop like this\n // we'll to restore the context to what it was before returning.\n switchContext(prevContext);\n }\n }\n }\n\n function flushSubtree(request, destination, segment) {\n segment.parentFlushed = true;\n\n switch (segment.status) {\n case PENDING:\n {\n // We're emitting a placeholder for this segment to be filled in later.\n // Therefore we'll need to assign it an ID - to refer to it by.\n var segmentID = segment.id = request.nextSegmentId++; // When this segment finally completes it won't be embedded in text since it will flush separately\n\n segment.lastPushedText = false;\n segment.textEmbedded = false;\n return writePlaceholder(destination, request.responseState, segmentID);\n }\n\n case COMPLETED:\n {\n segment.status = FLUSHED;\n var r = true;\n var chunks = segment.chunks;\n var chunkIdx = 0;\n var children = segment.children;\n\n for (var childIdx = 0; childIdx < children.length; childIdx++) {\n var nextChild = children[childIdx]; // Write all the chunks up until the next child.\n\n for (; chunkIdx < nextChild.index; chunkIdx++) {\n writeChunk(destination, chunks[chunkIdx]);\n }\n\n r = flushSegment(request, destination, nextChild);\n } // Finally just write all the remaining chunks\n\n\n for (; chunkIdx < chunks.length - 1; chunkIdx++) {\n writeChunk(destination, chunks[chunkIdx]);\n }\n\n if (chunkIdx < chunks.length) {\n r = writeChunkAndReturn(destination, chunks[chunkIdx]);\n }\n\n return r;\n }\n\n default:\n {\n throw new Error('Aborted, errored or already flushed boundaries should not be flushed again. This is a bug in React.');\n }\n }\n }\n\n function flushSegment(request, destination, segment) {\n var boundary = segment.boundary;\n\n if (boundary === null) {\n // Not a suspense boundary.\n return flushSubtree(request, destination, segment);\n }\n\n boundary.parentFlushed = true; // This segment is a Suspense boundary. We need to decide whether to\n // emit the content or the fallback now.\n\n if (boundary.forceClientRender) {\n // Emit a client rendered suspense boundary wrapper.\n // We never queue the inner boundary so we'll never emit its content or partial segments.\n writeStartClientRenderedSuspenseBoundary(destination, request.responseState, boundary.errorDigest, boundary.errorMessage, boundary.errorComponentStack); // Flush the fallback.\n\n flushSubtree(request, destination, segment);\n return writeEndClientRenderedSuspenseBoundary(destination, request.responseState);\n } else if (boundary.pendingTasks > 0) {\n // This boundary is still loading. Emit a pending suspense boundary wrapper.\n // Assign an ID to refer to the future content by.\n boundary.rootSegmentID = request.nextSegmentId++;\n\n if (boundary.completedSegments.length > 0) {\n // If this is at least partially complete, we can queue it to be partially emitted early.\n request.partialBoundaries.push(boundary);\n } /// This is the first time we should have referenced this ID.\n\n\n var id = boundary.id = assignSuspenseBoundaryID(request.responseState);\n writeStartPendingSuspenseBoundary(destination, request.responseState, id); // Flush the fallback.\n\n flushSubtree(request, destination, segment);\n return writeEndPendingSuspenseBoundary(destination, request.responseState);\n } else if (boundary.byteSize > request.progressiveChunkSize) {\n // This boundary is large and will be emitted separately so that we can progressively show\n // other content. We add it to the queue during the flush because we have to ensure that\n // the parent flushes first so that there's something to inject it into.\n // We also have to make sure that it's emitted into the queue in a deterministic slot.\n // I.e. we can't insert it here when it completes.\n // Assign an ID to refer to the future content by.\n boundary.rootSegmentID = request.nextSegmentId++;\n request.completedBoundaries.push(boundary); // Emit a pending rendered suspense boundary wrapper.\n\n writeStartPendingSuspenseBoundary(destination, request.responseState, boundary.id); // Flush the fallback.\n\n flushSubtree(request, destination, segment);\n return writeEndPendingSuspenseBoundary(destination, request.responseState);\n } else {\n // We can inline this boundary's content as a complete boundary.\n writeStartCompletedSuspenseBoundary(destination, request.responseState);\n var completedSegments = boundary.completedSegments;\n\n if (completedSegments.length !== 1) {\n throw new Error('A previously unvisited boundary must have exactly one root segment. This is a bug in React.');\n }\n\n var contentSegment = completedSegments[0];\n flushSegment(request, destination, contentSegment);\n return writeEndCompletedSuspenseBoundary(destination, request.responseState);\n }\n }\n\n function flushClientRenderedBoundary(request, destination, boundary) {\n return writeClientRenderBoundaryInstruction(destination, request.responseState, boundary.id, boundary.errorDigest, boundary.errorMessage, boundary.errorComponentStack);\n }\n\n function flushSegmentContainer(request, destination, segment) {\n writeStartSegment(destination, request.responseState, segment.formatContext, segment.id);\n flushSegment(request, destination, segment);\n return writeEndSegment(destination, segment.formatContext);\n }\n\n function flushCompletedBoundary(request, destination, boundary) {\n var completedSegments = boundary.completedSegments;\n var i = 0;\n\n for (; i < completedSegments.length; i++) {\n var segment = completedSegments[i];\n flushPartiallyCompletedSegment(request, destination, boundary, segment);\n }\n\n completedSegments.length = 0;\n return writeCompletedBoundaryInstruction(destination, request.responseState, boundary.id, boundary.rootSegmentID);\n }\n\n function flushPartialBoundary(request, destination, boundary) {\n var completedSegments = boundary.completedSegments;\n var i = 0;\n\n for (; i < completedSegments.length; i++) {\n var segment = completedSegments[i];\n\n if (!flushPartiallyCompletedSegment(request, destination, boundary, segment)) {\n i++;\n completedSegments.splice(0, i); // Only write as much as the buffer wants. Something higher priority\n // might want to write later.\n\n return false;\n }\n }\n\n completedSegments.splice(0, i);\n return true;\n }\n\n function flushPartiallyCompletedSegment(request, destination, boundary, segment) {\n if (segment.status === FLUSHED) {\n // We've already flushed this inline.\n return true;\n }\n\n var segmentID = segment.id;\n\n if (segmentID === -1) {\n // This segment wasn't previously referred to. This happens at the root of\n // a boundary. We make kind of a leap here and assume this is the root.\n var rootSegmentID = segment.id = boundary.rootSegmentID;\n\n if (rootSegmentID === -1) {\n throw new Error('A root segment ID must have been assigned by now. This is a bug in React.');\n }\n\n return flushSegmentContainer(request, destination, segment);\n } else {\n flushSegmentContainer(request, destination, segment);\n return writeCompletedSegmentInstruction(destination, request.responseState, segmentID);\n }\n }\n\n function flushCompletedQueues(request, destination) {\n beginWriting();\n\n try {\n // The structure of this is to go through each queue one by one and write\n // until the sink tells us to stop. When we should stop, we still finish writing\n // that item fully and then yield. At that point we remove the already completed\n // items up until the point we completed them.\n // TODO: Emit preloading.\n // TODO: It's kind of unfortunate to keep checking this array after we've already\n // emitted the root.\n var completedRootSegment = request.completedRootSegment;\n\n if (completedRootSegment !== null && request.pendingRootTasks === 0) {\n flushSegment(request, destination, completedRootSegment);\n request.completedRootSegment = null;\n writeCompletedRoot(destination, request.responseState);\n } // We emit client rendering instructions for already emitted boundaries first.\n // This is so that we can signal to the client to start client rendering them as\n // soon as possible.\n\n\n var clientRenderedBoundaries = request.clientRenderedBoundaries;\n var i;\n\n for (i = 0; i < clientRenderedBoundaries.length; i++) {\n var boundary = clientRenderedBoundaries[i];\n\n if (!flushClientRenderedBoundary(request, destination, boundary)) {\n request.destination = null;\n i++;\n clientRenderedBoundaries.splice(0, i);\n return;\n }\n }\n\n clientRenderedBoundaries.splice(0, i); // Next we emit any complete boundaries. It's better to favor boundaries\n // that are completely done since we can actually show them, than it is to emit\n // any individual segments from a partially complete boundary.\n\n var completedBoundaries = request.completedBoundaries;\n\n for (i = 0; i < completedBoundaries.length; i++) {\n var _boundary = completedBoundaries[i];\n\n if (!flushCompletedBoundary(request, destination, _boundary)) {\n request.destination = null;\n i++;\n completedBoundaries.splice(0, i);\n return;\n }\n }\n\n completedBoundaries.splice(0, i); // Allow anything written so far to flush to the underlying sink before\n // we continue with lower priorities.\n\n completeWriting(destination);\n beginWriting(destination); // TODO: Here we'll emit data used by hydration.\n // Next we emit any segments of any boundaries that are partially complete\n // but not deeply complete.\n\n var partialBoundaries = request.partialBoundaries;\n\n for (i = 0; i < partialBoundaries.length; i++) {\n var _boundary2 = partialBoundaries[i];\n\n if (!flushPartialBoundary(request, destination, _boundary2)) {\n request.destination = null;\n i++;\n partialBoundaries.splice(0, i);\n return;\n }\n }\n\n partialBoundaries.splice(0, i); // Next we check the completed boundaries again. This may have had\n // boundaries added to it in case they were too larged to be inlined.\n // New ones might be added in this loop.\n\n var largeBoundaries = request.completedBoundaries;\n\n for (i = 0; i < largeBoundaries.length; i++) {\n var _boundary3 = largeBoundaries[i];\n\n if (!flushCompletedBoundary(request, destination, _boundary3)) {\n request.destination = null;\n i++;\n largeBoundaries.splice(0, i);\n return;\n }\n }\n\n largeBoundaries.splice(0, i);\n } finally {\n completeWriting(destination);\n\n if (request.allPendingTasks === 0 && request.pingedTasks.length === 0 && request.clientRenderedBoundaries.length === 0 && request.completedBoundaries.length === 0 // We don't need to check any partially completed segments because\n // either they have pending task or they're complete.\n ) {\n {\n if (request.abortableTasks.size !== 0) {\n error('There was still abortable task at the root when we closed. This is a bug in React.');\n }\n } // We're done.\n\n close(destination);\n }\n }\n }\n\n function startWork(request) {\n scheduleWork(function () {\n return performWork(request);\n });\n }\n\n function startFlowing(request, destination) {\n if (request.status === CLOSING) {\n request.status = CLOSED;\n closeWithError(destination, request.fatalError);\n return;\n }\n\n if (request.status === CLOSED) {\n return;\n }\n\n if (request.destination !== null) {\n // We're already flowing.\n return;\n }\n\n request.destination = destination;\n\n try {\n flushCompletedQueues(request, destination);\n } catch (error) {\n logRecoverableError(request, error);\n fatalError(request, error);\n }\n } // This is called to early terminate a request. It puts all pending boundaries in client rendered state.\n\n\n function abort(request, reason) {\n try {\n var abortableTasks = request.abortableTasks;\n abortableTasks.forEach(function (task) {\n return abortTask(task, request, reason);\n });\n abortableTasks.clear();\n\n if (request.destination !== null) {\n flushCompletedQueues(request, request.destination);\n }\n } catch (error) {\n logRecoverableError(request, error);\n fatalError(request, error);\n }\n }\n\n function renderToReadableStream(children, options) {\n return new Promise(function (resolve, reject) {\n var onFatalError;\n var onAllReady;\n var allReady = new Promise(function (res, rej) {\n onAllReady = res;\n onFatalError = rej;\n });\n\n function onShellReady() {\n var stream = new ReadableStream({\n type: 'bytes',\n pull: function pull(controller) {\n startFlowing(request, controller);\n },\n cancel: function cancel(reason) {\n abort(request);\n }\n }, // $FlowFixMe size() methods are not allowed on byte streams.\n {\n highWaterMark: 0\n }); // TODO: Move to sub-classing ReadableStream.\n\n stream.allReady = allReady;\n resolve(stream);\n }\n\n function onShellError(error) {\n // If the shell errors the caller of `renderToReadableStream` won't have access to `allReady`.\n // However, `allReady` will be rejected by `onFatalError` as well.\n // So we need to catch the duplicate, uncatchable fatal error in `allReady` to prevent a `UnhandledPromiseRejection`.\n allReady.catch(function () {});\n reject(error);\n }\n\n var request = createRequest(children, createResponseState(options ? options.identifierPrefix : undefined, options ? options.nonce : undefined, options ? options.bootstrapScriptContent : undefined, options ? options.bootstrapScripts : undefined, options ? options.bootstrapModules : undefined), createRootFormatContext(options ? options.namespaceURI : undefined), options ? options.progressiveChunkSize : undefined, options ? options.onError : undefined, onAllReady, onShellReady, onShellError, onFatalError);\n\n if (options && options.signal) {\n var signal = options.signal;\n\n var listener = function listener() {\n abort(request, signal.reason);\n signal.removeEventListener('abort', listener);\n };\n\n signal.addEventListener('abort', listener);\n }\n\n startWork(request);\n });\n }\n\n exports.renderToReadableStream = renderToReadableStream;\n exports.version = ReactVersion;\n })();\n}","/**\n * @license React\n * react-dom.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\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'use strict';\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nif (process.env.NODE_ENV !== \"production\") {\n (function () {\n 'use strict';\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n\n if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === 'function') {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n }\n\n var React = require('react');\n\n var Scheduler = require('scheduler');\n\n var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n var suppressWarning = false;\n\n function setSuppressWarning(newSuppressWarning) {\n {\n suppressWarning = newSuppressWarning;\n }\n } // In DEV, calls to console.warn and console.error get replaced\n // by calls to these methods by a Babel plugin.\n //\n // In PROD (or in packages without access to React internals),\n // they are left as they are instead.\n\n\n function warn(format) {\n {\n if (!suppressWarning) {\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 printWarning('warn', format, args);\n }\n }\n }\n\n function error(format) {\n {\n if (!suppressWarning) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n }\n\n function printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n }\n\n var FunctionComponent = 0;\n var ClassComponent = 1;\n var IndeterminateComponent = 2; // Before we know whether it is function or class\n\n var HostRoot = 3; // Root of a host tree. Could be nested inside another node.\n\n var HostPortal = 4; // A subtree. Could be an entry point to a different renderer.\n\n var HostComponent = 5;\n var HostText = 6;\n var Fragment = 7;\n var Mode = 8;\n var ContextConsumer = 9;\n var ContextProvider = 10;\n var ForwardRef = 11;\n var Profiler = 12;\n var SuspenseComponent = 13;\n var MemoComponent = 14;\n var SimpleMemoComponent = 15;\n var LazyComponent = 16;\n var IncompleteClassComponent = 17;\n var DehydratedFragment = 18;\n var SuspenseListComponent = 19;\n var ScopeComponent = 21;\n var OffscreenComponent = 22;\n var LegacyHiddenComponent = 23;\n var CacheComponent = 24;\n var TracingMarkerComponent = 25; // -----------------------------------------------------------------------------\n\n var enableClientRenderFallbackOnTextMismatch = true; // TODO: Need to review this code one more time before landing\n // the react-reconciler package.\n\n var enableNewReconciler = false; // Support legacy Primer support on internal FB www\n\n var enableLazyContextPropagation = false; // FB-only usage. The new API has different semantics.\n\n var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n\n var enableSuspenseAvoidThisFallback = false; // Enables unstable_avoidThisFallback feature in Fizz\n // React DOM Chopping Block\n //\n // Similar to main Chopping Block but only flags related to React DOM. These are\n // grouped because we will likely batch all of them into a single major release.\n // -----------------------------------------------------------------------------\n // Disable support for comment nodes as React DOM containers. Already disabled\n // in open source, but www codebase still relies on it. Need to remove.\n\n var disableCommentsAsDOMContainers = true; // Disable javascript: URL strings in href for XSS protection.\n // and client rendering, mostly to allow JSX attributes to apply to the custom\n // element's object properties instead of only HTML attributes.\n // https://github.com/facebook/react/issues/11347\n\n var enableCustomElementPropertySupport = false; // Disables children for